I start by saying that I'm completely new to the topic of reversing although I have many years of experience with programming in general.
I've some problems with automatic recognition of library functions of a DOS executable compiled with Borland C++ 3.1.
Actually the signatures are correctly identified as bc31rtd (and it states 199 as the actual number of applied signatures). So for example strcmp
is correctly identified, colored and such.
Starting from this I was relying blindly on these library function in the rest of the code until I realized that there was something wrong, this is, for example what I see in for strcpy
:
Which doesn't make sense to me since src
is not used at all. Then
repne scasb
should scan for the length of the string but the last value placed in di
is [bp+dest+2]
like if both const char*
were not dd
but dw
(so just the offset, without any specified segment, and ds
is used implicitly).
Since this was getting me crazy I checked the original implementation of the function by opening CC.LIB of BC++3.1 with IDA Pro directly and implementation is different indeed:
So where's the problem here?
How can I alter the function as I want? I tried modifying directly stack variables (Ctrl+K) but then offsets become faulty (eg [bp+8]
marked as red).
I ask sorry if I'm making some trivial wrong assumption that I'm not realizing.