4

I have an old DOS program compiled using Borland C++ (1991 version)

The end of the executable contains many strings preceded by an underscore which looks like debug/symbol information :

eg: _HandleMemory, _AddKey, _SetPalette, ...

Most of these strings seems to be functions or variables names.

However once the exe is opened in IDA, that information is not used, most functions are simply named this way (except some known C functions like _qsort) :

sub_XXXXX

Is there a way to import that info back to IDA ?

8
  • Are you sure it's not actually a list of DLL imported symbols?
    – Jongware
    Commented Dec 31, 2015 at 1:17
  • By DLL, do you mean an external library ? (since AFAIK, DLL are windows only). I don't think so because these strings are referenced in any other of the program files.
    – tigrou
    Commented Dec 31, 2015 at 12:03
  • DLL is a Windows term, but Microsoft did not invent importing libraries from scratch. I assume you mean "not referenced" elsewhere. But: Just a list of symbols is practically useless. Are there any references to it inside the same executable? Can you upload this file and provide a link to it, so others can check?
    – Jongware
    Commented Dec 31, 2015 at 12:07
  • 1
    Yes you are right, I mean "not referenced". The program in question is a game (Alone in the Dark 1). It is freely downloadable on many abandonware sites, but i am not sure if it's OK to put a link to the executable here ?
    – tigrou
    Commented Dec 31, 2015 at 13:27
  • The year 1991 pegs this as Turbo C++ 1.0 or thereabouts, and it is indeed very likely that the tail data in question is Borland-style debug info (16-bit TDS format). Experiments show that the available IDA freewares - 3.7 through 5.0 - do not recognise the 16-bit Borland debug info. If the debug info is stripped into a separate TDS file (via tdstrip.exe) then you get a rejection message in the output window for those versions that can deal with TDS in principle but expect the newer 32-bit format (as of BOA 4.0 and beyond). Same for the 'Load TDS' menu item, if present.
    – DarthGizka
    Commented Dec 31, 2015 at 17:29

2 Answers 2

4

In case anyone has same question, here is how I solved it :

1) I exported all debug symbol information to a text file, using TDUMP.

TDUMP somefile.exe > 1.txt

2) I cleaned the txt file to keep only useful information :

[Function name] + [Address]

3) I imported the file back to IDA using a python script : see here

0

I've written an IDAPython script which parses the debug information and then performs the corresponding renamings, all from within IDA.

The script, along with simple usage instructions, are available on GitHub.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.