Welcome to the UnKnoWnCheaTs - Multiplayer Game Hacks and Cheats.
You have to register before you can post and see and access any of the advanced forum features, please click the register link to proceed to the registration form. To start viewing threads or posts, select a forum that you want to visit from the selection below.
Assembly hacking programming reversing
You are Unregistered, please register to gain Full access.
So I'm starting out learning asm and my code won't compile. At first I thought it was a compiler problem, but now I think it may be a problem with the code. Even though the code is supposed to be for an 8086 processor I think something is wrong.
which seemed good at 1st, but now I'm looking around at more up to date code an this is a hello world app written this year by someone else:
Code:
.386
.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
.data
HelloWorld db "Hello World!", 0
.code
start:
invoke MessageBox, NULL, addr HelloWorld, addr HelloWorld, MB_OK
invoke ExitProcess, 0
end start
Now Im thinking the book was written in 1989, which to my knowledge was after Windows NT... I think. So is this code outdated and will no longer compile on a Windows machine or is there just something I did wrong. or both for that matter! o_O
Also the attached document is one of the many chapters Im using for learning asm.... EDIT: can't attach.
A book with code examples that dates 1989 is going to give you a lot more problems than you want. You should try to find a better source.
Yeh I know your right. But the only good tuts I can find is this one http://win32assembly.online.fr/tutorials.html on Windows asm. And I'm looking for one that covers more basic instruction centered asm and less windows. ;(
There are other links to useful resources in the topmost thread.
I found using inline assembler in visual studio to be very useful when experimenting with assembly code; it allows you to mix familiar C/C++ with the new assembly in a completely controlled environment.
There are other links to useful resources in the topmost thread.
I found using inline assembler in visual studio to be very useful when experimenting with assembly code; it allows you to mix familiar C/C++ with the new assembly in a completely controlled environment.
Well thx for the link and i'll try to use that inline assembler thing too. I'll figure it out the rest out.
@G36: It's hard for me to find the right book. I'm not sure which one I should buy and since most of them are 50 - 100 dollars I'd hat to do it by trial and error. I know I thought Art of ASM would be a good book, but the truth is HLA looks nothing like a disassembly viewed in a debugger.
Because assembly is a low level language it is actually pretty simple, or at least to learn how to write and read. There is a set amount of commands and certain rules you need to stick to.
Translating your code from C++ to assembly is a good exercise. Create a function in C ( make it simple ) and then mimic it's behaviour in inline assembly. ( Don't forget to turn of compiler optimization when doing this kind of stuff, it tends to mess things up )
To find most if not all assembly commands you could use the Intel x86 Instruction Set Reference. It is downloadable for free at Intel's site.
On a side note; a book to learn assembly just for cheats is kinda overkill. You don't need to be able to develop an entire game in it .
I recommend you read Assembling Language and Computer Architecture using C++ and Java. I found it real cheap in a specialty book website [forgot the name sorry].
Last edited by DeltaCheater; 08-31-2010 at 10:51 PM.
Firstly, choose your assembler. Alot use fasm/masm so they are recommended. Don't try being one of these tools who think they're cool by picking up tasm/nasm to be different and then finding problems with their code that no-one around knows how to fix as they don't use it.
Next, use Iczelion's tutorials to convert from your old language (on the fasm forum you'll find the code translated into fasm syntax). If you don't already know a language, step the fuck back and goto C/C++ or something. I'm not saying ASM is impossible to learn as a first language, but it helps knowing program flow before you start.
After you have a grip for general syntax (functions/api, conditional jumps, variables..etc.) then start downloading commented source code. As said, for cheats you don't need to be reading a book on how to make apps that count how many apples jim has.
Once you've done this, you should be fine. Remember, a basic trainer is what, like 5 API calls? If you need any help then PM me, but I don't think I'll be around much.. A pre-requisite to doing the above though is knowing enough c++ to code a trainer from scratch, downloading fasm and having enough braincells to entertain me.
__________________
I was once called eVoByTe.. Then I grew up.
Why read a book that covers every aspect of asm, or even windows coding for that matter, when in reality we need a very tiny portion of it? Efficiency my friend.
Sure, if you later want to get more advanced then pick up a book or read more advanced tutorials, but that's not really where to start. If you already understand the flow of programs, specifically trainers, and already have knowledge of another language, then really all you need to look up is ASM syntax..
__________________
I was once called eVoByTe.. Then I grew up.
Some people learn differently. I personally cannot open my ASM Interpreter and start pumping out code just by looking at it with no previous knowledge for ASM.
Theres only so far the 'hands on' approach can go.
__________________
"Those who seek revenge must dig two graves, one for his enemy and another for himself."
On the internet I will - in no shape or form - take personal offence to peoples comments, idea's or views, I assume the people who I reply to won't either.
Why read a book that covers every aspect of asm, or even windows coding for that matter, when in reality we need a very tiny portion of it? Efficiency my friend.
Sure, if you later want to get more advanced then pick up a book or read more advanced tutorials, but that's not really where to start. If you already understand the flow of programs, specifically trainers, and already have knowledge of another language, then really all you need to look up is ASM syntax..
Quote:
we need a very tiny portion of it?
This is the book I have read for understanding asm
Im 150 pages in and even though I have learned alot, its not enough. But every page was full of useful information.
Sure if you wana be a dumbass and just only know how to use jmp and push while a crippled upside down turtle to everything else then your advice would be gold I'm sure.
But telling people to deliberately be a lazy fuck has never been a life lesson in my book.
Ah, the old pcasm book.. How did you find the section on API in there, you know, the lovely windows staple that we pretty much NEED (unless you're taking the complicated route) to program trainers and memory hacks? Oh, nvm, doesn't have one.. fantastic. So, as with most books out there, you'll finish 150 pages and know how to program a fairly average calculator that probably uses printf or something to bang your answer on the command prompt. How useful!
As said, my advice was for people coming from a different language (such as C++). Therefore, you should know most of that stuff besides the syntax. If you don't know what an array is, a function, structures, and what variables are then you don't know another language. If you do, then reading 150 pages of text showing what they are and why they are needed when all you actually need to do is pick up the syntax change is pretty stupid, no?
ASM is also a lot of common sense when it comes to the program flow, as it emphasises the need for having a thorough understanding for why you are doing most things. This is the part that takes the longest to learn, and IMO cannot be learnt from books; this comes from practice by either setting challenges to yourself, and/or my personal favourite of re-writing your old programs in the new language.
Telling people to be an inefficient fuck has never been a lesson in mine
Code:
include 'win32ax.inc'
IDD_MAINDLG = 101
IDC_EXIT = 40001
.data
hInstance dd ?
hwnd dd ?
pId dd ?
pHandle dd ?
.code
start:
invoke GetModuleHandle, 0
mov [hInstance], eax
invoke DialogBoxParam, [hInstance], IDD_MAINDLG, 0, dlgProc, 0
invoke ExitProcess, 0
.end start
proc dlgProc, hDlg, uMsg, wParam, lParam
push ebx esi edi
cmp [uMsg], WM_COMMAND
je .wmcommand
cmp [uMsg], WM_CLOSE
je .wmclose
cmp [uMsg], WM_INITDIALOG
je .wminitdlg
cmp [uMsg], WM_DESTROY
je .wmclose
cmp [uMsg], WM_COMMAND
je .wmcommand
cmp [uMsg], WM_TIMER
je .wmtimer
xor eax, eax
jmp .finish
.wminitdlg:
invoke SetTimer, [hDlg], 1, 100, NULL
mov eax, 1
jmp .finish
.wmclose:
invoke EndDialog, [hDlg], 0
mov eax, 1
jmp .finish
.wmcommand:
mov eax, [wParam]
and eax, 0x0FFFF
cmp eax, IDC_EXIT
je .wmclose
mov eax, 0
jmp .finish
.wmtimer:
invoke GetAsyncKeyState, 0x61
cmp eax, 0
je .finish
invoke FindWindow, 0, "Minesweeper"
mov [hwnd], eax
cmp eax, 0
je .finish
invoke GetWindowThreadProcessId, [hwnd], pId
invoke OpenProcess, PROCESS_ALL_ACCESS, 0, [pId]
mov [pHandle], eax
invoke WriteProcessMemory, [pHandle], 0xF76B4 , 0x909090, 3, 0
mov eax, 0
jmp .finish
.finish:
pop edi esi ebx
ret
endp
section '.rsrc' data readable resource from 'resource.res'
Just need to make a res with the dialog as 101 and an exit button as 40001 to work... simples.
__________________
I was once called eVoByTe.. Then I grew up.