Borland's DOS compilers rebuilt from their own binaries, byte for byte
Borland's DOS compilers, rebuilt from their own binaries
A project called borland-reborn recovers the source code of Borland C++ 2.0 from its published executables. All 22 binaries, including BCC.EXE, rebuild byte-identical with the original toolchain. The recovered C and assembly are then made readable with real names, named record fields, and comments. A modding build lets functions grow or shrink and is validated by 1,836 compiles compared against Borland's output.
The last command compiles all 298 sources in DOS, checks every function against the original byte for byte, verifies every relocation and name, and links a new BCC.EXE that is identical to Borland's.
- noahbp
This is going to be very helpful for any project to decompile binaries that were compiled with these compilers.
I'm working on something similar though shot of a full decompilation for Microsoft Visual C++, to trace and report the knobs to tune in the internal register allocation algorithm (among other things) to make reversing and decompiling binaries that were compiled with MSVC a much easier task: https://github.com/NoahBPeterson/c2scope
- humblefly
Sincere question: why? Source like this is a notch better than raw decompiler output in the pre-AI era, but what's the expectation / use case?
if((ES_B(_BX,MEMB_FLAGS)&3)==3) {
_DI=ES_W(_BX,MEMB_VALUE);
_ES=SYMBOL_POOL_SEG;ES_W(0,SYM_TYPE)=base;
if(ES_W(_DI,SYM_FUNC_KIND)==2) {
while(!TYPES_COMPATIBLE(TYPE_W(SYM_W(_DI,SYM_TYPE),TYPE_TARGET),TYPE_W(base,TYPE_TARGET),0)) _DI=SYM_W(_DI,SYM_NEXT_OVERLOAD);
} else {
while(!SAME_SIGNATURE(SYM_W(_DI,SYM_TYPE),base)) _DI=SYM_W(_DI,SYM_NEXT_OVERLOAD);
}
if(_DI==0) {_DI=_DI;goto next_param;}
I grant you that it's a thing you can do with agents, and it's impressive that it works, but once the tokens are spent, what does anyone get out of it? I guess I wonder if AI projects are becoming a bit of a "social proof of money spent".
- codazoda
I've been building a web based editor inspired by the Borland Turbo Pascal/Basic editors. It uses an optional GitHub token to save files directly to your repo. You can try it here:
- lp4v4n
Can anyone who knows the mainframe domain explain why legacy COBOL applications are not being aggressively ported to modern java applications? It sounds like an obvious usage of AI to solve a real world problem and yet I barely hear about it.
- Waraqa
To clarify, 'rebuilt' in the title means reverse-engineered and reconstructed by AI.