Messing around with some older Borland compilers last night for fun I can see that something they did to invalidate an OBJ file for the build process was to set the date/time to 0. Using intspy I found this:
set_file_date_and_time(handle=0x0006,time=0x0000,date=0x0000)
This affects Turbo C 1.0, 1.5, 2.0, Turbo C++ 1.0, 3.0, and Borland C++ 2.0.
Finally in Borland C++ 3.1, it was fixed to this which is a valid date/time:
set_file_date_and_time(handle=0x0006,time=0x0001,date=0x0021)
This works fine in DOS, but NT 4.0's VDM rejects it and doesn't change the time of the OBJ. So then a build results in an up to date result and does not occur at all when requested.
Using IDA I found the section where this happens:
seg000:CA1B mov ax, 96FDh
seg000:CA1E push ax
seg000:CA1F xor ax, ax
seg000:CA21 push ax
seg000:CA22 push ax
seg000:CA23 call sub_11CE4
In this example I replaced CA1F with mov ah,0 which left it with a date/time of 00FD from the above CA1B instruction, which is valid, which works, but this was for Turbo C 2.0 and others I looked at didn't have the mov ax,96FD to count on above it. Ideally I would want to sex AX to something like mov ax,0021 but this takes 3 bytes and I only have 2 bytes in this spot. I'd like to find a patch technique that could work for different versions, so what other ideas are there?
set_file_date_and_time(handle=0x0006,time=0x0000,date=0x0000)
This affects Turbo C 1.0, 1.5, 2.0, Turbo C++ 1.0, 3.0, and Borland C++ 2.0.
Finally in Borland C++ 3.1, it was fixed to this which is a valid date/time:
set_file_date_and_time(handle=0x0006,time=0x0001,date=0x0021)
This works fine in DOS, but NT 4.0's VDM rejects it and doesn't change the time of the OBJ. So then a build results in an up to date result and does not occur at all when requested.
Using IDA I found the section where this happens:
seg000:CA1B mov ax, 96FDh
seg000:CA1E push ax
seg000:CA1F xor ax, ax
seg000:CA21 push ax
seg000:CA22 push ax
seg000:CA23 call sub_11CE4
In this example I replaced CA1F with mov ah,0 which left it with a date/time of 00FD from the above CA1B instruction, which is valid, which works, but this was for Turbo C 2.0 and others I looked at didn't have the mov ax,96FD to count on above it. Ideally I would want to sex AX to something like mov ax,0021 but this takes 3 bytes and I only have 2 bytes in this spot. I'd like to find a patch technique that could work for different versions, so what other ideas are there?