Programming and Coding
Programming and coding tips, help and solutions...
1,882 topics in this forum
-
Good Coding Practice?
by Jkimble- 7 replies
- 7k views
I just have a quick question. Is it considered bad coding practice to break out of a loop using a return statement? I have been told from previous professors that using "break" in a loop is a bad idea but not sure about using a return statement. I'm writing the code in Java. Thanks for any feedback.
-
- 12 replies
- 8.6k views
So I have a visual c++ keygen template, but it's just a terminal. It's for visual c++ 2010, but I can't make the main show the form and play the chiptune. The original main looks like this #include <stdafx.h> #include <iostream> #include <windows.h> #include "monday.h" //chiptune header file,change to any if you want #include "ufmod.h" #include <mmsystem.h> #include "Form1.h" HWAVEOUT* hWave=0;#pragma comment(lib,"winmm.lib") #pragma comment(lib,"ufmod.lib")using namespace std;int main(array<System::String ^> ^args) { hWave=uFMOD_PlaySong(table, (void*)sizeof(table), XM_MEMORY); system("PAUSE"); return EXIT_SUCCESS; } and this …
-
- 13 replies
- 7.1k views
I have a dll that i would like to use, however i'm not quite sure of how to use the functions provided by it. Using PE Explorer i find there there are 3 functions. The DLL is not packed. What is the best way to find out what arguments the functions take and return? more or less how can i find out how to use it without having the documentation? I also have a program that uses the dll properly but i think it might take more time to reverse the app to see how it uses the dll? Thanks.
-
Implementing POKEs in VB.NET
by euverve- 2 replies
- 6.5k views
I am new to VB.net but not new in gamehacking. I know how to use Olly Debugger. I am using Game Trainer Studio to create trainers. My question is how could we implement POKEs in VB.net. Example: Poke 00426C30 90 90 90 90
-
Code2Code.net: translates your C++ code into C#, VB.NET,
by CodeExplorer- 5 replies
- 7k views
Code2Code.net: translates your C++ code into C#, VB.NET, />http://code2code.net/
-
injection : how to add messagebox to exe
by Pushad- 3 replies
- 3.9k views
i want inject messagebox in exe from start with ollydbg
-
Inline OEP finder
by listito- 1 reply
- 14.9k views
I'd like to code an OEP finder for aspack for example, so to do it i'm going to have to make a simple debugger and do all things we ussualy do with olly to find it's oep?
-
Queryassemblyinfo - problem solved
by CodeExplorer- 3 replies
- 4k views
QueryAssemblyInfo ****s my brain if I remove the two comment (lines) gacfilepath will have the right path; if I don't gacfilepath will be null; Assembly executingasm = Assembly.GetExecutingAssembly(); string currentassemblyname = executingasm.Location; string asmname = executingasm.GetName().ToString(); //int untilat = asmname.IndexOf(", PublicKeyToken="); //asmname = asmname.Remove(untilat, asmname.Length-untilat); string gacfilepath = Fusionhelper.QueryAssemblyInfo(asmname); Any idea guys?
-
JaCIL: A .NET to Java Compiler
by CodeExplorer- 2 replies
- 5.3k views
JaCIL: A .NET to Java Compiler JaCIL (pronounced "jackal") is a project to create a byte-code compiler to translate .NET assemblies to Java class files. Link: />http://sourceforge.net/projects/jacil/
-
Windows Hook Library
by CodeExplorer- 0 replies
- 4.9k views
Windows Hook Library The WindowsHookLib is a single library to hook the mouse, keyboard and the clipboard system wide. WindowsHookLib library is written in C# and there for it uses Common Language Runtime (CLR). This means that the library can be referenced from various projects in Dot Net. The mouse and keyboard hooks are low level so you can use the Handled property of the MouseEventArgs or the KeyboardEventArgs to prevent the windows messages be passed to the other applications. Note you need to use the dll file not the classes in your projects; otherwise they might not work correctly. Link: />http://www.code2point.com/Project.aspx?proj=4
-
- 0 replies
- 3.6k views
Found a nice snippet it's from the book OReilly.C.Sharp.4.0.in.a.Nutshell Packing a single-file executable: using System; using System.IO; using System.Reflection; using System.Collections.Generic;public class Loader { static Dictionary <string, Assembly> libs = new Dictionary <string, Assembly>(); static void Main() { AppDomain.CurrentDomain.AssemblyResolve += FindAssem; Program.Go(); } static Assembly FindAssem (object sender, ResolveEventArgs args) { string shortName = new AssemblyName (args.Name).Name; if (libs.ContainsKey (shortName)) return libs [shortName]; using (Stream s = Assembly.GetExecutingAssembly(). Ge…
-
data transfer between user and kernel mode
by abhijit mohanta- 2 replies
- 5.6k views
I am new to device driver programming.I was going through the following link http://www.codeproject.com/KB/system/hide-driver.aspx NtQueryDirectoryfile in the diagram in the section named "NT Function Call Scheme and Hook" returns an process list. Can anybody tell me how does the list transferred to user mode. Please give me a little detailed description like how irp wud be filled with data etc.
-
c++ & gdi+: stretch a screenshot
by deepzero- 1 reply
- 7.3k views
hi, for quiet some time i am occupied by this little assignment: my code: int GetEncoderClsid(const WCHAR* format, CLSID* pClsid) { using namespace Gdiplus; UINT num = 0; // number of image encoders UINT size = 0; // size of the image encoder array in bytes ImageCodecInfo* pImageCodecInfo = NULL; GetImageEncodersSize(&num, &size); if(size == 0) return -1; // Failure pImageCodecInfo = (ImageCodecInfo*)(GlobalAlloc(0,size)); if(pImageCodecInfo == NULL) return -1; // Failure GetImageEncoders(num, size, pImageCodecInfo); for(UINT j = 0; j < num; ++j) { if( wcscmp(pImageCodecInfo[j].MimeType, format) == 0 ) { *pClsid = pImageC…
-
nasm assembler input output
by sage1130- 1 reply
- 14.2k views
I want to write an assembly language program for nasm assembler which will read an integer and print the same in linux. The program should keep reading integers until a particular integer say 50 occurs. When 50 occurs program should not print it and exit. But I don't know how to input integer. Can someone explain and give the complete asm program? Thanks
-
API Hooks Detours in MASM32
by clip- 12 replies
- 8.3k views
Hi, I'm working on a socket debugger, I know there are plenty of this around, but I want to learn how to make my own in MASM32. Initially I'm trying to hook the "send" function from wsock32.dll then open firefox. I would like to replace the information being sent by firefox with "Gotcha". I used jaghook for this. So far it's not working. Does anyone have a clue why? replace.asm .486 .model flat, stdcall option casemap: noneinclude \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\user32.inc include \masm32\include\wsock32.incincludelib \masm32\lib\kernel32.lib includelib \masm32\lib\user32.lib includelib \masm32\lib\wsock32.libincl…
-
How i can get commands of a debugged process ?
by mrousse83- 10 replies
- 4k views
Hello, I search how i can get each commands of a debugged process in OllyDbg. I think i need to use this function : ulong Readcommand(ulong ip,char *cmd); My program entry point : 004C5C74 > $ 55 PUSH EBP var Commande : string;if Readcommand($004C5C74, PAnsiChar(Commande)) > 0 then // success else // error But when u try it, it's not working Readcommand return all time 0 ! I need to have : Commande := 'PUSH EBP' Can you help me ? Thanks, Mathieu
-
- 2 replies
- 5.8k views
Hello, I need your help for make ollydbg.lib with the file ollydbg.def in Microsoft Visual C++ 2010 Express Edition. Thanks, Mathieu
-
Get Api name from address
by ragdog- 3 replies
- 15.6k views
Hi I coding a function to Get Api name from address. Now I am confused in my Iat have i this Address 74A44619 00403000 . 19467574 DD comctl32.InitCommonControls Ok i enum all process modules und parsing all found dll for this address for get the api name I use LoadLibrary and GetProcAddress with LoadLibrary and GetProcAddress get i this address 75AB1739 to the APi InitCommonControls Why? I use Win7 Thanks,
-
[Delphi] Reload Registry Settings...
by mAStEr pAIn- 3 replies
- 8.1k views
Hi Guys... Hope someone can help me out with a problem in delphi programming. First of all i'm coding in delphi since around 3 month. I want to describe my prob a little bit more... I'm using windows 7 x64. In win7 and also in win vista you can add program links to the task bar. But you can only do this when the string "IsShortcut" is written in the windows registry. When this string exists you have on your desktop some "freeky" arrows on your links. So i made a little app to write and delete this string to the registry. For now so good. But you only see the changes take effect when you log off and on again. Or you do a complete system restart. And theres my problem. I kn…
-
- 2 replies
- 6.2k views
Hi, I need you help me. I want to use SetWindowsHookEx to hook a function exported from a dll to a run a process but it did not work. Detail: I'm have 3 files: Audition.exe, Hooker.exe & DllHook.dll, I'm using Hooker.exe to load that dll & execute function SetHook (exported in dll for Hooker.exe use it). SetHook function in dll will excute to use SetWindowsHookEx to hook a other function in dll into Audition.exe. If hook success it'll show a nag is the PID of Audition.exe process is running. But it's hook isn't success. I want to you help me. This is code in DllHook: Project: This is project of it, i uploaded in attachment file. I hope yous hlp me right now. Tkz…
-
Win32 Assembly Cheat Sheet
by N1ghtm4r3- 0 replies
- 6.6k views
Handy thing.
-
AVR Assembly USART problem
by quosego- 6 replies
- 5.9k views
Hey all, Something else than those C++ and x86 asm programming stuff topics. Let's hope someone knows soemthing. I've been attempting to code an interrupt driven usart connection between an AVR chip board and the PC. (the PC is sending the data) However it seems that when an byte is recieved it keeps giving interrupts even when the buffer is read. (which should stop that according to the datasheet) Interrupt code which is properly triggered when recieving a byte but just keeps interrruptingand spamming my terminal: Serial_Recieve: ;store incoming bytes in r24,UDR out UDR, r24 reti Am I missing something here. Afaik I am initing the serial connecti…
-
wired visual studio problem
by deepzero- 6 replies
- 4.7k views
right, so yesterday night i had a native vsc++ 2008 project display a dialogbox using the DialogBox(...) functon. worked perfectly fine. i then went to bed, and when i got up this morning, the exact same DialogBox call would just return -1 and fail. I then did some further testing: 1) Creating a dialogbox with a list view on it always fails 2) creating a dialogbox with NO list view on it always succeeds. sometimes the dialog will get display correctly, sometimes the form-background is missing and some dialog items are floating around freely.it always takes up 100% cpu power. 3) creating a new,clean project with a dialog but no list view, it works in the beginning, but aft…
-
[C++] char Error
by argv_arteam- 2 replies
- 6.2k views
Hello. I have no idea why this code won't compile. I get: error C2440: 'return' : cannot convert from 'char *' to 'const char' error. I compiled it before. Can anyone take a look at the solution and try to fix the problem? It is only few KB is size and project is already created. Thanks in advance! Project.rar
-
[.NET] GacHelper
by sirp- 0 replies
- 5.1k views
voyce / gachelper A quick project to wrap the unmanaged C++ APIs in the .NET GAC API known as Fusion internally), in a way that they can be called easily from managed code (C#, F# etc). voyce gachelper Example where it's used using-mono-cecil-and-f-to-get-assembly-dependencies/