mirror of
https://github.com/decompals/wibo.git
synced 2025-10-16 07:05:11 +00:00
Update README.md
This commit is contained in:
parent
166399f143
commit
f4cd59b4e0
13
AGENTS.md
13
AGENTS.md
@ -1,9 +1,8 @@
|
|||||||
# Repository Guidelines
|
# Repository Guidelines
|
||||||
|
|
||||||
## Project Structure & Module Organization
|
## 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.
|
- Core loader logic and headers live in `src/`.
|
||||||
- Windows API shims reside in `dll/`, grouped by emulated DLL name; keep new APIs in the matching file instead of creating ad-hoc helpers.
|
- Windows API shims reside in `dll/`; source files grouped by DLL (e.g. `dll/kernel32/`).
|
||||||
- Reusable utilities sit in `strutil.*`, `processes.*` and `resources.*`; prefer extending these before introducing new singleton modules.
|
|
||||||
- Sample fixtures for exercising the loader live in `test/`.
|
- Sample fixtures for exercising the loader live in `test/`.
|
||||||
|
|
||||||
## Build, Test, and Development Commands
|
## 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.
|
- `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
|
## Coding Style & Naming Conventions
|
||||||
- Formatting follows `.clang-format` (LLVM base, tabbed indentation width 4, 120 column limit); never hand-wrap differently.
|
- 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, and g_camelCase for globals.
|
- 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.
|
- 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.
|
- 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.
|
- 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.
|
- Update `CMakeLists.txt` to add new fixture sources.
|
||||||
- Rebuild, then run tests with `ctest --test-dir build --output-on-failure`.
|
- 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
|
## Debugging Workflow
|
||||||
- Reproduce crashes under `gdb` (or `lldb`) with `-q -batch` to capture backtraces, register state, and the faulting instruction without interactive prompts.
|
- 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/`.
|
- 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.
|
- 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.
|
||||||
|
25
README.md
25
README.md
@ -1,14 +1,12 @@
|
|||||||
# wibo
|
# 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.
|
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.
|
||||||
|
|
||||||
Don't run this on any untrusted executables, I implore you. (Or probably just don't run it at all... :p)
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_TESTING=ON
|
||||||
cmake --build build --target wibo
|
cmake --build build
|
||||||
```
|
```
|
||||||
|
|
||||||
Set `-DCMAKE_BUILD_TYPE=Release` to produce an optimized binary instead.
|
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`).
|
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
|
```sh
|
||||||
cmake -B build -DBUILD_TESTING=ON
|
|
||||||
cmake --build build
|
|
||||||
ctest --test-dir build --output-on-failure
|
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:
|
See also:
|
||||||
|
* [taviso/loadlibrary](https://github.com/taviso/loadlibrary) - Initial inspiration for this project.
|
||||||
- Implement more APIs
|
* [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.
|
||||||
---
|
|
||||||
|
|
||||||
Related projects:
|
|
||||||
* [taviso/loadlibrary](https://github.com/taviso/loadlibrary)
|
|
||||||
* [evmar/retrowin32](https://github.com/evmar/retrowin32)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user