Skip to content

Commit

Permalink
Merge pull request #14 from 0xvpr/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
0xvpr authored Feb 25, 2024
2 parents 3faf083 + 2c8876e commit c022902
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 21 deletions.
Binary file removed resources/demo.gif
Binary file not shown.
46 changes: 25 additions & 21 deletions src/hacks.asm
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
; -----------------------------------------------------------------------------
; Definitions
; -----------------------------------------------------------------------------
; --------------------------------------------------------------------------- ;
; Exported Functions ;
; --------------------------------------------------------------------------- ;

global _hack_god_mode
global _hack_ghost_mode
global _hack_disable_alarms

; --------------------------------------------------------------------------- ;
; Definitions ;
; --------------------------------------------------------------------------- ;

TYPE_PLAYER EQU 0x110E8B50
OFFSET_HEALTH EQU 0x003F07C8
OFFSET_VISIBILITY EQU 0x0027F12C
OFFSET_NOISE EQU 0x00417E5D
OFFSET_ALARMS EQU 0x0009BC61

; -----------------------------------------------------------------------------
; External Variables
; -----------------------------------------------------------------------------

extern _g_module_base_addr

; -----------------------------------------------------------------------------
; External Functions
; -----------------------------------------------------------------------------
; --------------------------------------------------------------------------- ;
; Imported Functions ;
; --------------------------------------------------------------------------- ;

extern _VirtualProtect@16

extern _memory_patch
extern _memory_detour

; -----------------------------------------------------------------------------
; Executable Code
; -----------------------------------------------------------------------------
section .text
global _hack_god_mode
global _hack_ghost_mode
global _hack_disable_alarms
; --------------------------------------------------------------------------- ;
; Imported Variables ;
; --------------------------------------------------------------------------- ;

extern _g_module_base_addr

; --------------------------------------------------------------------------- ;
; Executable Code ;
; --------------------------------------------------------------------------- ;
section .text
health_original:
sub eax, edx
mov dword [ebx], eax
Expand Down Expand Up @@ -122,8 +126,8 @@ ghost_mode_enabled:
call edi ; 10001fcc: ff d7
sub esp,0x10 ; 10001fce: 83 ec 10
mov edx,dword [esp+0x1c] ; 10001fd1: 8b 54 24 1c
mov dword [esi],0x90909090 ; 10001fd5: c7 06 90 90 90 90
mov dword [esi+0x4],0x5d99090 ; 10001fdb: c7 46 04 90 90 d9 05
mov dword [esi],0x000001B8 ; 10001fd5: c7 06 90 90 90 90
mov dword [esi+0x4],0x5d99000 ; 10001fdb: c7 46 04 90 90 d9 05
mov dword [esp+0xc],ebp ; 10001fe2: 89 6c 24 0c
mov dword [esp+0x8],edx ; 10001fe6: 89 54 24 08
mov dword [esp],esi ; 10001fea: 89 34 24
Expand Down
17 changes: 17 additions & 0 deletions src/health_detour.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
section .text

global _health_detour

_health_detour:
cmp dword [edi], 0x110E8B50
je $ + 0x08
xor eax, eax
mov eax, eax
mov dword [ebx], eax
mov ebx, eax
mov eax, dword [esp + 0x14]
pop esi
mov dword [eax], ebx
pop ebx
pop ecx
ret 0x8

0 comments on commit c022902

Please sign in to comment.