Repository for Reverse Engineering work on UW1/2
UW.idb and UW2.idb are IDA Pro 5 (Free) decompilation database files of UW.exe and UW2.exe with some code identified.
See ida.asm for a text version of the disassembly.
The game mechanics are being documented in Guide to the Ultima Underworlds.md
.
Segments are named using the following convention(s):
- Code segments
segXXX_nnnn
, whereXXX
is the original segment number of the code andnnnn
is the offset Dosbox debugger loads the data at. - Overlay segments, labeled
ovrXXXX
are dynamically loaded to different offsets at runtime are not renamed. The only way of breaking into these overlays is by either breaking in a normal segment, or set a breakpoint to a memory address this overlay segment is modifying. - Data segments are labeled
XXXX_dseg_nnn
, whereXXXX
is a description andnnn
is the offset of the data in that specific data segment. Using this config, Dosbox typically loads the main data segment at base address67d6h
.
For example, if you want to set a breakpoint to seg040_352B_1AC6
, you have to use the command bp 352B:1AC6
. Use Dosbox 0.74-3-debug with this config file for reproducible offsets.
Sometimes, when stepping into a function, the code will switch to INT21, which you should not step over, but into and until it returns to the function.
Key variables to look at when researching the file:
CurrObj_dseg_2256
is the currently processed game object.PlayerObject_dseg_828E
is the player object.
IDA Pro 5 can have problems rendering fonts, making the program nigh unusable. Changing the font in the settings can fix this issue.