const LPVOID D3RenderCursor = (LPVOID)0x00943260;
const LPVOID D3RenderCursorAsSelection = (LPVOID)0x0093C130;
const LPVOID D3RenderTextAndGUI = (LPVOID)0x00932960;
const LPVOID D3RenderParticles = (LPVOID)0x00A1D7A0;
const LPVOID D3RenderActorsAndMeshes = (LPVOID)0x00BDAF70;
const LPVOID D3RenderLandscapesAndMeshes = (LPVOID)0x009976B0;
const LPVOID D3CheckRenderDebugField = (LPVOID)0x008106B0;
const LPVOID D3EndScene = (LPVOID)0x009CDD30;
const LPVOID D3EndSceneAndPresent = (LPVOID)0x00981770;
If we look at the first function, this calls "EndScene" subroutine which calls IDirect3DDevice9->EndScene(), so if you want the offset to IDirect3DDevice9 dword_156D4F0 can be used.
[[dword_156D4F0+0x4A8]] = IDirect3DDevice9*
Code:
sub_9376C0 proc near
mov ecx, dword_156D4F0
mov eax, [ecx]
mov edx, [eax+60h]
jmp edx
sub_9376C0 endp
Code:
EndScene proc near ; DATA XREF: .rdata:012D3BC0o
mov eax, [ecx+4A8h]
mov ecx, [eax]
mov edx, [ecx+0A8h]
push eax
call edx
retn
EndScene endp
So, if you wanna render anything useful you need to get Input from Diablo3. I tried hooking in various places to intercept VM_LEFTBUTTONCLICK and the like. I think it's a better idea to just hook DispatchMessage.
Just patch mov ebx, ds : DispatchMessageA to mov ebx, DispatchMessageHook. Note however, that your instruction will be 0xBB + OFFSET. This is only 5 bytes, be sure to pad with an extra NOP.
Thanks to shadow^dancer for being there for me while i crashed repeatidly because I didn't notice original instruction was 6 bytes
Code:
sub_814070 proc near
;.....
mov ebx, ds:DispatchMessageA
push edi
mov edi, ds:TranslateMessage
lea ecx, [ecx+0]
loc_8140A0: ; CODE XREF: sub_814070+4Cj
lea ecx, [ebp+var_1C]
push ecx
. call edi ; TranslateMessage
lea edx, [ebp+var_1C]
push edx
call ebx ; DispatchMessageA
;....
sub_814070 endp