home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Stone / windows / trainer.asm < prev    next >
Assembly Source File  |  2000-05-25  |  3KB  |  96 lines

  1. Comment % Stone's Windows 95 Trainer / Pseudo Resident Patcher
  2.      I hope the code is pretty self explanatory....
  3.      I may be emailed at: stone@one.se
  4.      You can find me on the web: http://www.one.se/~stone
  5.                     
  6.                     Stone / United Cracking Force '98
  7.                         2nd&Mi
  8.      Hiho's to Acp & Patriarch.
  9.  
  10.     %
  11. .386P
  12. Locals
  13. jumps
  14.  
  15. .Model Flat ,StdCall
  16.  
  17.  
  18. ;Define the needed external functions and constants here.
  19. Extrn           ExitProcess:PROC
  20. Extrn           MessageBoxA:PROC                
  21. Extrn        GetModuleHandleA:PROC
  22. Extrn        GetWindowThreadProcessId:PROC
  23. Extrn        FindWindowExA:PROC
  24. Extrn        OpenProcess:PROC
  25. Extrn        WriteProcessMemory:PROC
  26.  
  27. .Data                                        
  28. Title1          db 'Stone''s Win95 Trainer',0
  29. Message1        db 0dh,0ah,' PUSH OK to Destroy the world :) ',0dh,0ah,0
  30. Error        db 'Error!!!',0
  31. ErrorMessage    db 'Did you not load a target or something?',0
  32.  
  33.  
  34. ;---- information fitting TARGET.EXE 
  35. Flaffer        db 'FUCK!',0        ; name of window to find the process by
  36. ProcID        dd 0            ; Process Identifier
  37. Flags        dd 0c0h            ; Open with these flags! (RWE)
  38. NumberOfBytes    dd 0             ; this many bytes written
  39. From_Here    db 'Stone Is God',0    ; write from this buffer
  40. HowManyToPatch  dd 13            ; How many bytes to patch
  41. PatchThisOff    dd 402008h        ; patch at this offset (Virtual Address)
  42.  
  43. .Code                                  
  44. ;──────────────────────────────────────────────────────────────────────────────
  45. Main:
  46.     push 0
  47.     push offset Title1
  48.     push offset Message1
  49.     push 0
  50.     call MessageBoxA
  51.  
  52.     xor     eax,eax            ; eax = 0 
  53.     push    offset Flaffer        ; find window 
  54.     push    eax            ; Desktop is parrent
  55.     push    eax            ; no sub windows
  56.     push     eax            ; ugh.. no nothing
  57.     call     FindWindowExA
  58.     test    eax,eax            ; windows ID is eax
  59.     jz    abort            ; for now we don't abort if not found
  60.  
  61.     push offset ProcID        ; get ProcessID here
  62.     push eax            ; for this 
  63.     call GetWindowThreadProcessId    ; fetch the owner process ID
  64.     xor esi,esi
  65.     test eax,eax
  66.     jz   abort
  67.  
  68.     push [ProcID]            ; owner process ID
  69.     push esi    
  70.     push offset Flags        ; flags = Read/write
  71.     call OpenProcess
  72.     test eax,eax
  73.     jz abort
  74.     
  75.  
  76.     push offset NumberOfBytes    ; Bytes written
  77.     push [HowManyToPatch]
  78.     push offset From_Here
  79.     push [PatchThisOff]        ; write to here
  80.     push eax            ; using this handle
  81.     call WriteProcessMemory
  82.     
  83.     
  84. Exit_Proc:                ; terminate
  85.     Push LARGE-1
  86.     Call ExitProcess
  87. abort:
  88.     push 0
  89.     push offset Error
  90.     push offset ErrorMessage
  91.     push 0
  92.     call MessageBoxA
  93.  
  94.     jmp Exit_Proc
  95. ;──────────────────────────────────────────────────────────────────────────────
  96. End Main