Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!sdd.hp.com!think!snorkelwacker!ira.uka.de!smurf!gopnbg!tmpmbx!netmbx!askrid From: askrid@netmbx.UUCP (Dirk Ahrens) Newsgroups: comp.sys.atari.st Subject: Re: XBRA from C Summary: It works from C directly Keywords: XBRA TurboC Message-ID: <692@netmbx.UUCP> Date: 25 May 90 11:15:31 GMT References: <759@imada.dk> Reply-To: askrid@netmbx.UUCP (Dirk Ahrens) Organization: netmbx, Berlin, West Germany Lines: 47 In article <759@imada.dk> micro@imada.dk (Claus Pedersen) writes: > I have just started to use the XBRA protocol to intercept system >vectors. I want this standard to spread in order to keep my programs >running [-keep it selfish else they don't believe you ;-)]. > Ok, I know that there are problems with the XBRA protocol - It's >for assembly programmers only... [ description of the library package deleted ] >There are 4 entry points: > XB_isinstal(), XB_install(), XB_remove(), XB_kill(). How do you remove and kill when you already have done a Ptermres? > There is one minor short coming - the pack is for Borland TC only, >but you are free to modify the source to run with your favourite C >compiler. > - Klaus (micro@imada.dk). if you want a version which doesn't depend on a specific Compiler, and you don't like Assembler (like me) try following definition. typedef struct { char xb_magic[4]; char xb_id[4]; void *xb_vec; short xb_jmpCode; /* has to be 16-Bit. contents: 0x4EF9 */ void (*xb_newVec)(); } XBRA; XBRA xBra = { 'X','B','R','A', '_','i','d','_', 0L, 0x4EF9, /* Code for jmp */ NewFunktionName }; Now you have to do only two things: Put the old Contents in xb_vec, and write the adress of xb_jmpCode in the System-adress. Everything in Super- visor mode of course. I wrote my own library for install. I remove with an external tool. This results in very small installing code, which is important for me for resident tools. Dirk Ahrens -- Askrid netmbx, Jabba the Hutt. askrid@netmbx.UUCP dirk@opal.cs.tu-berlin.de AHRENS@TUBVM.CS.TU-BERLIN.DE Dirk Ahrens - Danckelmannstr 46 - 1000 Berlin 19 - Federal Republic of Germs