Quick-and-dirty wrapper that tries to run 32-bit Windows command-line executables on Linux
Go to file
Luke Street c4de05946d
Fix `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`
2023-10-01 23:56:35 -04:00
.github/workflows Use correct token for docker deployment (#45) 2023-09-14 15:12:28 +01:00
cmake Explicitly link std::filesystem as needed (#14) 2022-07-08 02:02:27 +09:00
dll Fix `TlsGetValue` & more (#48) 2023-10-01 23:56:35 -04:00
test 3 funcs needed for some mwcc compilers (#22) 2022-09-24 23:59:30 +09:00
.clang-format Everything needed to run simple Rust programs (#40) 2023-09-10 12:07:23 +09:00
.clang-tidy Everything needed to run simple Rust programs (#40) 2023-09-10 12:07:23 +09:00
.dockerignore Add Dockerfile + build action (#3) 2022-06-30 20:42:24 +01:00
.gitignore Implement enough process handling logic to make psyq4.0 happy (#46) 2023-09-18 15:05:47 +09:00
CMakeLists.txt GetLocaleInfoW (#47) 2023-09-22 09:13:56 +09:00
Dockerfile Use __attribute__((force_align_arg_pointer)) (#30) 2023-01-23 16:36:14 +01:00
LICENSE first commit 2022-06-13 02:20:18 +02:00
README.md WiBo -> wibo 2023-09-10 13:14:45 +09:00
common.h Fix `TlsGetValue` & more (#48) 2023-10-01 23:56:35 -04:00
files.cpp Everything needed to run simple Rust programs (#40) 2023-09-10 12:07:23 +09:00
files.h Everything needed to run simple Rust programs (#40) 2023-09-10 12:07:23 +09:00
handles.cpp 3 funcs needed for some mwcc compilers (#22) 2022-09-24 23:59:30 +09:00
handles.h Implement enough process handling logic to make psyq4.0 happy (#46) 2023-09-18 15:05:47 +09:00
loader.cpp Fix `TlsGetValue` & more (#48) 2023-10-01 23:56:35 -04:00
main.cpp Fix `TlsGetValue` & more (#48) 2023-10-01 23:56:35 -04:00
processes.cpp Implement enough process handling logic to make psyq4.0 happy (#46) 2023-09-18 15:05:47 +09:00
processes.h Implement enough process handling logic to make psyq4.0 happy (#46) 2023-09-18 15:05:47 +09:00
strutil.cpp GetLocaleInfoW (#47) 2023-09-22 09:13:56 +09:00
strutil.h GetLocaleInfoW (#47) 2023-09-22 09:13:56 +09:00

README.md

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 PATH itself, 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: