Quick-and-dirty wrapper that tries to run 32-bit Windows command-line executables on Linux
Go to file
nocato c6fa592a31
Handle dwCreationDisposition in CreateFileA to fix PSYLINK (#60)
Before this change, dwCreationDisposition parameter of CreateFileA was
ignored by wibo. However, it turns out that PSYLINK.EXE in PsyQ 4.4
sometimes depends on correct handling of that parameter.

When building overlays with PSYLINK.EXE, it sometimes opens the
resulting overlay file the second time, with OPEN_EXISTING creation
disposition (as opposed to TRUNCATE_EXISTING). Before the change,
wibo opened that file with fopen(..., "wb+") which truncated the file
even though OPEN_EXISTING (non-truncating) was requested. This affected
https://github.com/foxdieteam/mgs_reversing, where one of the overlays
(camera.bin) was built incorrectly when using wibo (worked correctly
on Windows or with wine).

This commit adds proper handling of dwCreationDisposition parameter.
The file now can be opened in truncating or non-truncating mode.
Additionally, the implementation now reacts correctly to file
existing/non-existing as specified by the requested creation disposition
mode. For example, if CreateFileA is called with OPEN_EXISTING and the
file does not exist it will set an error and not create a new file
(the previous behavior). If the file exists, it's opened in
non-truncating mode, as TRUNCATE_EXISTING or CREATE_ALWAYS is required
for truncation.

After the fix you can correctly build the whole mgs_reversing project
with wibo - tools running under wibo: ASMPSX, ASPSX, CC1PSX 4.0 & 4.4,
PSYLINK. I have NOT tested other executables apart from those.
2023-10-27 16:18:06 +09:00
.github/workflows Build a wibo_debug binary as well (#51) 2023-10-08 12:46:26 -04:00
cmake Explicitly link std::filesystem as needed (#14) 2022-07-08 02:02:27 +09:00
dll Handle dwCreationDisposition in CreateFileA to fix PSYLINK (#60) 2023-10-27 16:18:06 +09: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 Ensure we don't reallocate during 2GB address space block (#49) 2023-10-03 21:26:30 -04:00
Dockerfile Build a wibo_debug binary as well (#51) 2023-10-08 12:46:26 -04:00
LICENSE first commit 2022-06-13 02:20:18 +02:00
README.md Add retrowin32 to related projects in README 2023-10-15 07:41:40 -04:00
common.h Handle special handle value from FindFirstFileA in FindNextFileA (#52) 2023-10-08 13:08:53 -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 Minor cppcheck lint fixes 2023-10-16 20:08:52 +02:00
main.cpp Minor cppcheck lint fixes 2023-10-16 20:08:52 +02: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: