Click here to Skip to main content
15,887,275 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a dll that this saved as byte array
I found a source code on the Internet
injecting a callback
I wanted to adapt the source code
to write in memory
the Dll that this saved as byte array

<pre lang="c++">
DWORD id;
BYTE *dll; //the Dll that this saved as byte array
DWORD ByteOfWriten;
HMODULE hModule = GetModuleHandle(NULL);

DWORD size=((PIMAGE_OPTIONAL_HEADER)((LPVOID)((BYTE*)(hModule)+((PIMAGE_DOS_HEADER)(hModule))->e_lfanew+sizeof(DWORD)+sizeof(IMAGE_FILE_HEADER))))->SizeOfImage;	

char * NewModule = (char*)VirtualAllocEx(hProc,hModule,size,MEM_COMMIT|MEM_RESERVE,PAGE_EXECUTE_READWRITE);

WriteProcessMemory(hProc,NewModule,hModule,size,&ByteOfWriten);

//CreateRemoteThread
Posted
Comments
Frankie-C 5-Mar-15 9:22am    
To do what?
Sergey Alexandrovich Kryukov 5-Mar-15 10:18am    
Why?
—SA
Hitmanlima 5-Mar-15 14:05pm    
need to inject the dll
gitokc 9-Mar-15 7:31am    
Using any tools, it is possible.
If you want coding, do you know subclassing ?
Hitmanlima 11-Mar-15 8:46am    
not

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900