Jump to content
Heads Up! This website is no longer maintained, if your a member from our era, consider joining the discord to say hello.
Sign in to follow this  

My crappy method.

Recommended Posts

This was my first attempt at makeing a protection hack its ok to laugh :D. This was actually trying to block the sprites from crashing. It'll work, but it won't work as perfect also the side effect you can't build sub units lol.

 

The hooks:

invoke JmpPatch, 423380h, addr SubUnitSafe
	invoke JmpPatch, 4E5D40h, addr DrawUnitHud

 

 

The methods

.data
BWFXN_DrawHudJmp3			   dd 4E5DA2h
BWFXN_DrawHudJmp2			   dd 4D6CA0h
BWFXN_DrawHudJmp1			   dd 4E5D88h
BWFXN_DrawUnitHUD		dd 4E5D40h
BWFXN_Sprite					dd 49E9A0h
BWFXN_Command				dd 4BFF70h
BWFXN_Subunit				dd 423380h
IssueCommand					dd 4858F0h
SelectedUnit				dd 68C134h
SubUnit						 dd 00h

.data?


.code

DrawUnitHud proc

PUSH EBP
MOV EBP,ESP
PUSH ECX
PUSH EBX
PUSH ESI
PUSH EDI
MOV EDI,EAX
MOVZX EAX,WORD PTR DS:[EDI+64]
TEST DWORD PTR DS:[EAX*4+664068h],2000000h
MOV ESI,DWORD PTR DS:[EDI+0Ch]
MOV BL,1
jmp [BWFXN_DrawHudJmp3]
MOVZX ECX,BYTE PTR DS:[EDI+4Ch]
TEST BYTE PTR DS:[ESI+0Eh],BL
MOV DL,BYTE PTR DS:[ECX+581D52h]
MOV BYTE PTR SS:[EBP-4h],DL
jmp [BWFXN_DrawHudJmp1]
MOV EAX,DWORD PTR SS:[EBP-4h]
PUSH 231
PUSH EAX
MOV EAX,ESI
CALL [BWFXN_DrawHudJmp2]
TEST EAX,EAX
jmp [BWFXN_DrawHudJmp1]
OR BYTE PTR DS:[ESI+0Eh],BL
MOV EDI,DWORD PTR DS:[EDI+0Ch]
MOV AL,BYTE PTR DS:[EDI+0Eh]
MOV CL,BYTE PTR SS:[EBP+8h]
OR AL,8
MOV BYTE PTR DS:[EDI+0Eh],AL
MOV BYTE PTR DS:[EDI+0Bh],CL
POP EDI
POP ESI
POP EBX
MOV ESP,EBP
POP EBP

RETN 4h
DrawUnitHud endp

SubUnitSafe proc

push ebp
mov ebp, esp
push ecx
mov edx, 1
lea ecx, dword ptr ss:[ebp-1]
call [BWFXN_DrawHudJmp1]
mov esp, ebp
pop ebp

@Protection:
call SubUnit
jmp DrawUnitHud

retn
SubUnitSafe endp

Share this post


Link to post

alotta mumbo jumbo to me.. lol.

Share this post


Link to post

i got bored of reading. what kind of protection?

Share this post


Link to post

oh, right. sorry. i skimmed through and missed that. i have a shorter method. it works fine. but nice job though.

Share this post


Link to post

Me wants to see method. :D

 

My/Suteki's method blocks all known crashes and is only about 20 lines long at the most. <:D

Share this post


Link to post
Me wants to see method. :D

 

My/Suteki's method blocks all known crashes and is only about 20 lines long at the most. <:D

Share this post


Link to post
Sign in to follow this  

×