From f4cd59b4e0320027df8d12497daa8cd15260e953 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Sat, 4 Oct 2025 13:55:08 -0600 Subject: [PATCH] Update README.md --- AGENTS.md | 13 ++++++------- README.md | 25 +++++++------------------ 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index fe4b889..10962ab 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,9 +1,8 @@ # Repository Guidelines ## Project Structure & Module Organization -- Core launcher logic lives in `main.cpp`, `loader.cpp`, `files.cpp`, `handles.cpp` and `module_registry.cpp`; shared interfaces in headers near them. -- Windows API shims reside in `dll/`, grouped by emulated DLL name; keep new APIs in the matching file instead of creating ad-hoc helpers. -- Reusable utilities sit in `strutil.*`, `processes.*` and `resources.*`; prefer extending these before introducing new singleton modules. +- Core loader logic and headers live in `src/`. +- Windows API shims reside in `dll/`; source files grouped by DLL (e.g. `dll/kernel32/`). - Sample fixtures for exercising the loader live in `test/`. ## Build, Test, and Development Commands @@ -14,8 +13,8 @@ - `clang-format -i path/to/file.cpp` and `clang-tidy path/to/file.cpp -p build` keep contributions aligned with the repo's tooling. ## Coding Style & Naming Conventions -- Formatting follows `.clang-format` (LLVM base, tabbed indentation width 4, 120 column limit); never hand-wrap differently. -- Use PascalCase for Win32 entry points, camelCase for internal helpers, SCREAMING_SNAKE_CASE for Win32 constants, kCamelCase for internal constants, and g_camelCase for globals. +- Formatting follows `.clang-format` (LLVM base, tabbed indentation width 4, 120 column limit). +- Use PascalCase for Win32 entry points, camelCase for internal helpers, SCREAMING_SNAKE_CASE for Win32 constants, kCamelCase for internal constants, g_camelCase for globals, and mPascalCase for member variables. - Put static functions and variables in anonymous namespaces at the top of the file. - Prefer scoping types to the header or source file that uses them; avoid polluting `common.h` unless widely shared. @@ -31,10 +30,10 @@ - All fixtures must self-assert; use `test_assert.h` helpers so `ctest` fails on mismatched WinAPI behaviour. - Update `CMakeLists.txt` to add new fixture sources. - Rebuild, then run tests with `ctest --test-dir build --output-on-failure`. -- ALWAYS run tests against `wine` manually to confirm expected behaviour. If `wine` fails, the expected behaviour is likely wrong. (`wine` is not perfect, but we can assume it's closer to Windows than we are.) +- ALWAYS run tests against `wine` manually to confirm expected behaviour. If `wine` fails, the expected behaviour is VERY LIKELY wrong. (`wine` is not perfect, but we can assume it's closer to Windows than we are.) ## Debugging Workflow - Reproduce crashes under `gdb` (or `lldb`) with `-q -batch` to capture backtraces, register state, and the faulting instruction without interactive prompts. -- Enable `WIBO_DEBUG=1` and output to a log (i.e. `&>/tmp/wibo.log`) when running the guest binary; loader traces often pinpoint missing imports, resource lookups, or API shims that misbehave. The answer is usually in the last few dozen lines before the crash. +- Enable `WIBO_DEBUG=1` or `-D` and output to a log (i.e. `&>/tmp/wibo.log`) when running the guest binary; loader traces often pinpoint missing imports, resource lookups, or API shims that misbehave. The answer is usually in the last few dozen lines before the crash. - Inspect relevant source right away—most issues stem from stubbed shims in `dll/`. - Missing stubs generally do _not_ cause a crash; we return valid function pointers for unknown imports. Only when the missing stub is _called_ do we abort with a message. Therefore, don't preemptively add stubs for every missing import; wait until the binary actually calls it. diff --git a/README.md b/README.md index 7fa5d71..3592004 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ # wibo -A minimal, low-fuss wrapper that can run really simple command-line 32-bit Windows binaries on Linux - with less faff and fewer dependencies than WINE. - -Don't run this on any untrusted executables, I implore you. (Or probably just don't run it at all... :p) +A minimal, low-fuss wrapper that can run simple command-line 32-bit Windows binaries on 32-bit Linux - developed to run Windows compilers faster than Wine. ## Building ```sh -cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -cmake --build build --target wibo +cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_TESTING=ON +cmake --build build ``` Set `-DCMAKE_BUILD_TYPE=Release` to produce an optimized binary instead. @@ -31,11 +29,7 @@ Supported command line options: Self-checking Windows fixtures run through CTest. They require a 32-bit MinGW cross toolchain (`i686-w64-mingw32-gcc` and `i686-w64-mingw32-windres`). -With the toolchain installed: - ```sh -cmake -B build -DBUILD_TESTING=ON -cmake --build build ctest --test-dir build --output-on-failure ``` @@ -43,12 +37,7 @@ This will cross-compile the fixture executables, run them through `wibo`, and fa --- -Rough to-do list: - -- Implement more APIs - ---- - -Related projects: -* [taviso/loadlibrary](https://github.com/taviso/loadlibrary) -* [evmar/retrowin32](https://github.com/evmar/retrowin32) +See also: +* [taviso/loadlibrary](https://github.com/taviso/loadlibrary) - Initial inspiration for this project. +* [evmar/retrowin32](https://github.com/evmar/retrowin32) - A similar project with different goals and architecture. +* [decomp.me](https://decomp.me) - Collaborative decompilation website; uses wibo to run Windows compilers.