Skip to content

Commit

Permalink
idek
Browse files Browse the repository at this point in the history
  • Loading branch information
0xvpr committed Feb 25, 2024
1 parent 8878022 commit ccb1785
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 19 deletions.
Binary file removed resources/demo.gif
Binary file not shown.
44 changes: 25 additions & 19 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 All @@ -53,6 +57,8 @@ skip_player:

visibility_original:
mov eax, dword [esi + 0x1518]
; mov eax, 0x1
; nop

noise_original:
cmp edi, eax
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 ccb1785

Please sign in to comment.