Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {PatchCall, GetDllOffset("D2Client.dll", 0xC39E6), (DWORD)myGameDraw_STUB, 5} ;Thought jmp might be the issue, gary suggested giving call a try instead
- 6FB739E0 /$ 51 PUSH ECX
- 6FB739E1 |. A1 C8ADBA6F MOV EAX,DWORD PTR DS:[6FBAADC8]
- 6FB739E6 |. E8 2DD74EF9 CALL DrawStub.69061118 ; call to a jmp, that leads to myGameDraw_STUB
- 6FB739EB |. 0F85 C4030000 JNZ D2Client.6FB73DB5
- 5D381118 E9 930A0000 JMP DrawStub.myGameDraw_STUB
- VOID __declspec(naked) myGameDraw_STUB()
- {
- __asm
- {
- pushad
- call GameDraw
- popad
- push ebx;
- xor ebx, ebx;
- cmp eax, ebx;
- push 0x6FB739EB;
- ret;
- }
- }
- 69061BB0 > 60 PUSHAD
- 69061BB1 E8 30F5FFFF CALL DrawStub.690610E6 ;call GameDraw
- VOID GameDraw(VOID)
- {
- //To see if stub works
- UnitAny *pUnit = D2CLIENT_GetPlayerUnit ();
- TextHook(270,588,1,"Gold: %d", ((D2COMMON_GetUnitStat(pUnit, 15, 0))) + (D2COMMON_GetUnitStat(pUnit, 14, 0)));
- }
- 6EDD1BC0 > 55 PUSH EBP
- 6EDD1BC1 8BEC MOV EBP,ESP ; Copy's the Stack pointer into EBP
- 6EDD1BC3 81EC CC000000 SUB ESP,0CC ;Subtract OCC from ESP
- 6EDD1BC9 53 PUSH EBX ;0
- 6EDD1BCA 56 PUSH ESI ;0
- 6EDD1BCB 57 PUSH EDI
- 6EDD1BCC 8DBD 34FFFFFF LEA EDI,DWORD PTR SS:[EBP-CC] ;Store the stack pointer EBP - CC in EDI
- 6EDD1BD2 B9 33000000 MOV ECX,33 ;Move 33 into ECX
- 6EDD1BD7 B8 CCCCCCCC MOV EAX,CCCCCCCC ;Some sort of padding or allocation for string reading?.
- 6EDD1BDC F3:AB REP STOS DWORD PTR ES:[EDI] ;EIP is set to 0 here, Crash. This -1 from EAX putting +1 into EDI in a loop like a string function
- ;This line looks like it's reading a char* array[size] for the strings being used, like hp/hp, mana/mana and so on.
- 6EDD1BDC F3:AB REP STOS DWORD PTR ES:[EDI] ;Fill 48(dec) DWORD's of CCCCCCCC into stack area; (even in release version)
- ;I have no idea why EIP is getting set to zero, causing the crash, because this is exactly the same injection process as the previous working stub with the only ;difference being the offset of where it's patched (and the stub's instructions in accordance). The Block above is also exactly the same when using the old working ;STUB.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement