[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-114025":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":14,"forks30d":14,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":9,"pushedAt":38,"updatedAt":39,"readmeContent":40,"aiSummary":41,"trendingCount":14,"starSnapshotCount":14,"syncStatus":42,"lastSyncTime":43,"discoverSource":44},114025,"borland-reborn","abedegno\u002Fborland-reborn","abedegno","Borland's DOS compilers, recovered as source that rebuilds the original binaries byte for byte. First up: Borland C++ 2.0's BCC.EXE.",null,"Assembly",241,26,8,0,1,25,128,6,68.79,"Other",false,"main",true,[25,26,27,28,29,30,31,32,33,34,35,36,37],"borland","borland-cpp","compiler","decompilation","dos","matching-decompilation","ms-dos","retrocomputing","reverse-engineering","software-preservation","tasm","turbo-c","x86-16","2026-11-20 18:50:06","2026-11-23 08:01:50","# borland-reborn\n\n**Borland's DOS compilers, rebuilt from their own binaries.**\n\nThis repository recovers the source code of classic Borland compilers from the published\nexecutables, so that the recovered C and assembly rebuild each executable **byte for byte**\nwith the original Borland toolchain. Then it makes that source readable: real names, named\nrecord fields, comments on every file, and notes on what the compiler does and where it goes\nwrong.\n\n| Directory | Program | Status |\n|---|---|---|\n| [`bcc20\u002F`](bcc20\u002F) | **Borland C++ 2.0** (1991), `BCC.EXE`, the command-line compiler | Complete: rebuilds byte-identical (SHA-256 `dd5744b9...`) |\n| [`cpp20\u002F`](cpp20\u002F) | **Borland C++ 2.0** (1991), `CPP.EXE`, the standalone preprocessor | Complete: rebuilds byte-identical (SHA-256 `39879c60...`) |\n| [`bcc20-port\u002F`](bcc20-port\u002F) | `BCC.EXE` as a native compiler and library, for decompiling Borland-built games | Complete: every function checked against BCC.EXE; 1874 of 1880 corpus compiles identical; native binaries and a library |\n\nMore Borland and Turbo versions will join as further top-level directories, sharing the\n[`scripts\u002F`](scripts\u002F) and the [Exhume](https:\u002F\u002Fgithub.com\u002Fabedegno\u002FExhume) build tools.\n\n## Borland C++ 2.0 at a glance\n\n- **298 sources** in 15 subsystem directories: 265 C files (Borland C++ 2.0 and Turbo C 2.01)\n  and 33 hand-written TASM modules. The original's own split into compiled C and hand-written\n  assembly is kept: assembly was never forced into C, and compiled code was never left as\n  assembly.\n- **Every name is recovered or descriptive**: about 3,100 functions, globals and labels, 300\n  record fields (`src\u002Finclude\u002FFIELDS.H`), 40 record layouts (`src\u002Finclude\u002FRECORDS.H`),\n  message, token, type-kind and operator constants.\n- **Every file is documented**: a role line, an overview and function comments\n  (about 10,000 lines of comments), with [a source map](bcc20\u002Fdocs\u002FSOURCE-MAP.md) and\n  [how the compiler is organised](bcc20\u002Fdocs\u002FSUBSYSTEMS.md).\n- **Findings**: likely bugs in the original, duplicated code, dead code, and how Borland's\n  compiler worked inside: [bcc20\u002Fdocs\u002FFINDINGS.md](bcc20\u002Fdocs\u002FFINDINGS.md). Some highlights:\n  the parser is hand-written recursive descent with an operator-precedence expression parser\n  (no yacc); the code generator's tail merging shaped how the original source had to be\n  written; `strrchr` reads one byte before an empty string; freed precompiled-header file\n  space is never reused.\n\n## Rebuild it yourself\n\nYou need the original Borland programs (not included: see [NOTICE.md](NOTICE.md)). The full\nguide is [docs\u002FSETUP.md](docs\u002FSETUP.md); in short:\n\n```sh\ngit clone --recurse-submodules https:\u002F\u002Fgithub.com\u002Fabedegno\u002Fborland-reborn\ncd borland-reborn\n# 1. download Borland C++ 2.0 and Turbo C 2.01 from WinWorld (links in docs\u002FSETUP.md)\npython3 scripts\u002Fsetup-toolchains.py --bc20 \"Borland CPP 2.0 (1991) (3.5-720k).7z\" --tc201 \"\u003CTurbo C 2.01>.7z\"\n# 2. Python packages and the DOS emulator (dosbox-x), node\npython3 -m venv .venv && .venv\u002Fbin\u002Fpip install -r exhume\u002Ftools\u002Frequirements.txt\n# 3. generate the link inputs from your own BCC.EXE, then compile, verify and link everything\ncd bcc20\n..\u002F.venv\u002Fbin\u002Fpython scripts\u002Fprepare.py\n..\u002F.venv\u002Fbin\u002Fpython ..\u002Fexhume\u002Ftools\u002Fgate.py check --all\n```\n\nThe last command compiles all 298 sources in DOS, checks every function against the\noriginal byte for byte, verifies every relocation and name, and links a new `BCC.EXE` that is\nidentical to Borland's.\n\nTo change the compiler, use the **modding build**. It links the same sources with a layout\nTLINK chooses, so any function may grow or shrink, new data may go between any two data\nitems, and new source files may be added. It is checked by running 1836 compiles with both\ncompilers (Borland's own example programs and old GCC and cfront tests among them) and comparing every output, with the code and the data moved in several ways and\nwith new and edited files. A tracing emulator shows which words of the data the compiler\nuses as addresses, and which of its code the tests run: 83%\n([bcc20\u002Fdocs\u002FCOVERAGE.md](bcc20\u002Fdocs\u002FCOVERAGE.md)). See [bcc20\u002Fdocs\u002FMODDING.md](bcc20\u002Fdocs\u002FMODDING.md).\n\n## How it works\n\n[docs\u002FHOW-IT-WORKS.md](docs\u002FHOW-IT-WORKS.md) explains the method: identifying the exact\ncompiler and switches, matching each function, verifying what matching cannot see, linking\nthe whole program with TLINK, and the readability pass that followed, all checked by the\nsame byte-for-byte gate.\n\n## Contributing, licence and notice\n\nCorrections to names, comments and findings are welcome: see [CONTRIBUTING.md](CONTRIBUTING.md).\nThe project's own scripts and documentation are MIT-licensed ([LICENSE](LICENSE)). The\nrecovered sources are derived from Borland's copyrighted programs and are provided for study\nand preservation, with no rights claimed: read [NOTICE.md](NOTICE.md).\n","这是一个对经典 Borland DOS 编译器（如 Borland C++ 2.0 的 BCC.EXE）进行逆向工程与源码重建的项目，目标是通过反编译和人工校验，恢复出能逐字节复现原始二进制文件的可读、可构建源代码。项目结合静态分析、匹配式反编译（matching decompilation）与原始工具链（TASM、Turbo C）验证，完整重构了编译器的 C 源码、汇编模块、数据结构及注释体系，并标注了内部机制、潜在缺陷与设计约束。适用于软件保存、复古计算研究、编译器教学、DOS 应用逆向与老游戏兼容性分析等场景。",2,"2026-11-24 04:47:44","CREATED_QUERY"]