Subj : futil.asm redeux To : Paul Williams From : Jasen Betts Date : Sat Sep 14 2002 08:34 am Hi Paul. 12-Sep-02 00:00:50, Paul Williams wrote to BEN RITCHEY PW> Hi BEN RITCHEY, hope you are having a nice day PW> What I'd like to do is to be able to hit R and PW> have RING< placed into the xmit buffer which would then be sent PW> out a comport where a program on another would see it and think it PW> came from a modem on that box. (well not just ring but any other PW> strings as well) To do that you'll need to modify the keyboard watching code and the buffer-stuffing code too. what's it for anyway? something like this maybe... most of my mods are marked with * ; T H I S I S U N T E S T E D C O D E ; ----------------------------------------------- Int_9 PROC FAR assume DS:nothing,ES:nothing ; Could (and will) be anywhere push AX ; Must preserve EVERY register push CX push DI push ES xor AX,AX mov ES,AX in AL,KBD_PORT ; Scan code of key pressed mov AH,ES:[SH_STATE] ; Current shift state bits and AH,KUSED ; Mask out unused bits mov DI,offset KeyCodes ; Scan key codes table mov CX,KEYS @@: cmp AX,CS:[DI] je @Found1 add DI,SZ_ka loop @B ; Key was not found * xor AX, LSHIFT or RSHIFT ; swap shift bits.. * mov DI,offset KeyCodes * mov CX,KEYS * @@: * cmp AX,CS:[DI] * je @Found2 * add DI,SZ_ka * loop @B ; still not found! pop ES ; Restore saved registers pop DI pop CX pop AX jmp CS:[kbdvec] ; Pass though to original vector ; ; Key combo found; take action ; *@Found0: in AL,KBD_CTRL ; Save value of kbd control lines mov AH,AL or AL,80H ; Set kbd enable bit out KBD_CTRL,AL mov AL,AH out KBD_CTRL,AL mov AL,20H ; Signal end of HW interrupt to 8259A out 20H,AL * ; don't push BX xor BX,BX mov CX,SZ_ka/2 ret *@found1: * PUsH BX * call @found0 jmp SHORT @F @Clp: mov AX,CS:[DI+BX] ; Copy variables to intercept data area mov CS:[BX+offset cstate-2],AX @@: inc BX inc BX loop @Clp * :@Isrdone pop BX ; Restore registers pop ES pop DI pop CX pop AX iret *@found2: * PUSH BX * call @found0 * ; * ; HMM, dunno what goes here... the wedge seems to block all sending * ; of characters. * ; jmp @isrdone; -=> Bye <=- --- * Origin: Green eggs and ham: Environmentally sound produce. (3:640/531.42) .