jayanth.devarayanadurga
Banned
- Joined
- Dec 4, 2012
- Messages
- 4,280
- Helped
- 822
- Reputation
- 1,654
- Reaction score
- 791
- Trophy points
- 1,393
- Location
- Bangalore, India
- Activity points
- 0
Can somebody please explain this piece of assembly code?
Code ASM - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 CPU Disasm Address Hex dump Command Comments 0053D984 /$ /66:8338 00 CMP WORD PTR DS:[EAX],0 0053D988 |. |75 05 JNE SHORT 0053D98F 0053D98A |. |66:FF00 INC WORD PTR DS:[EAX] 0053D98D |.^\EB F5 JMP SHORT 0053D984 0053D98F |> |66:8338 0F CMP WORD PTR DS:[EAX],0F 0053D993 |. |75 05 JNE SHORT 0053D99A 0053D995 |. |66:FF08 DEC WORD PTR DS:[EAX] 0053D998 |.^\EB EA JMP SHORT 0053D984 0053D99A \> C3 RETN MOVZX EAX,BX 0053DA8C |. B9 06000000 |MOV ECX,6 0053DA91 |. 33D2 |XOR EDX,EDX 0053DA93 |. F7F1 |DIV ECX 0053DA95 |. 83FA 05 |CMP EDX,5 ; Switch (cases 0..5, 7 exits) 0053DA98 |. 0F87 F9020000 |JA 0053DD97 0053DA9E |. FF2495 A5DA5300 |JMP DWORD PTR DS:[EDX*4+53DAA5] 0053DAA5 |. BDDA5300 |DD 0053DABD 0053DAA9 |. 34DB5300 |DD 0053DB34 0053DAAD |. AEDB5300 |DD 0053DBAE 0053DAB1 |. 2EDC5300 |DD 0053DC2E 0053DAB5 |. ABDC5300 |DD 0053DCAB 0053DAB9 |. 1CDD5300 |DD 0053DD1C 0053DABD |> 8BC3 |MOV EAX,EBX ; Case 0 of switch 0053DABF |. 66:35 B200 |XOR AX,00B2 0053DAC3 |. 0FB696 DF000000 |MOVZX EDX,BYTE PTR DS:[ESI+0DF] 0053DACA |. 66:33C2 |XOR AX,DX 0053DACD |. 0FB656 6F |MOVZX EDX,BYTE PTR DS:[ESI+6F] 0053DAD1 |. 66:03C2 |ADD AX,DX 0053DAD4 |. 0FB696 FF000000 |MOVZX EDX,BYTE PTR DS:[ESI+0FF] 0053DADB |. 66:33C2 |XOR AX,DX 0053DADE |. 66:83E0 0F |AND AX,000F 0053DAE2 |. 66:8945 F2 |MOV WORD PTR SS:[LOCAL.4+2],AX 0053DAE6 |. 8BC3 |MOV EAX,EBX 0053DAE8 |. 66:35 B200 |XOR AX,00B2 0053DAEC |. 0FB656 5F |MOVZX EDX,BYTE PTR DS:[ESI+5F] 0053DAF0 |. 66:2BC2 |SUB AX,DX 0053DAF3 |. 0FB656 0F |MOVZX EDX,BYTE PTR DS:[ESI+0F] 0053DAF7 |. 66:2BC2 |SUB AX,DX 0053DAFA |. 0FB656 4F |MOVZX EDX,BYTE PTR DS:[ESI+4F] 0053DAFE |. 66:33C2 |XOR AX,DX 0053DB01 |. 66:83E0 0F |AND AX,000F 0053DB05 |. 66:8945 F0 |MOV WORD PTR SS:[LOCAL.4],AX 0053DB09 |. 8BC3 |MOV EAX,EBX 0053DB0B |. 66:35 B200 |XOR AX,00B2 0053DB0F |. 0FB656 2F |MOVZX EDX,BYTE PTR DS:[ESI+2F] 0053DB13 |. 66:03C2 |ADD AX,DX 0053DB16 |. 0FB696 8F000000 |MOVZX EDX,BYTE PTR DS:[ESI+8F] 0053DB1D |. 66:33C2 |XOR AX,DX 0053DB20 |. 0FB656 7F |MOVZX EDX,BYTE PTR DS:[ESI+7F] 0053DB24 |. 66:03C2 |ADD AX,DX 0053DB27 |. 66:83E0 0F |AND AX,000F 0053DB2B |. 66:8945 EE |MOV WORD PTR SS:[LOCAL.5+2],AX 0053DB2F |. E9 63020000 |JMP 0053DD97 0053DD97 |> 8D45 EE |LEA EAX,[LOCAL.5+2] ; Default case of switch 0053DD9A |. E8 E5FBFFFF |CALL 0053D984 0053DD9F |. 8D45 F2 |LEA EAX,[LOCAL.4+2] 0053DDA2 |. E8 DDFBFFFF |CALL 0053D984 0053DDA7 |. 8D45 F0 |LEA EAX,[LOCAL.4] 0053DDAA |. E8 D5FBFFFF |CALL 0053D984 0053DDAF |. 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DDB3 |. 66:3B45 F0 |CMP AX,WORD PTR SS:[LOCAL.4] 0053DDB7 |. 75 43 |JNE SHORT 0053DDFC 0053DDB9 |. 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DDBD |. 66:83F0 06 |XOR AX,0006 0053DDC1 |. 66:85C0 |TEST AX,AX 0053DDC4 |. 75 0E |JNZ SHORT 0053DDD4 0053DDC6 |. 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DDCA |. 66:83F0 04 |XOR AX,0004 0053DDCE |. 66:8945 F0 |MOV WORD PTR SS:[LOCAL.4],AX 0053DDD2 |. EB 28 |JMP SHORT 0053DDFC 0053DDD4 |> 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DDD8 |. 66:83F0 06 |XOR AX,0006 0053DDDC |. 66:83F8 0F |CMP AX,0F 0053DDE0 |. 75 0E |JNE SHORT 0053DDF0 0053DDE2 |. 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DDE6 |. 66:83F0 04 |XOR AX,0004 0053DDEA |. 66:8945 F0 |MOV WORD PTR SS:[LOCAL.4],AX 0053DDEE |. EB 0C |JMP SHORT 0053DDFC 0053DDF0 |> 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DDF4 |. 66:83F0 06 |XOR AX,0006 0053DDF8 |. 66:8945 F0 |MOV WORD PTR SS:[LOCAL.4],AX 0053DDFC |> 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DE00 |. 66:3B45 EE |CMP AX,WORD PTR SS:[LOCAL.5+2] 0053DE04 |. 75 43 |JNE SHORT 0053DE49 0053DE06 |. 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DE0A |. 66:83F0 03 |XOR AX,0003 0053DE0E |. 66:85C0 |TEST AX,AX 0053DE11 |. 75 0E |JNZ SHORT 0053DE21 0053DE13 |. 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DE17 |. 66:83F0 02 |XOR AX,0002 0053DE1B |. 66:8945 EE |MOV WORD PTR SS:[LOCAL.5+2],AX 0053DE1F |. EB 28 |JMP SHORT 0053DE49 0053DE21 |> 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DE25 |. 66:83F0 03 |XOR AX,0003 0053DE29 |. 66:83F8 0F |CMP AX,0F 0053DE2D |. 75 0E |JNE SHORT 0053DE3D 0053DE2F |. 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DE33 |. 66:83F0 02 |XOR AX,0002 0053DE37 |. 66:8945 EE |MOV WORD PTR SS:[LOCAL.5+2],AX 0053DE3B |. EB 0C |JMP SHORT 0053DE49 0053DE3D |> 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DE41 |. 66:83F0 03 |XOR AX,0003 0053DE45 |. 66:8945 EE |MOV WORD PTR SS:[LOCAL.5+2],AX 0053DE49 |> 0FB745 F0 |MOVZX EAX,WORD PTR SS:[LOCAL.4] 0053DE4D |. 66:3B45 EE |CMP AX,WORD PTR SS:[LOCAL.5+2] 0053DE51 |. 75 77 |JNE SHORT 0053DECA 0053DE53 |. 66:C745 EA 0200 |MOV WORD PTR SS:[LOCAL.6+2],2 0053DE59 |. 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DE5D |. 66:3345 F0 |XOR AX,WORD PTR SS:[LOCAL.4] 0053DE61 |. 66:3B45 EA |CMP AX,WORD PTR SS:[LOCAL.6+2] 0053DE65 |. 75 06 |JNE SHORT 0053DE6D 0053DE67 |. 66:C745 EA 0500 |MOV WORD PTR SS:[LOCAL.6+2],5 0053DE6D |> 66:C745 EC 0700 |MOV WORD PTR SS:[LOCAL.5],7 0053DE73 |. 0FB745 F2 |MOVZX EAX,WORD PTR SS:[LOCAL.4+2] 0053DE77 |. 66:3345 F0 |XOR AX,WORD PTR SS:[LOCAL.4] 0053DE7B |. 66:3B45 EC |CMP AX,WORD PTR SS:[LOCAL.5] 0053DE7F |. 75 06 |JNE SHORT 0053DE87 0053DE81 |. 66:C745 EC 0800 |MOV WORD PTR SS:[LOCAL.5],8 0053DE87 |> 0FB745 F0 |MOVZX EAX,WORD PTR SS:[LOCAL.4] 0053DE8B |. 66:3345 EA |XOR AX,WORD PTR SS:[LOCAL.6+2] 0053DE8F |. 66:85C0 |TEST AX,AX 0053DE92 |. 75 0E |JNZ SHORT 0053DEA2 0053DE94 |. 0FB745 F0 |MOVZX EAX,WORD PTR SS:[LOCAL.4] 0053DE98 |. 66:3345 EC |XOR AX,WORD PTR SS:[LOCAL.5] 0053DE9C |. 66:8945 EE |MOV WORD PTR SS:[LOCAL.5+2],AX 0053DEA0 |. EB 28 |JMP SHORT 0053DECA 0053DEA2 |> 0FB745 F0 |MOVZX EAX,WORD PTR SS:[LOCAL.4] 0053DEA6 |. 66:3345 EA |XOR AX,WORD PTR SS:[LOCAL.6+2] 0053DEAA |. 66:83F8 0F |CMP AX,0F 0053DEAE |. 75 0E |JNE SHORT 0053DEBE 0053DEB0 |. 0FB745 F0 |MOVZX EAX,WORD PTR SS:[LOCAL.4] 0053DEB4 |. 66:3345 EC |XOR AX,WORD PTR SS:[LOCAL.5] 0053DEB8 |. 66:8945 EE |MOV WORD PTR SS:[LOCAL.5+2],AX 0053DEBC |. EB 0C |JMP SHORT 0053DECA 0053DEBE |> 0FB745 F0 |MOVZX EAX,WORD PTR SS:[LOCAL.4] 0053DEC2 |. 66:3345 EA |XOR AX,WORD PTR SS:[LOCAL.6+2] 0053DEC6 |. 66:8945 EE |MOV WORD PTR SS:[LOCAL.5+2],AX 0053DECA |> 66:837D EE 00 |CMP WORD PTR SS:[LOCAL.5+2],0 0053DECF |. 75 1D |JNE SHORT 0053DEEE 0053DED1 |. 66:BF 0100 |MOV DI,1 0053DED5 |> 66:3B7D F0 |/CMP DI,WORD PTR SS:[LOCAL.4] 0053DED9 |. 74 0C ||JE SHORT 0053DEE7 0053DEDB |. 66:3B7D F2 ||CMP DI,WORD PTR SS:[LOCAL.4+2] 0053DEDF |. 74 06 ||JE SHORT 0053DEE7 0053DEE1 |. 66:897D EE ||MOV WORD PTR SS:[LOCAL.5+2],DI 0053DEE5 |. EB 07 ||JMP SHORT 0053DEEE 0053DEE7 |> 47 ||INC EDI 0053DEE8 |. 66:83FF 0F ||CMP DI,0F 0053DEEC |.^ 75 E7 |\JNE SHORT 0053DED5 0053DEEE |> 66:837D EE 0F |CMP WORD PTR SS:[LOCAL.5+2],0F 0053DEF3 |. 75 1D |JNE SHORT 0053DF12 0053DEF5 |. 66:BF 0100 |MOV DI,1 0053DEF9 |> 66:3B7D F0 |/CMP DI,WORD PTR SS:[LOCAL.4] 0053DEFD |. 74 0C ||JE SHORT 0053DF0B 0053DEFF |. 66:3B7D F2 ||CMP DI,WORD PTR SS:[LOCAL.4+2] 0053DF03 |. 74 06 ||JE SHORT 0053DF0B 0053DF05 |. 66:897D EE ||MOV WORD PTR SS:[LOCAL.5+2],DI 0053DF09 |. EB 07 ||JMP SHORT 0053DF12 0053DF0B |> 47 ||INC EDI 0053DF0C |. 66:83FF 0F ||CMP DI,0F 0053DF10 |.^ 75 E7 |\JNE SHORT 0053DEF9 0053DF12 |> 66:85DB |TEST BX,BX 0053DF15 |. 0F86 C4000000 |JBE 0053DFDF 0053DF1B |. 0FB7C3 |MOVZX EAX,BX 0053DF1E |. 03C0 |ADD EAX,EAX 0053DF20 |. 0FB644C6 F1 |MOVZX EAX,BYTE PTR DS:[EAX*8+ESI-0F] 0053DF25 |. 0FB7D3 |MOVZX EDX,BX 0053DF28 |. 03D2 |ADD EDX,EDX 0053DF2A |. 3244D6 F2 |XOR AL,BYTE PTR DS:[EDX*8+ESI-0E] 0053DF2E |. 0FB6C0 |MOVZX EAX,AL 0053DF31 |. 0FB7D3 |MOVZX EDX,BX 0053DF34 |. 03D2 |ADD EDX,EDX 0053DF36 |. 0FB654D6 F3 |MOVZX EDX,BYTE PTR DS:[EDX*8+ESI-0D] 0053DF3B |. 66:03C2 |ADD AX,DX 0053DF3E |. 0FB7D3 |MOVZX EDX,BX 0053DF41 |. 03D2 |ADD EDX,EDX 0053DF43 |. 0FB654D6 F4 |MOVZX EDX,BYTE PTR DS:[EDX*8+ESI-0C] 0053DF48 |. 66:03C2 |ADD AX,DX 0053DF4B |. 66:8945 F6 |MOV WORD PTR SS:[LOCAL.3+2],AX 0053DF4F |. 0FB7C3 |MOVZX EAX,BX 0053DF52 |. 03C0 |ADD EAX,EAX 0053DF54 |. 0FB644C6 F5 |MOVZX EAX,BYTE PTR DS:[EAX*8+ESI-0B] 0053DF59 |. 66:0345 F6 |ADD AX,WORD PTR SS:[LOCAL.3+2] 0053DF5D |. 0FB7D3 |MOVZX EDX,BX 0053DF60 |. 03D2 |ADD EDX,EDX 0053DF62 |. 0FB654D6 F6 |MOVZX EDX,BYTE PTR DS:[EDX*8+ESI-0A] 0053DF67 |. 66:03C2 |ADD AX,DX 0053DF6A |. 0FB7D3 |MOVZX EDX,BX 0053DF6D |. 03D2 |ADD EDX,EDX 0053DF6F |. 0FB654D6 F7 |MOVZX EDX,BYTE PTR DS:[EDX*8+ESI-9] 0053DF74 |. 66:03C2 |ADD AX,DX 0053DF77 |. 0FB7D3 |MOVZX EDX,BX 0053DF7A |. 03D2 |ADD EDX,EDX 0053DF7C |. 0FB654D6 F8 |MOVZX EDX,BYTE PTR DS:[EDX*8+ESI-8] 0053DF81 |. 66:03C2 |ADD AX,DX 0053DF84 |. 66:8945 F6 |MOV WORD PTR SS:[LOCAL.3+2],AX 0053DF88 |. 0FB7C3 |MOVZX EAX,BX 0053DF8B |. 03C0 |ADD EAX,EAX 0053DF8D |. 0FB644C6 F9 |MOVZX EAX,BYTE PTR DS:[EAX*8+ESI-7] 0053DF92 |. 0FB7D3 |MOVZX EDX,BX 0053DF95 |. 03D2 |ADD EDX,EDX 0053DF97 |. 3244D6 FA |XOR AL,BYTE PTR DS:[EDX*8+ESI-6] 0053DF9B |. 0FB6C0 |MOVZX EAX,AL 0053DF9E |. 66:0345 F6 |ADD AX,WORD PTR SS:[LOCAL.3+2] 0053DFA2 |. 0FB7D3 |MOVZX EDX,BX 0053DFA5 |. 03D2 |ADD EDX,EDX 0053DFA7 |. 0FB654D6 FB |MOVZX EDX,BYTE PTR DS:[EDX*8+ESI-5] 0053DFAC |. 66:03C2 |ADD AX,DX 0053DFAF |. 0FB7D3 |MOVZX EDX,BX 0053DFB2 |. 03D2 |ADD EDX,EDX 0053DFB4 |. 0FB654D6 FC |MOVZX EDX,BYTE PTR DS:[EDX*8+ESI-4] 0053DFB9 |. 66:03C2 |ADD AX,DX 0053DFBC |. 66:8945 F6 |MOV WORD PTR SS:[LOCAL.3+2],AX 0053DFC0 |. 0FB7C3 |MOVZX EAX,BX 0053DFC3 |. 03C0 |ADD EAX,EAX 0053DFC5 |. 0FB644C6 FD |MOVZX EAX,BYTE PTR DS:[EAX*8+ESI-3] 0053DFCA |. 66:0345 F6 |ADD AX,WORD PTR SS:[LOCAL.3+2] 0053DFCE |. 0FB7D3 |MOVZX EDX,BX 0053DFD1 |. 03D2 |ADD EDX,EDX 0053DFD3 |. 0FB654D6 FE |MOVZX EDX,BYTE PTR DS:[EDX*8+ESI-2] 0053DFD8 |. 66:33C2 |XOR AX,DX 0053DFDB |. 66:8945 F6 |MOV WORD PTR SS:[LOCAL.3+2],AX 0053DFDF |> 0FB7C3 |MOVZX EAX,BX 0053DFE2 |. 03C0 |ADD EAX,EAX 0053DFE4 |. 8D04C6 |LEA EAX,[EAX*8+ESI] 0053DFE7 |. 0FB755 F2 |MOVZX EDX,WORD PTR SS:[LOCAL.4+2] 0053DFEB |. 0FB60410 |MOVZX EAX,BYTE PTR DS:[EDX+EAX] 0053DFEF |. 0FB7D3 |MOVZX EDX,BX 0053DFF2 |. 03D2 |ADD EDX,EDX 0053DFF4 |. 8B4D FC |MOV ECX,DWORD PTR SS:[LOCAL.1] 0053DFF7 |. 880411 |MOV BYTE PTR DS:[EDX+ECX],AL 0053DFFA |. 0FB7C3 |MOVZX EAX,BX 0053DFFD |. 03C0 |ADD EAX,EAX 0053DFFF |. 8D04C6 |LEA EAX,[EAX*8+ESI] 0053E002 |. 0FB755 F0 |MOVZX EDX,WORD PTR SS:[LOCAL.4] 0053E006 |. 0FB60410 |MOVZX EAX,BYTE PTR DS:[EDX+EAX] 0053E00A |. 0FB7D3 |MOVZX EDX,BX 0053E00D |. 03D2 |ADD EDX,EDX 0053E00F |. 8B4D FC |MOV ECX,DWORD PTR SS:[LOCAL.1] 0053E012 |. 884411 01 |MOV BYTE PTR DS:[EDX+ECX+1],AL 0053E016 |. 66:85DB |TEST BX,BX 0053E019 |. 76 26 |JBE SHORT 0053E041 0053E01B |. 0FB7C3 |MOVZX EAX,BX 0053E01E |. 03C0 |ADD EAX,EAX 0053E020 |. 8D04C6 |LEA EAX,[EAX*8+ESI] 0053E023 |. 0FB755 EE |MOVZX EDX,WORD PTR SS:[LOCAL.5+2] 0053E027 |. 0FB60410 |MOVZX EAX,BYTE PTR DS:[EDX+EAX] 0053E02B |. 0FB755 F6 |MOVZX EDX,WORD PTR SS:[LOCAL.3+2] 0053E02F |. 66:83E2 0F |AND DX,000F 0053E033 |. 66:3BC2 |CMP AX,DX 0053E036 |. 74 09 |JE SHORT 0053E041 0053E038 |. C745 F8 01000000 |MOV DWORD PTR SS:[LOCAL.2],1 0053E03F |. EB 10 |JMP SHORT 0053E051 0053E041 |> 43 |INC EBX 0053E042 |. 66:83FB 10 |CMP BX,10 0053E046 |.^ 0F82 3DFAFFFF \JB 0053DA89 0053E04C |. 33C0 XOR EAX,EAX 0053E04E |. 8945 F8 MOV DWORD PTR SS:[LOCAL.2],EAX 0053E051 |> 33C0 XOR EAX,EAX 0053E053 |. 5A POP EDX 0053E054 |. 59 POP ECX 0053E055 |. 59 POP ECX 0053E056 |. 64:8910 MOV DWORD PTR FS:[EAX],EDX 0053E059 |. 68 66E05300 PUSH 0053E066 ; Entry point 0053E05E \> C3 RETN ; Jump to 53E066 0053E05F $^ E9 206BECFF JMP 00404B84 ; SE handling routine 0053E064 .^ EB F8 JMP SHORT 0053E05E 0053E066 /> 8B45 F8 MOV EAX,DWORD PTR SS:[LOCAL.2] 0053E069 |. 5F POP EDI 0053E06A |. 5E POP ESI 0053E06B |. 5B POP EBX 0053E06C |. 8BE5 MOV ESP,EBP 0053E06E |. 5D POP EBP 0053E06F \. C3 RETN
Last edited by a moderator: