Wow that 'ImportSymbolsScript' helped. I 'turned down' that mapfile from
... Address Publics by Value 0001:0000 byte_0 0001:001A start 0001:00D1 __nomain 0001:00D8 _fclose 0001:01DA __fsopen ...
into:
0001:0000 byte_0 0001:001A start 0001:00D1 __nomain 0001:00D8 _fclose 0001:01DA __fsopen 0001:0214 _fopen 0001:0234 __close ...
... and modded ImportSymbolsScript.py in GHIDRA 'basic editor' like this:
# Imports a file with lines in the form "0xSEGMENT:0xADDRESS symbolName" # @category Data # @author f = "c:\Tools\!Temp\Portable_VB6\Vs6sp6B\setupsp6.map.txt" # f.askFile("Give me a file to open", "Go baby go!") # for line in file(f.absolutePath): # note, cannot use open(), since that is in GhidraScript for line in file(f): # note, cannot use open(), since that is in GhidraScript pieces = line.split() (segm,offset) = pieces[0].split(":") segm = "1000" # dirty hack !!! address = toAddr(long(segm + offset, 16)) print "creating symbol", pieces[1], "at address", address createLabel( address, pieces[1], False )
Basically changes are:
- Changed the input order for pieces[]
- Added support for segment offset
- Hard coded file path for better workflow when modding/debugging the script (f = ...)
- Added that
"1000" + part into toAddr() to simulate the need segment offset "1000:..."
Well it worked !!!
:)
BEFORE running the script:

AFTER:
