Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


ASM Help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
NeverCracker
Cheater
Reputation: 0

Joined: 11 Jan 2007
Posts: 46
Location: My mind

PostPosted: Thu Jul 05, 2007 3:28 am    Post subject: ASM Help Reply with quote

Hello,

Uzeil was recently helping me learn ASM and so far it's going great. I am using mASM. He was helping me create a trainer for GunBound, much like his, just a lot more basic and not as good Embarassed

This is what I have so far:

Code:
    .486
    .model flat, stdcall
    option casemap :none
 
    include \masm32\include\windows.inc
    include \masm32\macros\macros.asm
    include \masm32\include\masm32.inc
    include \masm32\include\gdi32.inc
    include \masm32\include\user32.inc
    include \masm32\include\kernel32.inc
    includelib \masm32\lib\masm32.lib
    includelib \masm32\lib\gdi32.lib
    includelib \masm32\lib\user32.lib
    includelib \masm32\lib\kernel32.lib

    .data

    mybuffer dd 0,0,0,0

    .code

start:

    call main

    exit

main proc

    print chr$("Welcome to NCLT - NeverCracker's Legit Trainer",10,10)
    print chr$("1. Double Kill Exploit",10)
    print chr$("2. Name Change Exploit",10)
    print chr$("3. Power User Exploit",10)
    print chr$("4. Room Number Change Exploit",10)
    print chr$("5. Bonus Exploit",10,10)
    print chr$("c0ded by nevercracker - mASM32 - 4.3.2007",10)

    call cmdi

main endp

cmdi proc

    LOCAL com:DWORD

    print chr$(" ",10)
    mov com, sval(input("NCLT: "))

    cmp com, 1
    je dke
    cmp com, 2
    je nce
    cmp com, 3
    je pue
    cmp com, 4
    je rnce
    cmp com, 5
    je be
    jmp ove

    dke:
      invoke OpenProcess PROCESS_ALL_ACCESS, TRUE, 5
      invoke WriteProcessMemory, 0xFFFFFFFF, 008B0CFD, offset mybuffer, 16, NULL

      print chr$("Double Kill exploit now activated.")
      print chr$(" ",10)
      jmp ove

    nce:
      print chr$("two")
      print chr$(" ",10)
      jmp ove

    pue:
      print chr$("three")
      print chr$(" ",10)
      jmp ove

    rnce:
      print chr$("four")
      print chr$(" ",10)
      jmp ove

    be:
      print chr$("five")
      print chr$(" ",10)
      jmp ove

    ove:
      call cmdi

cmdi endp

end start


What I need to know is how to properly use the OpenProcess and WriteProcessMemory functions correctly, thanks.

_________________
Give a man a hack, and he will hack for a day. Teach a man to hack, and he will hack for a lifetime.



GBNA Trainer - |||||||||| - 20%
Back to top
View user's profile Send private message
benlue
Moderator
Reputation: 0

Joined: 09 Oct 2006
Posts: 2142

PostPosted: Thu Jul 05, 2007 4:15 am    Post subject: Reply with quote

This really should go to general programming.
Back to top
View user's profile Send private message
Ksbunker
Advanced Cheater
Reputation: 0

Joined: 18 Oct 2006
Posts: 88

PostPosted: Thu Jul 05, 2007 5:12 am    Post subject: Reply with quote

In your code, you're calling OpenProcess() then WriteProcessMemory(), Open process requires the Thread Process Id, which is retrieved using GetWindowThreadProcessId(), this call requires a handle to the target window, which is retrieved using FindWindow().

FindWindow() can take two parameters, class and caption (in that order).

The following procedure I use to write to memory using the caption, notice how for findwindow() is used the caption as specified by Caption.

Using the class to locate the game handle can be helpful if the target game randomly changes it caption. To determine the CLASS name, several otehr tricks are required, post it required.

Code:
Write PROC Caption:DWORD, Address:DWORD, Value:DWORD
LOCAL hProcess
LOCAL hWind
LOCAL ProcessID

.data

szReason db "Window not located!", 0
szError db "Error", 0

.code

Invoke FindWindow, NULL, Caption
  .if eax==0
    invoke MessageBox, hWin, addr szReason, addr szError, MB_ICONEXCLAMATION
     ret
 .endif
   mov hWind,eax
    Invoke GetWindowThreadProcessId, hWind, addr ProcessID
     Invoke OpenProcess,PROCESS_VM_READ + PROCESS_VM_WRITE + PROCESS_VM_OPERATION, 0, ProcessID
      mov hProcess,eax
       invoke WriteProcessMemory, hProcess, Address, Value, SIZEOF Value, NULL
        invoke CloseHandle,hProcess
       ret
Write ENDP
Back to top
View user's profile Send private message
NeverCracker
Cheater
Reputation: 0

Joined: 11 Jan 2007
Posts: 46
Location: My mind

PostPosted: Thu Jul 05, 2007 5:50 pm    Post subject: Reply with quote

Hmm thanks guys for all the information. This might be too hard of a first project Shocked

I'll create something else in ASM to get me practice. What do you guys suggest? Like a trainer for another game with no protection? I do want infinite gold on Fable TLC... hm.

_________________
Give a man a hack, and he will hack for a day. Teach a man to hack, and he will hack for a lifetime.



GBNA Trainer - |||||||||| - 20%
Back to top
View user's profile Send private message
Ksbunker
Advanced Cheater
Reputation: 0

Joined: 18 Oct 2006
Posts: 88

PostPosted: Thu Jul 05, 2007 10:34 pm    Post subject: re: Reply with quote

Try making a trainer in masm for minesweeper.

The game itself is not too difficult to train, coding the trainer may be a task, but a learning experience Wink

There's numerous tutorial surfing the web thta detail how to make trainers in masm (i.e. if you struggle)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites