Answer the question
In order to leave comments, you need to log in
Substituting ASM instructions in another C++ application?
Hello! Having in my hands the address of residence ( 0x006EDDC8 ) of the instruction and its "bytes" ( D8 AE 84000000 must be replaced with D8 86 84000000 ) I want to change it a little using C ++ code.
How to do it and is it possible?
It is necessary here from this:
Change to this:
With the help of DLL (asi) in C ++.
Answer the question
In order to leave comments, you need to log in
#include <Windows.h>
inline void ChangeByte(DWORD _Adress, byte _NewByte) {
DWORD old_protect;
VirtualProtect((void*)_Adress, 1, PAGE_EXECUTE_READWRITE, &old_protect);
*(byte*)_Adress = _NewByte;
}
DWORD WINAPI MainTheard(LPVOID lpReserved)
{
ChangeByte(0x006EDDC9, 0x86);
return 0;
}
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
CreateThread(0, 0, MainTheard, 0, 0, 0);
break;
}
return 1;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question