VOGONS


First post, by llm

User metadata
Rank Member
Rank
Member

hi,

i just started to use the dosbox debugger for reverse engeneering
i've extended the logging code a little bit that im easily be able to follow
file and memory operations

in my log i get the information like
DOS_AllocateMemory( segment: 128, blocks: 14446 )
DOS_ReadFile( name: STUNTS11\AD15.DRV, amount: 3571 )
etc.

now i want to know:
1. what is the content behind the allocated memory (segment 128)
i try to use memdumpbin but i always get not the estimated result

2. in which allocated memory block or area reads the ReadFile function

is there any way to get the information in the dosbox debugger or do
i need to extend its features?

you can see an full log of the stunts startup process on
http://forum.stunts.hu/index.php?topic=2303.0

thx

Reply 1 of 4, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

DOS_AllocateMemory( segment: 128, blocks: 14446 )

Hope your logging is correct. The first parameter of that function is to
return the segment (128 decimal in your case i assume) so in the dosbox
debugger d 80:0 shows the allocated memory (not much there i guess)
and d 7f:0 is the MCB of that memory.

DOS_ReadFile( name: STUNTS11\AD15.DRV, amount: 3571 )

readfile has three parameters, the second being the temp buffer. That is
usually copied into the emulated memory within the callback, see dos.cpp

Reply 2 of 4, by llm

User metadata
Rank Member
Rank
Member

that is my logging code

LOG(LOG_MISC,LOG_NORMAL)("DOS_AllocateMemory( segment: %X, blocks: %d = %d bytes )", *segment, *blocks, (*blocks)*16 );

and

LOG(LOG_FILES,LOG_NORMAL)("DOS_ReadFile( name: %s, amount: %i )", Files[handle]->name, *amount );

Bit8u * data is missing here
...

and memdumpbin works the same

Reply 3 of 4, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Well the trick might be WHERE you put those. At the start of the functions is surely wrong.

Bit8u * data is missing here

Indeed. But as i said this is only a temp buffer, so of no immediate use.