home *** CD-ROM | disk | FTP | other *** search
- Comment % Stone's Windows 95 Trainer / Pseudo Resident Patcher
- I hope the code is pretty self explanatory....
- I may be emailed at: stone@one.se
- You can find me on the web: http://www.one.se/~stone
-
- Stone / United Cracking Force '98
- 2nd&Mi
- Hiho's to Acp & Patriarch.
-
- %
- .386P
- Locals
- jumps
-
- .Model Flat ,StdCall
-
-
- ;Define the needed external functions and constants here.
- Extrn ExitProcess:PROC
- Extrn MessageBoxA:PROC
- Extrn GetModuleHandleA:PROC
- Extrn GetWindowThreadProcessId:PROC
- Extrn FindWindowExA:PROC
- Extrn OpenProcess:PROC
- Extrn WriteProcessMemory:PROC
-
- .Data
- Title1 db 'Stone''s Win95 Trainer',0
- Message1 db 0dh,0ah,' PUSH OK to Destroy the world :) ',0dh,0ah,0
- Error db 'Error!!!',0
- ErrorMessage db 'Did you not load a target or something?',0
-
-
- ;---- information fitting TARGET.EXE
- Flaffer db 'FUCK!',0 ; name of window to find the process by
- ProcID dd 0 ; Process Identifier
- Flags dd 0c0h ; Open with these flags! (RWE)
- NumberOfBytes dd 0 ; this many bytes written
- From_Here db 'Stone Is God',0 ; write from this buffer
- HowManyToPatch dd 13 ; How many bytes to patch
- PatchThisOff dd 402008h ; patch at this offset (Virtual Address)
-
- .Code
- ;──────────────────────────────────────────────────────────────────────────────
- Main:
- push 0
- push offset Title1
- push offset Message1
- push 0
- call MessageBoxA
-
- xor eax,eax ; eax = 0
- push offset Flaffer ; find window
- push eax ; Desktop is parrent
- push eax ; no sub windows
- push eax ; ugh.. no nothing
- call FindWindowExA
- test eax,eax ; windows ID is eax
- jz abort ; for now we don't abort if not found
-
- push offset ProcID ; get ProcessID here
- push eax ; for this
- call GetWindowThreadProcessId ; fetch the owner process ID
- xor esi,esi
- test eax,eax
- jz abort
-
- push [ProcID] ; owner process ID
- push esi
- push offset Flags ; flags = Read/write
- call OpenProcess
- test eax,eax
- jz abort
-
-
- push offset NumberOfBytes ; Bytes written
- push [HowManyToPatch]
- push offset From_Here
- push [PatchThisOff] ; write to here
- push eax ; using this handle
- call WriteProcessMemory
-
-
- Exit_Proc: ; terminate
- Push LARGE-1
- Call ExitProcess
- abort:
- push 0
- push offset Error
- push offset ErrorMessage
- push 0
- call MessageBoxA
-
- jmp Exit_Proc
- ;──────────────────────────────────────────────────────────────────────────────
- End Main