Advertisement
BaSs_HaXoR

x86 Assembly for Reverse Engineers (Crash Course)

Mar 31st, 2017
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.80 KB | None | 0 0
  1. https://sensepost.com/blogstatic/2014/01/SensePost_crash_course_in_x86_assembly-.pdf
  2.  
  3. 1.1
  4. Introduction
  5. The hardest part of learning x86 assembly in 2013 is find
  6. ing
  7. good
  8. tutorials
  9. . As the popularity
  10. of low level languages
  11. decreases
  12. the
  13. incitement
  14. to create fresh up to date
  15. tutori
  16. als
  17. is limited.
  18. At the same time x86 assembly is critical
  19. in many security related fields
  20. such as malware
  21. ana
  22. lysis, vulnerability research and
  23. exploit
  24. development
  25. .
  26. This
  27. document
  28. was created
  29. to address the lack of
  30. tutorials
  31. in a fast, pedagogical and cheap
  32. manner. While it is not a complete introduction, it addresses enough to prepare careful
  33. readers
  34. with the
  35. necessary knowledge
  36. base to be able to decipher non
  37. -
  38. obfuscated assembly.
  39. And it does so within less than thirty pages.
  40. For pedagogical reasons
  41. focus i
  42. s kept to what the reader
  43. assumedly
  44. knows about C or C
  45. -
  46. based languages
  47. (like Java or C#)
  48. . Hopefully this minimizes the confusion that usually
  49. appears when people are trying to learn a stack based language for the first time.
  50.  
  51. 1
  52. T
  53. ABLE OF
  54. C
  55. ONTENTS
  56. 1
  57. Table of Contents
  58. ................................
  59. ................................
  60. ................................
  61. ..............
  62. 2
  63. 1.1
  64. Introduction
  65. ................................
  66. ................................
  67. ................................
  68. ................
  69. 3
  70. 1.2
  71. Bits, bytes, words, double words
  72. ................................
  73. ................................
  74. ...............
  75. 4
  76. 1.3
  77. Registers
  78. ................................
  79. ................................
  80. ................................
  81. ....................
  82. 5
  83. 1.3.1
  84. General purpose registers
  85. ................................
  86. ................................
  87. .................
  88. 5
  89. 1.3.2
  90. Segment registers
  91. ................................
  92. ................................
  93. ..............................
  94. 6
  95. 1.3.3
  96. Status flag registers
  97. ................................
  98. ................................
  99. ...........................
  100. 6
  101. 1.3.4
  102. EIP
  103. -
  104. Extended Instruction Pointer
  105. ................................
  106. ................................
  107. ....
  108. 7
  109. 1.4
  110. Segments & offsets
  111. ................................
  112. ................................
  113. ................................
  114. ....
  115. 8
  116. 1.4.1
  117. The sta
  118. ck
  119. ................................
  120. ................................
  121. ................................
  122. ...........
  123. 8
  124. 1.4.2
  125. Stack frames
  126. ................................
  127. ................................
  128. ................................
  129. ......
  130. 8
  131. 1.4.3
  132. The Heap
  133. ................................
  134. ................................
  135. ................................
  136. ...........
  137. 8
  138. 1.5
  139. Instructions
  140. ................................
  141. ................................
  142. ................................
  143. ..............
  144. 10
  145. 1.5.1
  146. Arithmetic operations
  147. -
  148. ADD , SUB, MUL, IMUL, DIV, IDIV...
  149. .........................
  150. 11
  151. 1.5.2
  152. Bitwise operations
  153. AND, OR, XOR, NOT
  154. ................................
  155. .....................
  156. 12
  157. 1.5.3
  158. Branching
  159. JMP, JE, JLE, JNZ, JZ, JBE, JGE...
  160. ................................
  161. ...........
  162. 13
  163. 1.5.4
  164. Data moving
  165. MOV, MOVS, MOVSB, MOVSW, MOVZX, MOVSX, LEA...
  166. ..
  167. 14
  168. 1.5.5
  169. Loops
  170. LOOP, REP...
  171. ................................
  172. ................................
  173. ....................
  174. 15
  175. 1.5.6
  176. Stack management
  177. POP, PUSH
  178. ................................
  179. ................................
  180. ..
  181. 16
  182. 1.5.7
  183. Functions
  184. CA
  185. LL, RET
  186. ................................
  187. ................................
  188. ...................
  189. 16
  190. 1.5.8
  191. Interrupts, Debugger traps
  192. INT, trap flag
  193. ................................
  194. .....................
  195. 18
  196. 1.6
  197. Calling conventions
  198. ................................
  199. ................................
  200. ................................
  201. ..
  202. 19
  203. 1.6.1
  204. stdcall
  205. ................................
  206. ................................
  207. ................................
  208. ...............
  209. 19
  210. 1.6.2
  211. cdecl
  212. ................................
  213. ................................
  214. ................................
  215. .................
  216. 19
  217. 1.6.3
  218. pascal
  219. ................................
  220. ................................
  221. ................................
  222. ...............
  223. 19
  224. 1.6.4
  225. fastcall
  226. ................................
  227. ................................
  228. ................................
  229. ..............
  230. 19
  231. 1.6.5
  232. Others calling conventions
  233. ................................
  234. ................................
  235. ...............
  236. 19
  237. 1.7
  238. C to x86 assembly
  239. ................................
  240. ................................
  241. ................................
  242. ...
  243. 20
  244. 1.7.1
  245. Single
  246. -
  247. Branch Conditionals
  248. ................................
  249. ................................
  250. .............
  251. 20
  252. 1.7.2
  253. Two
  254. -
  255. way Conditionals
  256. ................................
  257. ................................
  258. ......................
  259. 21
  260. 1.7.3
  261. L
  262. ogical operations
  263. -
  264. AND
  265. ................................
  266. ................................
  267. .................
  268. 22
  269. 1.7.4
  270. Logical operations
  271. -
  272. OR
  273. ................................
  274. ................................
  275. ...................
  276. 23
  277. 1.7.5
  278. Loops
  279. ................................
  280. ................................
  281. ................................
  282. ...............
  283. 24
  284. 1.7.6
  285. Function ca
  286. lls
  287. ................................
  288. ................................
  289. ................................
  290. ...
  291. 25
  292. 1.8
  293. Reverse engineering tools
  294. ................................
  295. ................................
  296. .......................
  297. 26
  298. 1.8.1
  299. OllyDBG tutorials
  300. ................................
  301. ................................
  302. .............................
  303. 26
  304. 1.8.2
  305. IDA Pro tutorials
  306. ................................
  307. ................................
  308. ...............................
  309. 26
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement