Re: Jeffs here's help I hope Saturday, 27-Feb-99 19:47:29 Hi Jeff I have commented the lines I hope this helps Break with Bpint 21 if (ah == 3d) will land you at 010D :0001.0100 BA0D06 mov dx, 060D :0001.0103 B409 mov ah, 09 :0001.0105 CD21 int 21 :0001.0107 B8003D mov ax, 3D00 :0001.010A BA0106 mov dx, 0601 :0001.010D CD21 int 21 .. Open file :0001.010F 0F82A204 jb 05B5 :0001.0113 A35606 mov word ptr [0656], ax :0001.0116 8B1E5606 mov bx, [0656] :0001.011A B43F mov ah, 3F :0001.011C B90200 mov cx, 0002 .. Bytes to read :0001.011F BA5806 mov dx, 0658 :0001.0122 CD21 int 21 Read file :0001.0124 0F828D04 jb 05B5 :0001.0128 3D0200 cmp ax, 0002 ....2 read ? :0001.012B 0F858604 jne 05B5 .. Good no jump :0001.012F 8B0E5806 mov cx, [0658] .Move length here (06) :0001.0133 B43F mov ah, 3F :0001.0135 8B1E5606 mov bx, [0656] :0001.0139 BA6706 mov dx, 0667 .Puts name here :0001.013C CD21 int 21 Read file :0001.013E 0F827304 jb 05B5 :0001.0142 3B065806 cmp ax, [0658] . Length (06)? :0001.0146 0F856B04 jne 05B5 Good no jump :0001.014A B90200 mov cx, 0002 . Next 2 bytes :0001.014D B43F mov ah, 3F :0001.014F 8B1E5606 mov bx, [0656] :0001.0153 BA5A06 mov dx, 065A Put the 2 bytes here (checksum) :0001.0156 CD21 int 21 . Read file :0001.0158 0F825904 jb 05B5 :0001.015C 3D0200 cmp ax, 0002 ...Read 2 bytes :0001.015F 0F855204 jne 05B5 . Good no jump :0001.0163 8B0E5806 mov cx, [0658] .. length of user name (06) :0001.0167 33C0 xor ax, ax :0001.0169 BE6706 mov si, 0667 .put si to address of user name :0001.016C AC lodsb Load user name byte by byte :0001.016D 02E0 add ah, al :0001.016F D1C0 rol ax, 01 :0001.0171 D1C0 rol ax, 01 .these 5 instructions creates a checksum :0001.0173 D1C0 rol ax, 01 :0001.0175 E2F5 loop 016C :0001.0177 3B065A06 cmp ax, [065A] ..Is checksum same as in file which in your case should be E9 23 (but reversed in the dat file :0001.017B 0F853604 jne 05B5 .Good no jump (05B5 is the invalid key file string) The next 6 lines compute your position on the game grid :0001.017F 32C4 xor al , ah eax becomes .E9CA :0001.0181 80E401 and ah, 01 ..1CA :0001.0184 B34E mov bl, 4E :0001.0186 F6F3 div bl . . . eax becomes .4405 :0001.0188 0FBEF4 movsx si, ah 44 :0001.018B 81C60B01 add si, 010B 14F :0001.018F 89365C06 mov [065C], si .. so 14F becomes your start position :0001.0193 BB6006 mov bx, 0660 :0001.0196 BEB101 mov si, 01B1 :0001.0199 BF0001 mov di, 0100 Next 11 lines loads the game board to xx:0100 :0001.019C AC lodsb :0001.019D 3C00 cmp al, 00 :0001.019F 742F je 01D0 :0001.01A1 8AC8 mov cl , al :0001.01A3 25F000 and ax, 00F0 :0001.01A6 C0E804 shr al, 04 :0001.01A9 D7 xlat :0001.01AA 80E10F and cl, 0F :0001.01AD F3 repz :0001.01AE AA stosb :0001.01AF EBEB jmp 019C This is your game board. location 0100 is at upper left
:0001.01CF 008B365C add [bp+di+5C36], cl :0001.01D3 06 push es These line numbers have now been altered and the above have changed and have become. :0001.01D0 008B365C06 mov si [065C] :0001.01D4 AC lodsb .. 14F your start address :0001.01D5 3C2E cmp al, 2E it is 54 (eax) :0001.01D7 75FB jne 01D4 . Loop until your start position is 2E (eax) This will be 151 :0001.01D9 4E dec si . Si will show 152 will now be decremented to 151 :0001.01DA BA6706 mov dx, 0667 :0001.01DD B409 mov ah, 09 :0001.01DF CD21 int 21 :0001.01E1 B023 mov al, 23 :0001.01E3 8BFE mov di, si :0001.01E5 AA stosb :0001.01E6 89365C06 mov [065C], si :0001.01EA E95103 jmp 053E 0001.053E B96400 mov cx, 0064 load 100 bytes from dat file :0001.0541 B43F mov ah, 3F :0001.0543 8B1E5606 mov bx, [0656] :0001.0547 BA6706 mov dx, 0667 .. Put the bytes here at 0667 :0001.054A CD21 int 21 . Read file :0001.054C 7267 jb 05B5 :0001.054E 8BC8 mov cx, ax :0001.0550 BE6706 mov si, 0667 :0001.0553 AC lodsb load first byte :0001.0554 C0C002 rol al, 02 .. Rol it 02 :0001.0557 8AD8 mov bl , al . Mov lo byte to bl :0001.0559 80E303 and bl, 03 .. and it, this determines how you move acording to ebx If ebx = 0 then you move up one position If ebx = 1 then you move down one position If ebx = 2 then you move left one position If ebx = 3 then you move right one position :0001.055C 60 pusha :0001.055D E82C00 call 058C .. here your move is made :0001.0560 61 popa :0001.0561 C0C002 rol al, 02 . Then the first byte is Rol again etc :0001.0564 8AD8 mov bl , al :0001.0566 80E303 and bl, 03 :0001.0569 60 pusha :0001.056A E81F00 call 058C :0001.056D 61 popa :0001.056E C0C002 rol al, 02 :0001.0571 8AD8 mov bl , al :0001.0573 80E303 and bl, 03 :0001.0576 60 pusha :0001.0577 E81200 call 058C :0001.057A 61 popa :0001.057B C0C002 rol al, 02 :0001.057E 8AD8 mov bl , al :0001.0580 80E303 and bl, 03 :0001.0583 60 pusha :0001.0584 E80500 call 058C :0001.0587 61 popa :0001.0588 E2C9 loop 0553 :0001.058A EB29 jmp 05B5 So your .dat file should begin like this 06 00 4A 65 66 66 20 24 23 E9 0F FF C2 5A AA etc. Ill let you figure the rest If you got any questions let me know Princess Princess |
Jeffs thread (Jeff) (23-Feb-99 22:25:29) |