Does anyone know how to do this ? I can only find this page http://toshyp.atari.org/en/004013.html#CJar While I can access XBIOS from HISOFT BASIC, I am not sure if that function is supported, but could be I just don't know how to use it in the first place.
Even ASM code with explanation would help.. anyone ?
REMINDER - Stay logged in for at least 2 hours a week to get whitelisted.
Also it helps build a picture where our "good traffic" is coming from for detection scripts.
:o)
Also it helps build a picture where our "good traffic" is coming from for detection scripts.
:o)
Installing _FRB cookie ?
-
exxos
- Site Admin

- Posts: 28591
- Joined: 16 Aug 2017 23:19
- Location: UK
-
thorsten.otto
- Posts: 148
- Joined: 04 Nov 2019 02:20
Re: Installing _FRB cookie ?
Code: Select all
The function is available when the cookie 'CJar' ($434A6172) is present. This is created by JARxxx (Cookie Jar Manager) or by Liberty.And although that might installing the cookie easier, it does not help you in making the buffer that the cookie points to resident.
Basically, the procedure you need (in some pseudo/C-like code)
Code: Select all
int install_frb(void)
{
long *cookiejar;
long size;
void *buffer;
cookiejar = (long *)Setexc(0x5a0 / 4, (void *)-1); /* get cookiejar */
if (cookiejar == 0)
{
bailout(); /* no cookiejar; installing a new one not yet supported */
return FALSE;
}
size = 0;
while (*cookiejar != 0 && *cookiejar != 0x5f465242L) /* '_FRB' */
{
size++; /* count number of existing entries */
cookiejar += 2; /* get to next entry */
}
if (*cookiejar != 0)
{
/* _FRB already present; nothing to do */
return TRUE;
}
if (size + 2 > cookiejar[1]) /* check against cookie jar size */
{
/* no room in cookie jar */
bailout();
return FALSE;
}
buffer = Mxalloc(0, 0x10000L); /* allocate in ST-RAM only */
if (buffer == 0)
{
/* not enough memory */
return FALSE;
}
if (buffer == (void *)-32)
{
/* Mxalloc not supported */
return FALSE;
}
/* copy the old end cookie */
cookiejar[3] = cookiejar[1];
cookiejar[2] = cookiejar[0];
/* install our _FRB cookie */
cookiejar[0] = 0x5f465242L;
cookiejar[1] = (long)buffer;
/* terminate and stay resident */
Ptermres(256L, 0); /* we only need to keep the basepage */
}
Adding some error messages might also be a good idea.
I'm not entirely sure about memory protection, normally that buffer should only be accessed by the harddisk driver from supervisor mode, if in doubt you may have to add the appropiate flags to make it globally readable/writable. But that only matters for MiNT.
Who is online
Users browsing this forum: ClaudeBot and 1 guest