Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2012
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; void __stdcall kmain(unsigned int magic, multiboot_info *bootinfo)
  2. .text:00101540                 public _kmain@8
  3. .text:00101540 _kmain@8        proc near
  4. .text:00101540
  5. .text:00101540 magic           = dword ptr  8
  6. .text:00101540 bootinfo        = dword ptr  0Ch
  7. .text:00101540
  8. .text:00101540                 push    ebp
  9. .text:00101541                 mov     ebp, esp
  10. .text:00101543                 call    _k_clearScreen@0 ; k_clearScreen()
  11. .text:00101548                 call    _k_hideCursor@0 ; k_hideCursor()
  12. .text:0010154D                 push    7               ; color
  13. .text:0010154F                 push    offset aHelloWorld ; "Hello World!\r\n"
  14. .text:00101554                 call    ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
  15. .text:00101559                 push    7               ; color
  16. .text:0010155B                 push    offset a1234567890 ; "1234567890\r\n"
  17. .text:00101560                 call    ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
  18. .text:00101565                 push    7               ; color
  19. .text:00101567                 push    offset aUmlaute ; "\tUmlaute:\n"
  20. .text:0010156C                 call    ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
  21. .text:00101571                 push    7               ; color
  22. .text:00101573                 push    offset asc_102064 ; "รต"
  23. .text:00101578                 call    ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
  24. .text:0010157D                 push    7               ; color
  25. .text:0010157F                 mov     eax, [ebp+magic]
  26. .text:00101582                 push    eax             ; i
  27. .text:00101583                 call    ?k_print@@YGXHW4k_ConsoleColor@@@Z ; k_print(int,k_ConsoleColor)
  28. .text:00101588                 push    7               ; color
  29. .text:0010158A                 push    offset ptr      ; "\r\n"
  30. .text:0010158F                 call    ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
  31. .text:00101594                 push    7               ; color
  32. .text:00101596                 mov     ecx, [ebp+magic]
  33. .text:00101599                 push    ecx             ; value
  34. .text:0010159A                 call    _k_printHex@8   ; k_printHex(x,x)
  35. .text:0010159F                 push    7               ; color
  36. .text:001015A1                 push    offset ptr      ; "\r\n"
  37. .text:001015A6                 call    ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
  38. .text:001015AB                 push    7               ; color
  39. .text:001015AD                 push    offset ptr      ; "\r\n"
  40. .text:001015B2                 call    ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
  41. .text:001015B7                 pop     ebp
  42. .text:001015B8                 retn    8
  43. .text:001015B8 _kmain@8        endp
  44.  
  45.  
  46.  
  47.  
  48.  
  49. .text:00101820 ; void __stdcall k_print(int i, k_ConsoleColor color)
  50. .text:00101820 ?k_print@@YGXHW4k_ConsoleColor@@@Z proc near
  51. .text:00101820                                         ; CODE XREF: k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+Ep
  52. .text:00101820                                         ; k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+25p ...
  53. .text:00101820
  54. .text:00101820 stellen         = dword ptr -0Ch
  55. .text:00101820 n               = dword ptr -8
  56. .text:00101820 erg             = byte ptr -1
  57. .text:00101820 i               = dword ptr  8
  58. .text:00101820 color           = dword ptr  0Ch
  59. .text:00101820
  60. .text:00101820                 push    ebp
  61. .text:00101821                 mov     ebp, esp
  62. .text:00101823                 sub     esp, 0Ch
  63. .text:00101826                 cmp     [ebp+i], 0
  64. .text:0010182A                 jnz     short loc_101837
  65. .text:0010182C                 push    7               ; color
  66. .text:0010182E                 push    30h             ; c
  67. .text:00101830                 call    ?k_print@@YGXDW4k_ConsoleColor@@@Z ; k_print(char,k_ConsoleColor)
  68. .text:00101835                 jmp     short loc_101897
  69. .text:00101837 ; ---------------------------------------------------------------------------
  70. .text:00101837
  71. .text:00101837 loc_101837:                             ; CODE XREF: k_print(int,k_ConsoleColor)+Aj
  72. .text:00101837                 mov     eax, [ebp+i]
  73. .text:0010183A                 push    eax             ; v
  74. .text:0010183B                 call    _k_log10@4      ; k_log10(x)
  75. .text:00101840                 add     eax, 1
  76. .text:00101843                 mov     [ebp+stellen], eax
  77. .text:00101846                 mov     [ebp+n], 0
  78. .text:0010184D                 jmp     short loc_101858
  79. .text:0010184F ; ---------------------------------------------------------------------------
  80. .text:0010184F
  81. .text:0010184F loc_10184F:                             ; CODE XREF: k_print(int,k_ConsoleColor)+75j
  82. .text:0010184F                 mov     ecx, [ebp+n]
  83. .text:00101852                 add     ecx, 1
  84. .text:00101855                 mov     [ebp+n], ecx
  85. .text:00101858
  86. .text:00101858 loc_101858:                             ; CODE XREF: k_print(int,k_ConsoleColor)+2Dj
  87. .text:00101858                 mov     edx, [ebp+n]
  88. .text:0010185B                 cmp     edx, [ebp+stellen]
  89. .text:0010185E                 jge     short loc_101897
  90. .text:00101860                 mov     eax, [ebp+stellen]
  91. .text:00101863                 sub     eax, [ebp+n]
  92. .text:00101866                 sub     eax, 1
  93. .text:00101869                 push    eax             ; stelle
  94. .text:0010186A                 call    _k_pow10@4      ; k_pow10(x)
  95. .text:0010186F                 mov     ecx, eax
  96. .text:00101871                 mov     eax, [ebp+i]
  97. .text:00101874                 xor     edx, edx
  98. .text:00101876                 div     ecx
  99. .text:00101878                 xor     edx, edx
  100. .text:0010187A                 mov     ecx, 0Ah
  101. .text:0010187F                 div     ecx
  102. .text:00101881                 mov     [ebp+erg], dl
  103. .text:00101884                 mov     edx, [ebp+color]
  104. .text:00101887                 push    edx             ; color
  105. .text:00101888                 movzx   eax, [ebp+erg]
  106. .text:0010188C                 add     eax, 30h
  107. .text:0010188F                 push    eax             ; c
  108. .text:00101890                 call    ?k_print@@YGXDW4k_ConsoleColor@@@Z ; k_print(char,k_ConsoleColor)
  109. .text:00101895                 jmp     short loc_10184F
  110. .text:00101897 ; ---------------------------------------------------------------------------
  111. .text:00101897
  112. .text:00101897 loc_101897:                             ; CODE XREF: k_print(int,k_ConsoleColor)+15j
  113. .text:00101897                                         ; k_print(int,k_ConsoleColor)+3Ej
  114. .text:00101897                 mov     esp, ebp
  115. .text:00101899                 pop     ebp
  116. .text:0010189A                 retn    8
  117. .text:0010189A ?k_print@@YGXHW4k_ConsoleColor@@@Z endp
  118.  
  119.  
  120.  
  121.  
  122.  
  123. .text:001018A0 ; void __stdcall k_print(const char *ptr, k_ConsoleColor color)
  124. .text:001018A0 ?k_print@@YGXPBDW4k_ConsoleColor@@@Z proc near
  125. .text:001018A0                                         ; CODE XREF: k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+1Ap
  126. .text:001018A0                                         ; k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+31p ...
  127. .text:001018A0
  128. .text:001018A0 var_18          = dword ptr -18h
  129. .text:001018A0 videomemory     = dword ptr -14h
  130. .text:001018A0 bufferSize      = word ptr -10h
  131. .text:001018A0 numRows         = word ptr -0Ch
  132. .text:001018A0 numColumns      = word ptr -8
  133. .text:001018A0 step            = word ptr -4
  134. .text:001018A0 ptr             = dword ptr  8
  135. .text:001018A0 color           = dword ptr  0Ch
  136.  
  137. .text:001018A0                 push    ebp
  138. .text:001018A1                 mov     ebp, esp
  139. .text:001018A3                 sub     esp, 18h
  140. .text:001018A6                 mov     [ebp+videomemory], 0B8000h
  141. .text:001018AD                 mov     eax, 4
  142. .text:001018B2                 mov     [ebp+step], ax
  143. .text:001018B6                 mov     ecx, 50h
  144. .text:001018BB                 mov     [ebp+numColumns], cx
  145. .text:001018BF                 mov     edx, 19h
  146. .text:001018C4                 mov     [ebp+numRows], dx
  147. .text:001018C8                 mov     eax, 7D0h
  148. .text:001018CD                 mov     [ebp+bufferSize], ax
  149. .text:001018D1                 jmp     short loc_1018EE
  150. .text:001018D3 ; ---------------------------------------------------------------------------
  151. .text:001018D3
  152. .text:001018D3 loc_1018D3:                             ; CODE XREF: k_print(char const *,k_ConsoleColor)+EFj
  153. .text:001018D3                                         ; k_print(char const *,k_ConsoleColor)+105j ...
  154. .text:001018D3                 mov     ecx, [ebp+ptr]
  155. .text:001018D6                 add     ecx, 1
  156. .text:001018D9                 mov     [ebp+ptr], ecx
  157. .text:001018DC                 mov     dx, ?cursorPosition@@3GA ; ushort cursorPosition
  158. .text:001018E3                 add     dx, 1
  159. .text:001018E7                 mov     ?cursorPosition@@3GA, dx ; ushort cursorPosition
  160. .text:001018EE
  161. .text:001018EE loc_1018EE:                             ; CODE XREF: k_print(char const *,k_ConsoleColor)+31j
  162. .text:001018EE                 mov     eax, [ebp+ptr]
  163. .text:001018F1                 movsx   ecx, byte ptr [eax]
  164. .text:001018F4                 test    ecx, ecx
  165. .text:001018F6                 jz      loc_101AC1
  166. .text:001018FC                 movzx   edx, ?cursorPosition@@3GA ; ushort cursorPosition
  167. .text:00101903                 cmp     edx, 7D0h
  168. .text:00101909                 jl      short loc_10191D
  169. .text:0010190B                 movzx   eax, ?cursorPosition@@3GA ; ushort cursorPosition
  170. .text:00101912                 sub     eax, 7D0h
  171. .text:00101917                 mov     ?cursorPosition@@3GA, ax ; ushort cursorPosition
  172. .text:0010191D
  173. .text:0010191D loc_10191D:                             ; CODE XREF: k_print(char const *,k_ConsoleColor)+69j
  174. .text:0010191D                 mov     ecx, [ebp+ptr]
  175. .text:00101920                 movsx   edx, byte ptr [ecx]
  176. .text:00101923                 mov     [ebp+var_18], edx
  177. .text:00101926                 mov     eax, [ebp+var_18]
  178. .text:00101929                 add     eax, 3Ch
  179. .text:0010192C                 mov     [ebp+var_18], eax
  180. .text:0010192F                 cmp     [ebp+var_18], 49h ; switch 74 cases
  181. .text:00101933                 ja      short loc_101946 ; jumptable 0010193F default case
  182. .text:00101935                 mov     ecx, [ebp+var_18]
  183. .text:00101938                 movzx   edx, ds:byte_101AF4[ecx]
  184. .text:0010193F                 jmp     ds:off_101AC8[edx*4] ; switch jump
  185. .text:00101946
  186. .text:00101946 loc_101946:                             ; CODE XREF: k_print(char const *,k_ConsoleColor)+93j
  187. .text:00101946                                         ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
  188. .text:00101946                 movzx   eax, ?cursorPosition@@3GA ; jumptable 0010193F default case
  189. .text:0010194D                 mov     ecx, [ebp+videomemory]
  190. .text:00101950                 mov     edx, [ebp+ptr]
  191. .text:00101953                 mov     dl, [edx]
  192. .text:00101955                 mov     [ecx+eax*2], dl
  193. .text:00101958                 movzx   eax, ?cursorPosition@@3GA ; ushort cursorPosition
  194. .text:0010195F                 mov     ecx, [ebp+videomemory]
  195. .text:00101962                 mov     dl, byte ptr [ebp+color]
  196. .text:00101965                 mov     [ecx+eax*2+1], dl
  197. .text:00101969                 jmp     loc_101ABC
  198. .text:0010196E ; ---------------------------------------------------------------------------
  199. .text:0010196E
  200. .text:0010196E $LN10:                                  ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
  201. .text:0010196E                                         ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
  202. .text:0010196E                 movzx   eax, ?cursorPosition@@3GA ; jumptable 0010193F case 73
  203. .text:00101975                 cdq
  204. .text:00101976                 mov     ecx, 50h
  205. .text:0010197B                 idiv    ecx
  206. .text:0010197D                 add     edx, 1
  207. .text:00101980                 movzx   eax, ?cursorPosition@@3GA ; ushort cursorPosition
  208. .text:00101987                 sub     eax, edx
  209. .text:00101989                 mov     ?cursorPosition@@3GA, ax ; ushort cursorPosition
  210. .text:0010198F                 jmp     loc_1018D3
  211. .text:00101994 ; ---------------------------------------------------------------------------
  212. .text:00101994
  213. .text:00101994 $LN9:                                   ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
  214. .text:00101994                                         ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
  215. .text:00101994                 movzx   ecx, ?cursorPosition@@3GA ; jumptable 0010193F case 70
  216. .text:0010199B                 add     ecx, 4Fh
  217. .text:0010199E                 mov     ?cursorPosition@@3GA, cx ; ushort cursorPosition
  218. .text:001019A5                 jmp     loc_1018D3
  219. .text:001019AA ; ---------------------------------------------------------------------------
  220. .text:001019AA
  221. .text:001019AA $LN8:                                   ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
  222. .text:001019AA                                         ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
  223. .text:001019AA                 movzx   edx, ?cursorPosition@@3GA ; jumptable 0010193F case 69
  224. .text:001019B1                 add     edx, 4
  225. .text:001019B4                 mov     ?cursorPosition@@3GA, dx ; ushort cursorPosition
  226. .text:001019BB                 jmp     loc_1018D3
  227. .text:001019C0 ; ---------------------------------------------------------------------------
  228. .text:001019C0
  229. .text:001019C0 $LN7:                                   ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
  230. .text:001019C0                                         ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
  231. .text:001019C0                 movzx   eax, ?cursorPosition@@3GA ; jumptable 0010193F case 56
  232. .text:001019C7                 mov     ecx, [ebp+videomemory]
  233. .text:001019CA                 mov     byte ptr [ecx+eax*2], 81h
  234. .text:001019CE                 movzx   edx, ?cursorPosition@@3GA ; ushort cursorPosition
  235. .text:001019D5                 mov     eax, [ebp+videomemory]
  236. .text:001019D8                 mov     cl, byte ptr [ebp+color]
  237. .text:001019DB                 mov     [eax+edx*2+1], cl
  238. .text:001019DF                 jmp     loc_1018D3
  239. .text:001019E4 ; ---------------------------------------------------------------------------
  240. .text:001019E4
  241. .text:001019E4 $LN6:                                   ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
  242. .text:001019E4                                         ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
  243. .text:001019E4                 movzx   edx, ?cursorPosition@@3GA ; jumptable 0010193F case 32
  244. .text:001019EB                 mov     eax, [ebp+videomemory]
  245. .text:001019EE                 mov     byte ptr [eax+edx*2], 84h
  246. .text:001019F2                 movzx   ecx, ?cursorPosition@@3GA ; ushort cursorPosition
  247. .text:001019F9                 mov     edx, [ebp+videomemory]
  248. .text:001019FC                 mov     al, byte ptr [ebp+color]
  249. .text:001019FF                 mov     [edx+ecx*2+1], al
  250. .text:00101A03                 jmp     loc_1018D3
  251. .text:00101A08 ; ---------------------------------------------------------------------------
  252. .text:00101A08
  253. .text:00101A08 $LN5:                                   ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
  254. .text:00101A08                                         ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
  255. .text:00101A08                 movzx   ecx, ?cursorPosition@@3GA ; jumptable 0010193F case 0
  256. .text:00101A0F                 mov     edx, [ebp+videomemory]
  257. .text:00101A12                 mov     byte ptr [edx+ecx*2], 8Eh
  258. .text:00101A16                 movzx   eax, ?cursorPosition@@3GA ; ushort cursorPosition
  259. .text:00101A1D                 mov     ecx, [ebp+videomemory]
  260. .text:00101A20                 mov     dl, byte ptr [ebp+color]
  261. .text:00101A23                 mov     [ecx+eax*2+1], dl
  262. .text:00101A27                 jmp     loc_1018D3
  263. .text:00101A2C ; ---------------------------------------------------------------------------
  264. .text:00101A2C
  265. .text:00101A2C $LN4:                                   ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
  266. .text:00101A2C                                         ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
  267. .text:00101A2C                 movzx   eax, ?cursorPosition@@3GA ; jumptable 0010193F case 50
  268. .text:00101A33                 mov     ecx, [ebp+videomemory]
  269. .text:00101A36                 mov     byte ptr [ecx+eax*2], 94h
  270. .text:00101A3A                 movzx   edx, ?cursorPosition@@3GA ; ushort cursorPosition
  271. .text:00101A41                 mov     eax, [ebp+videomemory]
  272. .text:00101A44                 mov     cl, byte ptr [ebp+color]
  273. .text:00101A47                 mov     [eax+edx*2+1], cl
  274. .text:00101A4B                 jmp     loc_1018D3
  275. .text:00101A50 ; ---------------------------------------------------------------------------
  276. .text:00101A50
  277. .text:00101A50 $LN3:                                   ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
  278. .text:00101A50                                         ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
  279. .text:00101A50                 movzx   edx, ?cursorPosition@@3GA ; jumptable 0010193F case 18
  280. .text:00101A57                 mov     eax, [ebp+videomemory]
  281. .text:00101A5A                 mov     byte ptr [eax+edx*2], 99h
  282. .text:00101A5E                 movzx   ecx, ?cursorPosition@@3GA ; ushort cursorPosition
  283. .text:00101A65                 mov     edx, [ebp+videomemory]
  284. .text:00101A68                 mov     al, byte ptr [ebp+color]
  285. .text:00101A6B                 mov     [edx+ecx*2+1], al
  286. .text:00101A6F                 jmp     loc_1018D3
  287. .text:00101A74 ; ---------------------------------------------------------------------------
  288. .text:00101A74
  289. .text:00101A74 $LN2:                                   ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
  290. .text:00101A74                                         ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
  291. .text:00101A74                 movzx   ecx, ?cursorPosition@@3GA ; jumptable 0010193F case 24
  292. .text:00101A7B                 mov     edx, [ebp+videomemory]
  293. .text:00101A7E                 mov     byte ptr [edx+ecx*2], 9Ah
  294. .text:00101A82                 movzx   eax, ?cursorPosition@@3GA ; ushort cursorPosition
  295. .text:00101A89                 mov     ecx, [ebp+videomemory]
  296. .text:00101A8C                 mov     dl, byte ptr [ebp+color]
  297. .text:00101A8F                 mov     [ecx+eax*2+1], dl
  298. .text:00101A93                 jmp     loc_1018D3
  299. .text:00101A98 ; ---------------------------------------------------------------------------
  300. .text:00101A98
  301. .text:00101A98 $LN1:                                   ; CODE XREF: k_print(char const *,k_ConsoleColor)+9Fj
  302. .text:00101A98                                         ; DATA XREF: k_print(char const *,k_ConsoleColor):off_101AC8o
  303. .text:00101A98                 movzx   eax, ?cursorPosition@@3GA ; jumptable 0010193F case 27
  304. .text:00101A9F                 mov     ecx, [ebp+videomemory]
  305. .text:00101AA2                 mov     byte ptr [ecx+eax*2], 0E1h
  306. .text:00101AA6                 movzx   edx, ?cursorPosition@@3GA ; ushort cursorPosition
  307. .text:00101AAD                 mov     eax, [ebp+videomemory]
  308. .text:00101AB0                 mov     cl, byte ptr [ebp+color]
  309. .text:00101AB3                 mov     [eax+edx*2+1], cl
  310. .text:00101AB7                 jmp     loc_1018D3
  311. .text:00101ABC ; ---------------------------------------------------------------------------
  312. .text:00101ABC
  313. .text:00101ABC loc_101ABC:                             ; CODE XREF: k_print(char const *,k_ConsoleColor)+C9j
  314. .text:00101ABC                 jmp     loc_1018D3
  315. .text:00101AC1 ; ---------------------------------------------------------------------------
  316. .text:00101AC1
  317. .text:00101AC1 loc_101AC1:                             ; CODE XREF: k_print(char const *,k_ConsoleColor)+56j
  318. .text:00101AC1                 mov     esp, ebp
  319. .text:00101AC3                 pop     ebp
  320. .text:00101AC4                 retn    8
  321. .text:00101AC4 ; ---------------------------------------------------------------------------
  322. .text:00101AC7                 align 4
  323. .text:00101AC8 off_101AC8      dd offset $LN5, offset $LN3, offset $LN2, offset $LN1
  324. .text:00101AC8                                         ; DATA XREF: k_print(char const *,k_ConsoleColor)+9Fr
  325. .text:00101AC8                 dd offset $LN6, offset $LN4, offset $LN7, offset $LN8 ; jump table for switch statement
  326. .text:00101AC8                 dd offset $LN9, offset $LN10, offset loc_101946
  327. .text:00101AF4 byte_101AF4     db      0,   0Ah,   0Ah,   0Ah
  328. .text:00101AF4                                         ; DATA XREF: k_print(char const *,k_ConsoleColor)+98r
  329. .text:00101AF4                 db    0Ah,   0Ah,   0Ah,   0Ah ; indirect table for switch statement
  330. .text:00101AF4                 db    0Ah,   0Ah,   0Ah,   0Ah
  331. .text:00101AF4                 db    0Ah,   0Ah,   0Ah,   0Ah
  332. .text:00101AF4                 db    0Ah,   0Ah,     1,   0Ah
  333. .text:00101AF4                 db    0Ah,   0Ah,   0Ah,   0Ah
  334. .text:00101AF4                 db      2,   0Ah,   0Ah,     3
  335. .text:00101AF4                 db    0Ah,   0Ah,   0Ah,   0Ah
  336. .text:00101AF4                 db      4,   0Ah,   0Ah,   0Ah
  337. .text:00101AF4                 db    0Ah,   0Ah,   0Ah,   0Ah
  338. .text:00101AF4                 db    0Ah,   0Ah,   0Ah,   0Ah
  339. .text:00101AF4                 db    0Ah,   0Ah,   0Ah,   0Ah
  340. .text:00101AF4                 db    0Ah,   0Ah,     5,   0Ah
  341. .text:00101AF4                 db    0Ah,   0Ah,   0Ah,   0Ah
  342. .text:00101AF4                 db      6,   0Ah,   0Ah,   0Ah
  343. .text:00101AF4                 db    0Ah,   0Ah,   0Ah,   0Ah
  344. .text:00101AF4                 db    0Ah,   0Ah,   0Ah,   0Ah
  345. .text:00101AF4                 db    0Ah,     7,     8,   0Ah
  346. .text:00101AF4                 db    0Ah,     9
  347. .text:00101AF4 ?k_print@@YGXPBDW4k_ConsoleColor@@@Z endp
  348.  
  349.  
  350.  
  351.  
  352.  
  353. ; int __stdcall k_clearScreen()
  354. .text:00101B40 _k_clearScreen@0 proc near              ; CODE XREF: k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+3p
  355. .text:00101B40                                         ; kmain(x,x)+3p
  356. .text:00101B40
  357. .text:00101B40 videomemory     = dword ptr -8
  358. .text:00101B40 i               = dword ptr -4
  359. .text:00101B40
  360. .text:00101B40                 push    ebp
  361. .text:00101B41                 mov     ebp, esp
  362. .text:00101B43                 sub     esp, 8
  363. .text:00101B46                 mov     [ebp+videomemory], 0B8000h
  364. .text:00101B4D                 mov     [ebp+i], 0
  365. .text:00101B54                 jmp     short loc_101B5F
  366. .text:00101B56 ; ---------------------------------------------------------------------------
  367. .text:00101B56
  368. .text:00101B56 loc_101B56:                             ; CODE XREF: k_clearScreen()+3Dj
  369. .text:00101B56                 mov     eax, [ebp+i]
  370. .text:00101B59                 add     eax, 1
  371. .text:00101B5C                 mov     [ebp+i], eax
  372. .text:00101B5F
  373. .text:00101B5F loc_101B5F:                             ; CODE XREF: k_clearScreen()+14j
  374. .text:00101B5F                 cmp     [ebp+i], 7D0h
  375. .text:00101B66                 jge     short loc_101B7F
  376. .text:00101B68                 mov     ecx, [ebp+i]
  377. .text:00101B6B                 mov     edx, [ebp+videomemory]
  378. .text:00101B6E                 mov     byte ptr [edx+ecx*2], 20h
  379. .text:00101B72                 mov     eax, [ebp+i]
  380. .text:00101B75                 mov     ecx, [ebp+videomemory]
  381. .text:00101B78                 mov     byte ptr [ecx+eax*2+1], 7
  382. .text:00101B7D                 jmp     short loc_101B56
  383. .text:00101B7F ; ---------------------------------------------------------------------------
  384. .text:00101B7F
  385. .text:00101B7F loc_101B7F:                             ; CODE XREF: k_clearScreen()+26j
  386. .text:00101B7F                 xor     edx, edx
  387. .text:00101B81                 mov     ?cursorPosition@@3GA, dx ; ushort cursorPosition
  388. .text:00101B88                 mov     esp, ebp
  389. .text:00101B8A                 pop     ebp
  390. .text:00101B8B                 retn
  391. .text:00101B8B _k_clearScreen@0 endp
  392.  
  393.  
  394.  
  395.  
  396.  
  397. .text:00101B90 ; int __stdcall k_hideCursor()
  398. .text:00101B90 _k_hideCursor@0 proc near               ; CODE XREF: kmain(x,x)+8p
  399. .text:00101B90
  400. .text:00101B90 position        = word ptr -4
  401. .text:00101B90
  402. .text:00101B90                 push    ebp
  403. .text:00101B91                 mov     ebp, esp
  404. .text:00101B93                 push    ecx
  405. .text:00101B94                 mov     eax, 7D0h
  406. .text:00101B99                 mov     [ebp+position], ax
  407. .text:00101B9D                 mov     edx, 3D4h
  408. .text:00101BA2                 mov     al, 0Fh
  409. .text:00101BA4                 out     dx, al          ; Video: CRT cntrlr addr
  410. .text:00101BA4                                         ; Cursor location (low)
  411. .text:00101BA5                 movzx   eax, [ebp+position]
  412. .text:00101BA9                 and     eax, 0FFh
  413. .text:00101BAE                 mov     edx, 3D5h
  414. .text:00101BB3                 out     dx, al          ; Video: CRT controller internal registers
  415. .text:00101BB4                 mov     edx, 3D4h
  416. .text:00101BB9                 mov     al, 0Eh
  417. .text:00101BBB                 out     dx, al          ; Video: CRT cntrlr addr
  418. .text:00101BBB                                         ; Cursor location (high)
  419. .text:00101BBC                 movzx   eax, [ebp+position]
  420. .text:00101BC0                 sar     eax, 8
  421. .text:00101BC3                 and     eax, 0FFh
  422. .text:00101BC8                 mov     edx, 3D5h
  423. .text:00101BCD                 out     dx, al          ; Video: CRT controller internal registers
  424. .text:00101BCE                 mov     esp, ebp
  425. .text:00101BD0                 pop     ebp
  426. .text:00101BD1                 retn
  427. .text:00101BD1 _k_hideCursor@0 endp
  428.  
  429.  
  430.  
  431.  
  432.  
  433. .text:00101BE0 ; void __stdcall k_printHex(unsigned int value, k_ConsoleColor color)
  434. .text:00101BE0 _k_printHex@8   proc near               ; CODE XREF: k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+53p
  435. .text:00101BE0                                         ; k_interruptHandler(x,x,x,x,x,x,x,x,x,x,x,x,x,x)+6Ap ...
  436. .text:00101BE0
  437. .text:00101BE0 output          = byte ptr -1Ch
  438. .text:00101BE0 var_10          = dword ptr -10h
  439. .text:00101BE0 n               = dword ptr -0Ch
  440. .text:00101BE0 tmp             = dword ptr -8
  441. .text:00101BE0 i               = dword ptr -4
  442. .text:00101BE0 value           = dword ptr  8
  443. .text:00101BE0 color           = dword ptr  0Ch
  444. .text:00101BE0
  445. .text:00101BE0                 push    ebp
  446. .text:00101BE1                 mov     ebp, esp
  447. .text:00101BE3                 sub     esp, 1Ch
  448. .text:00101BE6                 mov     eax, [ebp+value]
  449. .text:00101BE9                 mov     [ebp+n], eax
  450. .text:00101BEC                 mov     [ebp+i], 7
  451. .text:00101BF3                 mov     ecx, dword ptr ds:a00000000 ; "00000000"
  452. .text:00101BF9                 mov     dword ptr [ebp+output], ecx
  453. .text:00101BFC                 mov     edx, dword ptr ds:a00000000+4
  454. .text:00101C02                 mov     dword ptr [ebp+output+4], edx
  455. .text:00101C05                 mov     al, byte ptr ds:a00000000+8
  456. .text:00101C0A                 mov     [ebp+output+8], al
  457. .text:00101C0D
  458. .text:00101C0D loc_101C0D:                             ; CODE XREF: k_printHex(x,x)+7Aj
  459. .text:00101C0D                 mov     ecx, [ebp+n]
  460. .text:00101C10                 and     ecx, 8000000Fh
  461. .text:00101C16                 jns     short loc_101C1D
  462. .text:00101C18                 dec     ecx
  463. .text:00101C19                 or      ecx, 0FFFFFFF0h
  464. .text:00101C1C                 inc     ecx
  465. .text:00101C1D
  466. .text:00101C1D loc_101C1D:                             ; CODE XREF: k_printHex(x,x)+36j
  467. .text:00101C1D                 mov     [ebp+tmp], ecx
  468. .text:00101C20                 cmp     [ebp+tmp], 0Ah
  469. .text:00101C24                 jge     short loc_101C31
  470. .text:00101C26                 mov     edx, [ebp+tmp]
  471. .text:00101C29                 add     edx, 30h
  472. .text:00101C2C                 mov     [ebp+var_10], edx
  473. .text:00101C2F                 jmp     short loc_101C3A
  474. .text:00101C31 ; ---------------------------------------------------------------------------
  475. .text:00101C31
  476. .text:00101C31 loc_101C31:                             ; CODE XREF: k_printHex(x,x)+44j
  477. .text:00101C31                 mov     eax, [ebp+tmp]
  478. .text:00101C34                 add     eax, 37h
  479. .text:00101C37                 mov     [ebp+var_10], eax
  480. .text:00101C3A
  481. .text:00101C3A loc_101C3A:                             ; CODE XREF: k_printHex(x,x)+4Fj
  482. .text:00101C3A                 mov     ecx, [ebp+i]
  483. .text:00101C3D                 mov     dl, byte ptr [ebp+var_10]
  484. .text:00101C40                 mov     [ebp+ecx+output], dl
  485. .text:00101C44                 mov     eax, [ebp+i]
  486. .text:00101C47                 sub     eax, 1
  487. .text:00101C4A                 mov     [ebp+i], eax
  488. .text:00101C4D                 mov     ecx, [ebp+n]
  489. .text:00101C50                 sar     ecx, 4
  490. .text:00101C53                 mov     [ebp+n], ecx
  491. .text:00101C56                 cmp     [ebp+i], 0
  492. .text:00101C5A                 jge     short loc_101C0D
  493. .text:00101C5C                 mov     edx, [ebp+color]
  494. .text:00101C5F                 push    edx             ; color
  495. .text:00101C60                 lea     eax, [ebp+output]
  496. .text:00101C63                 push    eax             ; ptr
  497. .text:00101C64                 call    ?k_print@@YGXPBDW4k_ConsoleColor@@@Z ; k_print(char const *,k_ConsoleColor)
  498. .text:00101C69                 mov     esp, ebp
  499. .text:00101C6B                 pop     ebp
  500. .text:00101C6C                 retn    8
  501. .text:00101C6C _k_printHex@8   endp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement