Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Making own INT's

agr0220agr0220 Member Posts: 3
Is it possible to define own INT's. How do you define new INT's. I thing it must be possible because for example DOS has it's own INT's.

Comments

  • blipblip Member Posts: 756
    Here's some example code to hook an INT then restore it for a program in a DOS Box in Windows:
    [code]
    mov ax,3520h ;Copy the vector for INT 20h into ES:BX.
    int 21h
    push cs
    mov [OldInt20h],bx
    mov dx,offset NewInt20hHandler
    mov ax,2520h ;Hook INT 20h with the handler pointed to by DS:DX.
    pop ds
    mov [OldInt20h+2],es
    int 21h
    int 20h
    cmp ax,0B0Bh
    jz ItWorks
    mov ax,1681h
    int 2Fh ;Call to DPMI services to disable task switching.
    mov al,80h
    cli ;Don't allow any hardware interrupts.
    out 70h,al ;No NMIs either.
    jmp $ ;Be evil and freeze!
    ItWorks:
    dw 16C5h,offset OldInt20h ;Hardcoded LDS DX,[OldInt20h]
    mov ax,2520h
    int 21h
    int 20h ;This one exits.

    NewInt20hHandler PROC
    mov ax,0B0Bh
    iret
    NewInt20hHandler ENDP

    OldInt20h dw ?,?
    [/code]
  • MrTrimbleMrTrimble Member Posts: 35
    [b][red]This message was edited by the MrTrimble at 2002-7-5 3:43:4[/red][/b][hr]
    : Here's some example code to hook an INT then restore it for a program in a DOS Box in Windows:

    : mov ax,3520h ;Copy the vector for INT 20h into ES:BX.


    How do you find the vector for an int? The example above shows that
    INT 20h is on vector 3520h, do you find the vector in a book or on the computer using a program?


  • DariusDarius Member Posts: 1,666
    : [b][red]This message was edited by the MrTrimble at 2002-7-5 3:43:4[/red][/b][hr]
    : : Here's some example code to hook an INT then restore it for a program in a DOS Box in Windows:
    :
    : : mov ax,3520h ;Copy the vector for INT 20h into ES:BX.
    :
    :
    : How do you find the vector for an int? The example above shows that
    : INT 20h is on vector 3520h, do you find the vector in a book or on the computer using a program?
    :
    :
    :

    INT 20h is interrupt vector 20h. In real-mode that means the address of it is at 0000:[4*20h]

    "We can't do nothing and think someone else will make it right."
    -Kyoto Now, Bad Religion

  • Justin BibJustin Bib USAMember Posts: 0

    ________ ( http://forcoder.org ) free video tutorials and ebooks about < Java Python Visual Basic JavaScript PHP MATLAB Go C# Perl Ruby Objective-C C++ C Delphi R Swift PL/SQL Assembly Scratch Visual Basic .NET Scala COBOL Julia Prolog Apex VBScript Fortran Crystal LabVIEW Ada Bash F# Erlang Logo ABAP Scheme ML Dart Lisp Lua Alice SAS D Kotlin Hack Transact-SQL Rust Clojure Awk FoxPro /> _________

Sign In or Register to comment.