Task 3 Monday, 08-Feb-99 13:31:00
Question 1 This bit of code checks for the ciorrect serial number. (a) ecx holds the bad serial number. edx hold another 16 digit Hex number, which turns out to be the good serial number. (b) I think the 8 is aded to esp so that the serial number is not written over. (c) Before the Test, eax=FFFFFFFF, and the Z flag is not set. After the test the Z flag is still not set, but it would have been if eax had been zero. If eax had been zero, then the jne instruction would have been passed over, as jne is the same as jump if not zero. (d)This jump takes us to the "...try again..." message. Question 2 :0040CCC0 sub esp, 00000004 ------------------- Makes room on Stack :0040CCC3 cmp dword ptr [0042F124], 00000000 -- ?, Z flag set :0040CCCA push ebx ---------------------------- ? :0040CCCB push esi ---------------------------- ? :0040CCCC jne 0040CD05 ------------------------ ?, Passed over :0040CCCE mov ecx, dword ptr [esp+10] --------- Bad serial :0040CCD2 mov edx, dword ptr [esp+14] --------- Good serial :0040CCD6 mov al, byte ptr [ecx] -------------- 1st Byte bad serial :0040CCD8 cmp al, byte ptr [edx] -------------- Compare with 1st byte good :0040CCDA jne 0040CCFA ------------------------ Leave if they don't match :0040CCDC or al, al --------------------------- if al=0, sets Z flag :0040CCDE je 0040CCF2 ------------------------- Jumps if Z=1 (no Hex number) :0040CCE0 mov al, byte ptr [ecx+01] ----------- Next bad serial byte :0040CCE3 cmp al, byte ptr [edx+01] ----------- Compare with next good :0040CCE6 jne 0040CCFA ------------------------ Leave if no match :0040CCE8 add ecx, 00000002 ------------------- Point to next bad byte :0040CCEB add edx, 00000002 ------------------- point to next good byte :0040CCEE or al, al --------------------------- If Hex then Z=0 :0040CCF0 jne 0040CCD6 ------------------------ Loops back if more Hex to check :0040CCF2 xor eax, eax ------------------------ Sets eax to zero, to jump over bad number message :0040CCF4 pop esi ----------------------------- ? :0040CCF5 pop ebx ----------------------------- ? :0040CCF6 add esp, 00000004 ------------------- Restores stack :0040CCF9 ret --------------------------------- Return Question 3 I haven't got a clue. Let's hope I find some good hints here. I can't get Winice to work properly with this program. Newbie |
Newbie: Task 1 (03-Feb-99 18:44:12) |
|
Copyright © InsideTheWeb, Inc. 1997-1999
All rights reserved.