• Categories

  • Archives

Hot-Patching & Hook-Hopping

**Note: While hook-hopping and hot-patching can be done in any language, the examples here will be in C.

I was just hook-hopping SetCursorPos, and also someone asked me a question about hook-hopping, so i decided..hey, why not make a blogpost about it?  :]

Let’s begin with hot-patching first, since it is easier to understand hook-hopping after this.

Continue reading

[C++] Using CreateDialog Function, and also Setting/Getting Item Text

Jacob/kb3z0n (from CEF) was asking me for help using SetDlgItemText, so I decided to make a guide on how to use dialogs inside of a dll, and also how to set/get text from items on your dialog. (Although i still recommend using CreateWindowEx instead of dialogs)

First we will go over how DLL’s work. When DLL files are injected, or loaded, the first function that is executed is called DllMain. Here is the prototype:

BOOL WINAPI DllMain(
__in  HINSTANCE hinstDLL,
__in  DWORD fdwReason,
__in  LPVOID lpvReserved
);

The first parameter is hinstDLL – this will be the instance of your dll, that you will use as the HANDLE to your program in CreateDialog.

fdwReason – this is the reason as to why your DLL was loaded…we’ll just go over the main reason for now:

DLL_PROCESS_ATTACH – this will be the main reason you will use..it is from the result of calling LoadLibrary on the dll, which is also the result of common “injecting,” and pretty much the only one you’ll use when beginning to code DLLs.

The last parameter in the function, lpvReserved, will be of no use to you, because it is nothing if the reason is DLL_PROCESS_ATTACH..so don’t worry about it.

Assuming you know how to make a resource file, (If not google it or something) we will continue on to the actual function to make the DialogBox appear.

Continue reading

New blog. woot?

I’ll be blogging more often, my other blog at blogspot kinda died, and i like WordPress’s layout better..

Whenever somebody asks me a question on MSN, expect the answer to be here.