home *** CD-ROM | disk | FTP | other *** search
- .Model Small
- .Code
- Org 100h
- P286
-
- Start:
- Push Ds Es ; Save segments were using
- Mov Dx,OffSet GtMsg ; Load the offset of our message
- Mov Ax,3165h ; This was the GT.EXE's Data seg
- Mov Ds,Ax ; Store the original DS
- Mov Word Ptr Ds:[259h],8 ; Put the number 8 at DS:259h
- Mov Byte Ptr Ds:[5BAh],0 ; Zero DS:5BAh
- Mov Word Ptr Ds:[257h],8 ; Put the number 8 at DS:257h
- Lp:
- Cmp Word Ptr Ds:[257h],00E0h ; Have we gone to far?
- Ja Short Done ; Yes, get out of here, no GameTools
- Mov Ax,Ds:[257h] ; Get the value at DS:257h
- Add Ax,8 ; Add 8 to it
- Shl Ax,2 ; Multiply by 5
- Xor Bx,Bx ; Zero BX register
- Mov Di,Ax ; Put value of Ax into Di
- Mov Es,Bx ; Zero ES
- Cmp Word Ptr Es:[Di+2],00ABh ; This is what i'me looking for :)
- Jne Short TryAg ; Nope, try again
- Cmp Word ptr Es:[di],0CDEFh ; Do a second check
- Jne Short TryAg ; Nope, try again
- Add Dx,3 ; Yes, delete the "no" part in my msg :)
- Done:
- Pop Es Ds ; Restore ES and DS segments
- Mov Ah,9 ; DOS print string function
- Int 21h ; Print string at DS:DX
- Ret ; Ret uses 0 on stack, same as int 20h
- TryAg:
- Add Word Ptr Ds:[257h],8 ; Add 8 to DS:257h
- Jmp Short Lp ; Repeat until DS:257h = 0E0h
-
- GtMsg Db 'No Gametools detected in memory!',13,10,'$'
- End Start