Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ****************************************************************************
- ; * *
- ; * RESIDENT TRAINER FOR ARKANOID II - by MWPC2 *
- ; * This is part of LE GRAND MANITOU. *
- ; * *
- ; * Feel free to reuse this source. Please do not forget the credit. *
- ; * *
- ; * Source for TASM 3.2. 8086 code. *
- ; * *
- ; * Assemble with: TASM ARKA2TRN *
- ; * TLINK ARKA2TRN /t *
- ; * *
- ; ****************************************************************************
- ; First, we declare a segment.
- MYSEG segment byte 'CODE'
- assume cs:MYSEG
- org 0100h ; needed for a COM file
- assume es:MYSEG, ss:MYSEG, ds:MYSEG
- start: jmp realstart
- ; ====RESIDENT PART==========================================================
- ; New INT 21h handler
- int_21h: pushf
- cli
- cmp ah,3Dh ; is it "open file" function ?
- jnz giveup2 ; if not, give up.
- push ax
- push bx
- push cx ; we save ALL registers
- push ds
- push si
- push es
- push di
- ; We search where segment the INT 21h has been called from.
- push ss
- pop es
- push sp
- pop di
- mov ax,word ptr es:[di+18]
- ; At this point, AX contains the segment CS where the INT 21h
- ; was called from.
- ; Now we compare the program that called INT 21h with a footprint
- ; of the original ARKANOID executable.
- mov es,ax
- mov di,0c7ah
- push cs
- pop ds
- mov si,offset datatsr
- mov cx,8 ; 8 words (16 bytes) to compare.
- cld
- rep cmpsw ; compare word at DS:SI with ES:DI
- jnz giveup ; if different, then give up.
- ; It's ok... let's kill the instruction that decrements the lives
- mov di,0c7ah
- mov ax,09090h ; 90 is the opcode for the NOP instruction
- stosw ; The NOP instruction does NOTHING.
- stosw
- stosw ; we write 3*2=6 NOPs.
- giveup: pop di
- pop es
- pop si
- pop ds
- pop cx ; we restore all registers
- pop bx
- pop ax
- giveup2: popf
- ; * We call the old INT 21h
- jmp cs:dword ptr [offset OLDINT21]
- ; Original INT 21h vector (adress)
- OLDINT21 dd 0h
- ; Footprint of the original ARKANOID 2 executable
- datatsr: db 0feh,00eh,097h,004h,074h,01fh,0c3h,080h,03eh,04dh
- db 00ah,001h,074h,03eh,0feh,006h
- ; =======END OF RESIDENT PART==================================================
- useless: db '°Û±' ; this is a useless french flag... tatata...
- realstart:
- ; We get the old INT 21h vector and we save it.
- mov ax, 3521h
- int 21h
- mov word ptr CS:[offset OLDINT21],bx
- mov word ptr CS:[offset OLDINT21+2h],es
- ; Installation of the new INT 21h handler.
- push cs
- pop ds
- mov dx, offset int_21h
- mov ax, 2521h
- int 21h
- ; Print out some silly texte...
- push cs
- pop ds
- mov dx,offset text
- mov ax,0900h
- int 21h
- ; Hop... the program is resident.
- mov ax,3100h
- mov dx,offset useless
- mov cl,4
- shr dx,cl
- inc dx
- int 21h
- text db 13,10
- db ' >>> ARKANOID II : REVENGE OF DOH [+1] trainer <<< by ÄÍðMWPC2ðÍÄ',13,10,13,10
- db ' - unlimited lives',13,10,13,10
- db ' Just another quick & dirty trainer...',13,10
- db ' Ok, resident part installed.',13,10,'$'
- MYSEG ends
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement