![]() |
|
|
|
#1
|
|||
|
|||
|
Hello,
Quote:
Damn, if I'm programming a CRC check I would do it both on file and memory ! So ok, if it's done only on file, you're right, please forgive me.As you're creating yourself the process, retrieving the DLL base is easy with this API: EnumProcessModules. Then you can extract some information with those API's: -GetModuleBaseName -GetModuleFileName -GetModuleInformation There's also another by getting the PEB of the process, and reading some fields from it. In fact interesting fields for your case are located in the PEB_LDR_DATA struct which is a currently holding information about Loaded modules. This is a far complex way to retrieve the same informations. A problem comes when the DLL isn't loaded in the program and will be loaded later with a 'LoadLibrary'. Well, one possibility : -Hooking the LoadLibrary function from the program and then performing the above trick. Maybe threre are some other ways when the DLL is not loaded when launching the program but I can't see them... I'll try to code something, try also on your side. Regards, Neitsa. |
|
#2
|
|||
|
|||
|
Heres an asm example of retrieving imagebase without using any apis (in case you dont wanna worry about importing new functions):
hxxp://spiff.tripnet.se/~iczelion/files/kernel.zip The GetKernalBase proc is the one you want, and it shows the implementation at main. If you need some help with the example, let me know. Its pretty simple though. Crudd [RET] |
|
#3
|
|||
|
|||
|
i found that abel loader generator v2.30 and DAZAPATCHER work great when you need to patch a protected .dll file. Used both of them with arma apps and hasn't failed me now
|
|
#4
|
|||
|
|||
|
you can do something like
Code:
if(!CreateProcess(name,...))
{
printf("err createprocess");
return 0;
}
DebugLoop:
WaitForDebugEvent(&DebugEvent, INFINITE);
if(DebugEvent.dwDebugEventCode==LOAD_DLL_DEBUG_EVENT)
{
//DebugEvent.u.LoadDll.lpBaseOfDll - is base of dll
}
.
.
.
|
|
#5
|
|||
|
|||
|
i found that abel loader generator v2.30 and DAZAPATCHER work great when you need to patch a protected .dll file.
how? if loaders run an exe target .. how you patch those dll in mem. with a loader... |
|
#6
|
|||
|
|||
|
i just set it to load the exe and then set the patch data to the offest of the .dll
|
|
#7
|
|||
|
|||
|
Hello,
I don't understand the problem here. The dll will be loaded in the SAME context than the EXE file. Therefore, you could patch the dll if you could control the EXE file code. But what you can just do, is CreateProcess the EXE file, and then, instead of providing a VA inside the Target EXE (which you don't want to do, since you want to patch the dll), you just provide a VA inside the DLL to WriteProcessMemory, and since , the dll is in the same Address space (context) than the EXE file, you writeprocessmemory will work, and thus, you will be patching your protected dll without problems. Cheers. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Loader and Patch Dll file in C# | mcr4ck | Source Code | 0 | 06-19-2022 23:59 |
| Creating a Loader for DotNet Apps? | bball0002 | General Discussion | 2 | 09-24-2009 22:06 |