glenc70 0 Newbie Poster

i am making my own trainers for games using c++, one of the main functions i use is the WriteProcessMemory but this is all good if you know the byte codes for the instructions i want to change like the nop instruction is 0x90 for example

(DWORD) instructioncode = "0x90";
WriteProcessMemory( hProc, 0x123ABC, &instructioncode, (DWORD)sizeof(instructioncode), NULL ); (not actual addtresses)

but how do i do it if i do NOT know the bytecodes can i do something like this (this does not work though

(DWORD) instructioncode = "dec [rax+0C]"
WriteProcessMemory(hProc, 0x123ABC, &instructioncode, (DWORD)sizeof(instructioncode), NULL);

anyhelp will be greatly appreciated

Thanks in advance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.