Assembly Language for Beginners
CONTENTS The guys fromAntiy Labshas also helped with translation.Here is prefacewritten by them. xix ...
Chapter 1 1 Code Patterns 1.1 The method When the author of this book first started learning C and, later, C++, he used to write ...
1.2 Some basics. 1.2 Some basics 1.2.1 A short introduction to the CPU TheCPUis the device that executes the machine code a prog ...
1.2. SOME BASICS 1.2.2 Numeral Systems Humans have become accustomed to a decimal numeral system, probably because almost everyo ...
1.2. SOME BASICS radix numbers, in which the number would be written with a ”d” suffix: 1234d. Binary numbers are sometimes prep ...
1.3 An Empty Function. Also, the octal system is somewhat popular in Java. When the IDA shows Java strings with non-printable ch ...
1.3. AN EMPTY FUNCTION 1.3.1 x86 Here’s what both the GCC and MSVC compilers produce on the x86 platform: Listing 1.2: Optimizin ...
1.4 Returning Values 1.3.4 Empty Functions in Practice. Despite the fact empty functions seem useless, they are quite frequent i ...
1.5 Hello, world!. There are just two instructions: the first places the value 123 into theEAXregister, which is used by convent ...
1.5. HELLO, WORLD! Listing 1.13: C/C++ Code include <stdio.h> int main() { printf("hello, world\n"); return 0; } 1.5.1 x86 ...
1.5. HELLO, WORLD! After the function prologue we see the call to theprintf()function: CALL _printf. Before the call, a string a ...
1.5. HELLO, WORLD! The result is almost the same. The address of thehello, worldstring (stored in the data segment) is loaded in ...
1.5. HELLO, WORLD! The listing contains many macros (the parts that begin with a dot). These are not interesting for us at the m ...
1.5. HELLO, WORLD! Figure 1.1:Hiew And we can try to translate our message into Spanish: Figure 1.2:Hiew The Spanish text is one ...
1.5. HELLO, WORLD! 0x00400604 0c01 0000 1400 0000 0000 0000 017a 5200 .............zR. 0x00400614 0178 1001 1b0c 0708 9001 0710 ...
1.5. HELLO, WORLD! Byte number: 7th 6th 5th 4th 3rd 2nd 1st 0th RAXx64 EAX AX AH AL Themain()function returns anint-typed value, ...
1.5. HELLO, WORLD! Address patching (Win64) If our example was compiled in MSVC 2013 using\MDswitch (meaning a smaller executabl ...
1.5. HELLO, WORLD! Figure 1.4:Hiew Hiew shows “ello, world”. And when we run the patched executable, this very string is printed ...
1.5. HELLO, WORLD! int main() { printf(0x400238); return 0; } It’s hard to believe, but this code prints the aforementioned stri ...
1.5. HELLO, WORLD! Indeed: when we print the “hello world” string these two words are positioned in memory adjacently and puts() ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf