If you are building on Debian/Ubuntu you will need to make sure you have the following packages:
sudo apt install libsdl2-dev
Build/run the CLI app:
$ make emu opt=1
$ ./target/release/retrowin32 exe/zig_hello/hello.exe
The command line as seen by the program is an optional third argument:
$ ./target/release/retrowin32 path/to/some.exe "c:\\some.exe arg1 arg2"
The --win32-trace
flag controls tracing of win32 API calls. Passing *
(which
must be quoted from the shell) makes retrowin32 trace all calls.
To iterate while developing I often use a command like this, which builds and runs in one invocation.
$ cargo run -p retrowin32 -F x86-emu -- --win32-trace '*' path/to/my/exe
(You might pass --release
for faster binaries or -F x86-emu,sdl
for GUI
support.)
Rosetta mode (see doc/x86-64.md):
$ make rosetta
$ ./target/x86_64-apple-darwin/debug/retrowin32 exe/zig_hello/hello.exe
Build/run the web app:
$ make deploy opt=1
$ cd web
$ npm run serve
The above make
commands cover the main things you'd build, but they wrap some
more subtle configuration.
To choose the x86 emulation strategy, you must pick a Rust "feature":
x86-emu
: retrowin32's own x86 emulatorx86-64
: generate x86-64 code, requires x86 CPU or Rosettax86-unicorn
: use Unicorn (effectively QEMU) for x86 emulation
To choose the rendering strategy, there is one further toggle:
sdl
: use sdl2 for graphics- otherwise
- non-web: headless mode, crash on any graphics calls
- web: render to DOM
Web builds require x86-emu
and no sdl
.
x86/
-- the x86 emulatorwin32/
-- the win32 emulatorwin32/src/winapi/
-- the Windows API implementation
cli/
-- a command-line emulator runnerweb/
-- a webapp that runs the emulator in a browserweb/glue/
-- wasm glue for thewin32/
API
exe/
-- some sample Windows executablesmemory/
-- a memory abstraction shared byx86
andwin32
appdb/
-- metadata about particular binaries, see appdb/README.md