Kurz: Dieses Projekt verbindet 16-Bit DOS-Code und 64-Bit Windows (PE32+) Code in einem einzigen ausführbaren Image. Ziel ist eine flat EXE, die ohne traditionellen Linker erzeugt wird. Die ausführbare Datei startet unter DOS (z. B. DOSBox) den 16-Bit-Teil und unter Windows den 64-Bit-PE-Teil.
winhdr.inc— manueller PE32+ Header, Optional Header und Section Table (dynamisch berechnet).precalc.asm— Makros / Berechnungen (SIZEOF_HEADERS, SIZEOF_IMAGE usw.).code64.asm— Win64 Entry / Windows-Code (GUI / minimal).code16.asm— DOS 16-Bit Stub (Interrupt-Services, DOS exit).start.asm— Zusammenführung / Layout / Dispatcher.packed.zip— (optional) Beispiel Build / Test-Artefakt.
-
PE Header Konsistenz
SizeOfHeadersim Optional Header muss mit dem realen, gepaddeten Header („file-padded to FILEALIGN“) übereinstimmen.- Fix:
dd SIZEOF_HEADERSundtimes (SIZEOF_HEADERS - ($ - $$)) db 0.
-
SizeOfImage korrekt berechnen
SizeOfImage = ALIGN_UP(max(Section.VirtualAddress + Section.VirtualSize), SectionAlignment).
-
Win64 ABI / Stack-Alignment
- Beim Windows-Entry gilt:
RSP ≡ 8 (mod 16)beim Eintritt. Vor jedemcallmuss jedochRSP ≡ 0 (mod 16)sein und 32 Byte „shadow space“ müssen bereitstehen. - Fix im Prolog:
sub rsp, 40(32B shadow + 8B alignment correction). Dannmov ecx, <exitcode>undjmp qword [rel IAT_win32_ExitProcess](Tail-call, da ExitProcess nicht zurückkehrt).
- Beim Windows-Entry gilt:
-
EntryPoint-Ausrichtung vs. tatsächlicher Startcode
- Ein häufiger Fehler:
AddressOfEntryPointzeigt nicht exakt auf das Label, das den Win64-Prolog enthält (stattdessen z. B. 3 Byte früher). Folge: Loader startet beiret/NOP → Crash. - Fix: Entry auf genau die erste Prolog-Instruktion setzen oder
.textso anordnen, dass das erste Byte der Section der Prolog ist. Alternativ: 5-Bytejmpan den realen Einstieg setzen.
- Ein häufiger Fehler:
-
IAT / Import Table
- RIP-relative
call qword [rel IAT_ExitProcess]muss auf einen gültigen QWORD zeigen, der vom Loader zur Laufzeit mit der Adresse der API gefüllt wird. - Debug:
dq <IATaddr>prüfen und disassemblen (u poi(IATaddr)in WinDbg).
- RIP-relative
Die Projekt-Buildschritte hängen von deinem Make/Build-Script ab. Grundsätzlich:
- Säubere altartefakte.
nasmdeine .asm-Dateien (so, wie dein Layout es erfordert).- Resultat ist ein einzelnes EXE-Image (
dos.exe).
Hinweis: In diesem Projekt wird bewusst kein linkerischer PE-Linker verwendet — die Sections, Header und IAT werden manuell in Assembler erzeugt.
- SHA256 prüfen:
certutil -hashfile dos.exe SHA256 - Header prüfen:
dumpbin /headers dos.exe(AddressOfEntryPoint, SizeOfHeaders, SizeOfImage, DataDirectories). - Imports prüfen:
dumpbin /imports dos.exe
File → Open→dos.exe- Break am EntryPoint (x64dbg hält idR automatisch).
- Disasm:
sub rsp, 28h / mov ecx, 2 / jmp qword [rel ...] - Rechtsklick auf
jmp→Follow in Dump→dq→ QWORD sollte aufkernel32/ntdllzeigen. - Wenn
dq== 0 → IAT nicht gepatcht → prüfe.idata-Directory-/Section-RVAs.
bp @$exentry;gu rip L3;rr @$t0 = rip + <offset nach instr>;dq @$t0 L1lm; check module ranges
SizeOfHeaders!= tatsächliche Header-Padding → Loader patcht IAT/Sections falsch → Crash.- EntryPoint zeigt nicht exakt auf Prolog → RET/NOP am Anfang → Crash.
- Stack-Alignment nicht berücksichtigt →
0xC0000005bei WinAPI-Aufrufen. - IAT-RVA/Size falsch gesetzt → Loader füllt IAT nicht.
- ASLR/Relocs (wenn Du reloc-stripped baust, wähle ein geeignetes
ImageBase).
- Dieses Projekt enthält gemischten Code (16-Bit / 64-Bit). Wenn du den Code in ein öffentliches Repo hochlädst, entferne evtl. lokale Pfade, private Keys oder persönliche Daten aus Headers.
Update on: 2025-10-05 11:15 pm
Working pre-alpha Release Code available under: [Playground](https://kallup.net/myapp/packed.zip).
Tested with Python 3.13 under Windows 11 64-Bit Pro.
**0.** - download and depack zip archive
**1.** - start -> setup.bat
**2.** - navigate to .\src (**cd src**)
**3-** - start -> start.bat
Some stuff for "HelpNDoc" the Help authoring Software for CHM, HTML, PDF, ... help projects. To download the Windows 10 64-Bit Professional based Application, you can visit:
[Application](https://kallup.net/woops/)
Now, I working on a Setup Script to install the Python Application and the used Modules, used in this Reprository Applicationö. Only Windows 10/11 64 Bit is supported.
Here are some out dated screen shoot on running the application: For the Commodore C-64 TrueType Font, visit: C64Font
Programmers Desktop - Windows 10 Pro Multi-Monitor:

Preview Úbuntu Linux - Hyper-V under Windows:

Preview Úbuntu Linux - Hyper-V under Windows:

Preview Locales-Projekt-Window A70:

Preview Locales-Projekt-Window A712:

Preview Locales-Projekt-Window A71:






















