All pastes #101074 Raw Edit

GTA Trainer

public text v1 · immutable
#101074 ·published 2006-07-26 18:03 UTC
rendered paste body
;-===========================================================-;
;-==================GTA 3 Trainer============================-;
;-==================Written With FASM========================-;
;-==================By Lugz==================================-;
;-===========================================================-;
; Credits - _masta_
format PE GUI 4.0
entry start

include 'C:\Documents and Settings\FeliaMyazz\Desktop\fasmw167\INCLUDE\win32a.inc'

PROCESS_VM_WRITE    equ 020h            ; Flags for the write-access
PROCESS_VM_OPERATION    equ 008h        ; to the process

money_pos = 0094139Ch


; data begins
section '.data' data readable writeable



caption db "GTA 3 Trainer",0

text    db "This Trainer Increases Your Money By 999,999",13,10
        db "Credits are RedGhost and _masta_",13,10,0


err_cap db "ERROR",0    ; caption for error messages

notrun db "Sorry, GTA 3 Is Not Running",0    ; error if process isnt running

no_write db "A Problem by writing",13,10
         db "to GTA 3's memory",13,10,0

readycap db "Ready",0    ; caption for ready

readytxt db "Now Your Money Is Increased By 999,999",0 ; text for ready

money_v dd 999999       ; how much do you want

nopage dd 0x90
wnd_name db "GTA3",0         ;name of GTA 3 Window
cls_name db "Grand theft auto 3",0       ; class of the window

pid_sc   dd ?                   ; Here we save the PID ...


p_hand   dd ?                   ; and here the handle to the
                                ; process

;----------------------------------------------------------------
section '.code' code readable executable

 start:
        invoke  MessageBox,HWND_DESKTOP,text,caption,0

is_RUN:
      ; find window handle with window class and name
       invoke Sleep,5  ; doing this lessens the cpu usage
       invoke FindWindow,0,wnd_name
       cmp  eax,0          ; if 0, window is not existing
       jz   isnt_run_end; -->Game is not launched

       invoke GetWindowThreadProcessId,eax,[pid_sc]

open_the_process:
     ; Get handle of the game
    invoke OpenProcess,PROCESS_VM_WRITE OR PROCESS_VM_OPERATION,0,[pid_sc]
    mov [p_hand],eax     ; Save handle to p_hand


increase_money:

   ; increase the money
    invoke WriteProcessMemory,[p_hand],money_pos,money_v,4,0
    cmp  eax,0
    jz   error_on_write    ; If any error while writing (eax=0) -> end


Trainer_ready:

    invoke MessageBox,0,readycap,readytxt,0 ;everything OK



close_the_PID_Handle:

    invoke CloseHandle,[p_hand]
    jmp  end_           ; Go to End



error_on_write:


        invoke MessageBox,0,no_write,err_cap,0
        jmp  close_the_PID_Handle ; Close handle before quit


isnt_run_end:



        invoke MessageBox,0,notrun,err_cap,0
    
end_:
       invoke   ExitProcess,0

;-----------------------------------------------------------------
section '.idata' import data readable writeable

  library kernel32,'KERNEL32.DLL',\
          user32,'USER32.DLL'

  include 'C:\Documents and Settings\FeliaMyazz\Desktop\fasmw167\INCLUDE\apia\kernel32.inc'
  include 'C:\Documents and Settings\FeliaMyazz\Desktop\fasmw167\INCLUDE\apia\user32.inc'


;               .:-================GREETZ================-:.
;               .:-Dane,RedGhost,Tomasz Grysztar,Rockstar-:.
;               .:-======================================-:.