View previous topic :: View next topic |
Author |
Message |
rod143 How do I cheat?
Reputation: 0
Joined: 15 Sep 2009 Posts: 5
|
Posted: Thu Dec 03, 2009 11:54 pm Post subject: [HELP] inlining ASM to c++ |
|
|
i know a little bit in putting asm in VC++
But im stucked in the loadbinary thingy....
like this:
Code: | [enable]
alloc(newmem,2048)
alloc(dump,3140018) // Dump size
LABEL(ret)
loadbinary(dump, ew.CEM)
newmem:
cmp ecx,00400000
jb @f
cmp ecx,00A00000
ja @f
add ecx, dump-00400000
@@:
// Original code
MOV EAX,[EBP+10]
DB 56 57
JMP ret
00499CEB:
jmp newmem // Jump to hook
[disable]
00499CEB:
mov eax,[ebp+10]
push esi
push edi
dealloc(newmem)
dealloc(blaaaa) |
i now that in asm i should write like this:
void__declspec(naked) __stdcall ...()
{
_asm
{
newmem:
cmp ecx,00400000
jb @f
cmp ecx,00A00000
ja @f
add ecx, dump-00400000
@@:
// Original code
MOV EAX,[EBP+10]
DB 56 57
JMP ret}
}
but i know its lacking because the loadbinary() is not there......
Please any one help...
or if you could directly convert the code that i posted in C++ i would be happy for me to learn and see how it is made....
Thanks
|
|
Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Fri Dec 04, 2009 3:57 am Post subject: |
|
|
Read the file to unsigned char array and there you go. For C++, that is std::fstream
|
|
Back to top |
|
 |
`unknown Grandmaster Cheater
Reputation: 0
Joined: 20 Nov 2006 Posts: 658 Location: You lost the game.
|
Posted: Fri Dec 04, 2009 6:04 pm Post subject: |
|
|
Trying to bypass CRC in the game which is not to be named here any longer I see, that isn't the right function to hook but anyway...
Code: |
LPVOID __stdcall LoadBinary(__in size_t len)
{
LPVOID lpvRet;
lpvRet = VirtualAlloc(NULL, len, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
// feel free to change the protection if needed
if(lpvRet == NULL)
return NULL;
__try {
// feel free to change this too
memcpy(lpvRet, (void*)0x400000, len);
}
__except(1)
{
return NULL;
}
return lpvRet;
}
LPVOID lpvCopy = LoadBinary(0x600000);
if(lpvCopy == NULL)
{
// Error handling here
}
|
|
|
Back to top |
|
 |
rod143 How do I cheat?
Reputation: 0
Joined: 15 Sep 2009 Posts: 5
|
Posted: Sat Dec 05, 2009 6:46 am Post subject: |
|
|
thanks..... LPVOID __stdcall.... can it be written as VOID __stdcall?
........ how do i call that script from the inline?
|
|
Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sat Dec 05, 2009 7:07 am Post subject: |
|
|
LPVOID = void*
and you just call the function's name
|
|
Back to top |
|
 |
|