mirror of
https://github.com/decompals/wibo.git
synced 2025-12-12 06:45:05 +00:00
c4de05946d1a38b7fd93a93b08dcbbe187630d55
TlsGetValue & more (#48)
`TlsGetValue` disambiguates 0 and an error by relying on `GetLastError`. Depending on the program state, `GetLastError` could be non-0, even though `TlsGetValue` succeeded. Resolve this by always setting `wibo::lastError`. This matches the behavior described by the documentation. Additionally, when reading resources, later versions of mwcc and mwld call `GetModuleHandleA` with the program path, and then call `LoadStringA` on that handle. Support this behavior by _actually_ loading the PE at the path passed in to `GetModuleHandleA`, instead of assuming it's the current program. (This is especially useful because sjiswrap relies on overriding `GetModuleFileNameA`, so the wrapped program reads its own resources, rather than sjiswrap's.) Other small changes: - Add ms-win-crt `exit` & run atexit funcs - Implements vcruntime `memmove` - Implements kernel32 `GetModuleFileNameA`
wibo
A minimal, low-fuss wrapper that can run really simple command-line 32-bit Windows binaries on Linux - with less faff and less dependencies than WINE.
Don't run this on any untrusted executables, I implore you. (Or probably just don't run it at all... :p)
cmake -B build
cmake --build build
build/wibo
Rough to-do list:
- Implement more APIs
- Do something intelligent with Windows
HANDLEs - Convert paths in environment variables (and the structure of
PATHitself, maybe) to Windows format - Implement PE relocations rather than just failing unceremoniously
- Make the PE loader work for DLLs as well in case we ever want to load some
Related projects:
Languages
C++
73.3%
C
17.9%
Python
4.7%
CMake
2.8%
Assembly
1.1%
Other
0.2%