home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Stone / dos / gtool-ad.asm < prev    next >
Encoding:
Assembly Source File  |  2000-05-25  |  1.8 KB  |  38 lines

  1. .Model   Small
  2. .Code
  3. Org      100h
  4. P286
  5.  
  6.  Start:
  7.   Push   Ds Es                         ; Save segments were using
  8.   Mov    Dx,OffSet GtMsg               ; Load the offset of our message
  9.   Mov    Ax,3165h                      ; This was the GT.EXE's Data seg
  10.   Mov    Ds,Ax                         ; Store the original DS
  11.   Mov    Word Ptr Ds:[259h],8          ; Put the number 8 at DS:259h
  12.   Mov    Byte Ptr Ds:[5BAh],0          ; Zero DS:5BAh
  13.   Mov    Word Ptr Ds:[257h],8          ; Put the number 8 at DS:257h
  14.  Lp:
  15.   Cmp    Word Ptr Ds:[257h],00E0h      ; Have we gone to far?
  16.   Ja     Short Done                    ; Yes, get out of here, no GameTools
  17.   Mov    Ax,Ds:[257h]                  ; Get the value at DS:257h
  18.   Add    Ax,8                          ; Add 8 to it
  19.   Shl    Ax,2                          ; Multiply by 5
  20.   Xor    Bx,Bx                         ; Zero BX register
  21.   Mov    Di,Ax                         ; Put value of Ax into Di
  22.   Mov    Es,Bx                         ; Zero ES
  23.   Cmp    Word Ptr Es:[Di+2],00ABh      ; This is what i'me looking for :)
  24.   Jne    Short TryAg                   ; Nope, try again
  25.   Cmp    Word ptr Es:[di],0CDEFh       ; Do a second check
  26.   Jne    Short TryAg                   ; Nope, try again
  27.   Add    Dx,3                          ; Yes, delete the "no" part in my msg :)
  28.  Done:
  29.   Pop    Es Ds                         ; Restore ES and DS segments
  30.   Mov    Ah,9                          ; DOS print string function
  31.   Int    21h                           ; Print string at DS:DX
  32.   Ret                                  ; Ret uses 0 on stack, same as int 20h
  33.  TryAg:
  34.   Add    Word Ptr Ds:[257h],8          ; Add 8 to DS:257h
  35.   Jmp    Short Lp                      ; Repeat until DS:257h = 0E0h
  36.  
  37.   GtMsg  Db 'No Gametools detected in memory!',13,10,'$'
  38. End Start