I am working on editing an old DOS program's assembly, but I'm running into some odd issues.
I'm using IDA Pro 6.4 and a hex editor to patch. I'm code-caving the new data by removing old stuff never used.
Just changing the assembly code does nothing, in the sense that it just exits, no errors or nothing. The code properly disassembles and looks right, but it doesn't do anything. The code is 100% right as I'm basing it off another application. There is no protection as I explain below, other changes work. However anything that involves "call" or variables other than what was originally used...don't work.
Here is an example of what I'm doing:
Code presently reads a ISA card for some data. I am making it fread a file instead.
The program is compiled using Watcom 9.5 and uses Causeway extender. It uses fastcall not stdcall.
I'm starting to pull my hair out because I need to rework the logic so it does some other stuff (write to file for example).
It's odd because simple changes to the logic work as I've made many other micro changes (jnz to jz for example).
Any advise? Is there something in the file I'm missing? If you need more info, let me know.
Here is an example of a change I've tried to make (this is the NEW code):
push ebx
push ecx
push edx
push esi
push edi
push ebp
mov ebp, esp
sub esp, 4
mov eax, offset pathname
push eax
call printf_
pop ebp
pop edi
pop esi
pop edx
pop ecx
pop ebx