interrupt chaining at boot time.
Posted: Fri Oct 07, 2005 3:24 am
Hi all
I am trying to develop a interrupt hook for int 13h.
i am setting up the hook at boot time in the MBR then
i load the load the first active partition and jump to it.
Well the problem is that i am just making a wrapper for now and trying to run it in bochs it gives me a disk access error.
I am not able to figure it out.
Here is my ISR Code:
-------------------------------------------
/* This is the New interrupt 13h handler. */
void interrupt new_int13( unsigned bp, unsigned di,
unsigned si, unsigned ds,
unsigned es, unsigned dx,
unsigned cx, unsigned bx,
unsigned ax, unsigned ip,
unsigned cs, unsigned flags)
{
_AX=ax;
_BX=bx;
_CX=cx;
_DX=dx;
_ES=es;
(*old_int13)(); // Call Old Handler
ax = _AX; // Return value of AX
bx = _BX; // Return value of BX
cx = _CX; // Return value of CX
dx = _DX; // Return value of DX
es = _ES; // Return value of ES
di = _DI; // Return value of DI
flags = _FLAGS; // Return the Flags
}
/* code in turboC 3.0 */
-------------------------------------------
then i tried it in assembly here is the assembly code
-------------------------------------
/* NASM. */
_new_int13:
push fs
push ax
push cs
pop fs
pop ax
pushf
call far [fs:word _old_int13]
pop fs
iret
-----------------------------------
this works in bochs and not on the actual system.
can anyone help me with this.
i think most of the viruses are written this way.... ;D
Thanks
INder.
I am trying to develop a interrupt hook for int 13h.
i am setting up the hook at boot time in the MBR then
i load the load the first active partition and jump to it.
Well the problem is that i am just making a wrapper for now and trying to run it in bochs it gives me a disk access error.
I am not able to figure it out.
Here is my ISR Code:
-------------------------------------------
/* This is the New interrupt 13h handler. */
void interrupt new_int13( unsigned bp, unsigned di,
unsigned si, unsigned ds,
unsigned es, unsigned dx,
unsigned cx, unsigned bx,
unsigned ax, unsigned ip,
unsigned cs, unsigned flags)
{
_AX=ax;
_BX=bx;
_CX=cx;
_DX=dx;
_ES=es;
(*old_int13)(); // Call Old Handler
ax = _AX; // Return value of AX
bx = _BX; // Return value of BX
cx = _CX; // Return value of CX
dx = _DX; // Return value of DX
es = _ES; // Return value of ES
di = _DI; // Return value of DI
flags = _FLAGS; // Return the Flags
}
/* code in turboC 3.0 */
-------------------------------------------
then i tried it in assembly here is the assembly code
-------------------------------------
/* NASM. */
_new_int13:
push fs
push ax
push cs
pop fs
pop ax
pushf
call far [fs:word _old_int13]
pop fs
iret
-----------------------------------
this works in bochs and not on the actual system.
can anyone help me with this.
i think most of the viruses are written this way.... ;D
Thanks
INder.