d3d9esp_s struct
regEdi dd ?
regEsi dd ?
regEbp dd ?
regEsp dd ?
regEbx dd ?
regEdx dd ?
regEcx dd ?
regEax dd ?
call_ret dd ?
arg1 dd ?
arg2 dd ?
arg3 dd ?
arg4 dd ?
arg5 dd ?
arg6 dd ?
arg7 dd ?
arg8 dd ?
d3d9esp_s ends
D3DXFONT_DESCA struct
height dd ?
d3width dd ?
Weight dd ?
MipLevels dd ?
Italic dd ?
CharSet dd ?
OutputPrecision dd ?
Quality dd ?
PitchAndFamily dd ?
FaceName db 256 dup(?)
D3DXFONT_DESCA ends
.data
pDirect3DCreate9 dd ?
Direct3DCreate9_ret dd ?
pCreateDevice dd ?
CreateDevice_ret dd ?
pCreateDevice_jmp dd ?
pIDirect3DDevice9 dd ?
pDxdevice dd ?
pD3DXCreateFontIndirectA dd ?
pPresent dd ?
lrect RECT<?>
ID3DXFont dd ?
lf D3DXFONT_DESCA<?>
d3dbuf db 256 dup(?)
.code
d3dajmpb proc a_addr:dword,b_addr:dword
local OldProtect
pushad
invoke IsBadWritePtr,a_addr,8
.if eax!=0
invoke VirtualProtect,a_addr,8,PAGE_EXECUTE_READWRITE,addr OldProtect
.endif
mov eax,a_addr
mov edx,b_addr
sub edx,eax
sub edx,5
mov byte ptr[eax],0e9h
xchg [eax+1],edx
popad
ret
d3dajmpb endp
lpfnBeginScene proc
mov eax,pIDirect3DDevice9
mov eax,dword ptr[eax]
mov ecx,dword ptr[eax]
mov eax,dword ptr[ecx+0a4h]
push pDxdevice
call eax
ret
lpfnBeginScene endp
lpfnEndScene proc
mov eax,pIDirect3DDevice9
mov eax,dword ptr[eax]
mov ecx,dword ptr[eax]
mov eax,dword ptr[ecx+0a8h]
push pDxdevice
call eax
ret
lpfnEndScene endp
formatstr proc
LOCAL lbuf[64]:byte
invoke crt_sprintf,addr lbuf,SADD("[%0.4f %0.4f %0.4f]",0),pos_x,pos_y,pos_z
invoke wsprintf,addr d3dbuf,SADD("%s",0),addr lbuf
ret
formatstr endp
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!