First things first... I am not the original author of this tutorial but I found it very helpful while I was learning and there are also some more in-depth tutorials on olly and asm found here
Basic Assembly/OllyDBG Tutorial, in relation to Game Cheats
A tutorial I wrote originally for another board, I figuredI'd post it here. If there's a beginner board relating to R.E. that this would be better suited in, that'd be great if a mod could move it (After all, this guide is anything but "Highly Advanced").
This guide will explain exactly what is necessary to begin cheat creation for generally any online computer game, including both fields to study, and tools to use.
Before this tutorialbegins, it should be noted:
1) I'll make great use of footnotes to fill in anything the reader may not understand.
2) I'm going to assume the general audience is very technologically inept, especially pertaining to the forementioned fields.
3) This tutorial concerns mostly Windows games - there's not much of a market for cheating on other platforms.
Fields of Study
When it comes tocheating in games, it will be heard that you must know either assembly, C++, or both, while in fact, neither are necessarily true. However, if you're going to work alone every step of the way, in almost every scenario, knowledge of Intel-syntax assembly will be necessary.
Assembly is considered the bottom of the barrel of programming languages - it's considered as low-level as youcan go with a programming language. But, as all executables must utilize assembly one way or other, this is also why it is considered very powerful when attempting to learn what is done in a specific executable. For example, if one program encrypts certain types of files, and you need to learn how the encryption algorithm is done, then you would disassemble the program. From there,assuming you know assembly, you may be capable of understanding what the program does (More importantly, what that algorithm is, which would allow you to write a decryption algorithm).
Assembly uses hexadecimal numbers, so it should be understood the number system is organized as follows:
0 = 0, 1 = 1, 2 = 2, 3 = 3, 4 = 4, 5 = 5, 6 = 6, 7 = 7, 8 = 8, 9 = 9
A = 10
B = 11
C = 12
D = 13
E = 14F = 15
(The above shows numbers from base 16, the hexadecimal system, to base 10, the standard decimal system)
Firstly, assembly is entirely about data manipulation (In general, that's all programming is - manipulating data, effecting hardware to do what you want). To be put simply, usually three things are being modified:
1) The stack
3) The memory of a program
Now,to explain what the above:
1) The stack is a large stack of numbers, manipulated for handing off parameters to functions, storing the registers, and storing other miscellaneous data.
2) Registers are used for completing varying operations (Comparing data, arithmetic functions, logical operations, etc). Usually, they'll store certain types of numbers/addresses, from as low as4-bits, all the way up to 32-bits (It's possible to go higher than 32-bits, but, most users won't encounter situations where that will be necessary to know). Flags are used for marking registers for different purposes (e.g.: The overflow flag, or OF, will set itself to the number 1, from 0, if an operation using that register is larger than the space that the register can handle; so if you'reusing a 4-bit register to handle 32-bit data, the OF flag would be set to 1).
3) Varying data in the program is constantly being modified, as the stack and registers can handle only so much data at once, in many cases, it's more efficient to leave some data modification in the program itself (Though it should be noted, this is only done in memory; meaning, if you were to modify the program to...