Skip to content

DOSBox & OllyDbg

Yo dawg I heard you like debuggers so we put debugger into..

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

  • User avatar
  • tails_ Offline
  • Posts: 170
  • Joined: 2012-03-18, 16:59:23
  • Location: Tomsk, Russia
  • Contact:

DOSBox & OllyDbg

Post by tails_ »

Apparently someone might put this to better use than me:

I haven't found any convenient way to look at VM memory in DOSBox but after some time I accidentally noticed that OllyDbg can display debugged process memory in realtime and even highlight values if they differ from these from backup. Here are a few use cases for that:

On screenshot: sequencer variables from DOS game Oscar, refreshed with 50ms period.

Image

On screenshot: YMF262 registers, there are 2 such structures in DOSBox:
1. Registers from emulated SoundBlaster card
2. Buffer used for DRO writing
Changing values in first one directly impacts sound unlike second one, you can fill second structure with let's say FF's or 00's to see what is overwritten on key-on event and such.

Image

Now let me describe a methods of finding these areas, but first it's better to change a few options in OllyDbg, Autoupdate interval and "Snow-free drawing":

Image

1. Virtual Machine RAM

Easy one, you just need to know how much memory is allocated for virtual machine in bytes and add 0x1000 to it, e.g. you set it 32MiB, then you should look for block of 2001000 size:

Image

Actual RAM goes form 20h and on screenshot you can see interrupt vector table :P

Image

2. OPL2/3 registers

To find first buffer look for sequence 46 4D 00 in process dump (or use HxD, it can search in process memory on the fly) there will be a few occurrences, you will need first one outside mapped DOSBox execuable. e.g. not something like this:

Image

But like this (note SB at 05A5FBB1h):

Image

Now if you enabled auto update and something is playing in DOSBox you should see numbers changing rhythmically :P

To find other 2 structures just copy a block of data from chip registers and try to search them like above:

Image
  • User avatar
  • MaliceX Offline
  • Posts: 226
  • Joined: 2012-09-29, 11:45:48
  • Location: Australia
  • Contact:

Post by MaliceX »

QFFW (quoted for f***ing win...ok more like BUMP)

Using the steps to access the DOSBox VM Memory allocation block has helped me in extracting the uncompressed .RIX music data for iModaozi. Many thanks for sharing!
-dj.tuBIG/MaliceX
Post Reply