Winapi fuzzer to help Wine project in creating better Windows "emulator"

Overview

Win32 Fuzzer

This repository contains fuzzer to test Windows API functions(Win32 API).

I created it to help Wine to better mimic Windows OS and allow running more Windows software on Linux.

I think that 32 bit binaries

Looks that currently tests - 4466 functions from all 10540 parsed.

This project works fine with windows-rs 0.33.0, so it may require rewrite to support newer versions.

How to use it

  • Install wine(7.4 works fine, any lower version may cause crashes, any newer may also crash, but this is bug in Wine, not in this project)
  • Install GNU Rust inside Wine(I used 1.59.0, but any higher version should work fine) - https://forge.rust-lang.org/infra/other-installation-methods.html#standalone-installers
  • Clone/Download windows-rs repository(required to get info about windows api functions) - git clone https://github.com/microsoft/windows-rs.git
  • Clone this repository - git clone https://github.com/qarmin/Win32Fuzzer.git
  • Compile and run project with 1 argument set as path to windows-rs repository cargo run /home/test/windows-rs
  • Go to WinProject(which is inside this project) cd WinProject/
  • Compile this project wine cargo build
  • Generated binaries should be available here target/debug/wine_project.exe
  • By default, binary should not crash, because all problematic functions are excluded in settings.rs file, so feel free to comment required lines.
  • Setup if needed settings.txt file, template is already available in path WinProject/settings.txt
You might also like...
NES emulator written in Rust

sprocketnes is an emulator for the Nintendo Entertainment System written in the Rust programming language. Its purpose is to serve as a technology dem

NES emulator in rust
NES emulator in rust

NES emulator in Rust plastic is a NES emulator built from scratch using Rust. This is a personal project for fun and to experience emulating hardware

ZX Spectrum emulator written in Rust
ZX Spectrum emulator written in Rust

rustzx ZX Spectrum emulator which I writing in rust. I develop this project just for fun and for learning the basics of computer architecture. License

R.A.Z.E. A ZX Spectrum Emulator

R.A.Z.E. A ZX Spectrum emulator This project is part of a friendly competition to build an emulator using Rust and WebAssembly. Check the live version

Rustual Boy - A Virtual Boy emulator.
Rustual Boy - A Virtual Boy emulator.

Rustual Boy Description Rustual Boy is a Virtual Boy emulator. It can be used to play existing Virtual Boy games, as well as be a helpful development/

Intel 8080 cpu emulator by Rust
Intel 8080 cpu emulator by Rust

i8080 i8080 is a emulator for Intel 8080 cpu. 8080 Programmers Manual 8080 opcodes [dependencies] i8080 = { git = "https://github.com/mohanson/i8080"

TestSuite4 is a framework designed to simplify development and testing of TON Contracts. It includes light-weight emulator of blockchain making it easy to develop contracts.

TestSuite4 0.1.2 TestSuite4 is a framework designed to simplify development and testing of TON Contracts. It contains lightweight blockchain emulator

Learn emulator and programming languages, target chip8, nes, gbc, gba ...
Learn emulator and programming languages, target chip8, nes, gbc, gba ...

[WIP]learn emulator go-chip8 go run main.go source https://en.wikipedia.org/wiki/CHIP-8 http://devernay.free.fr/hacks/chip8/C8TECH10.HTM https://githu

CHIP-8 emulator written in Rust
CHIP-8 emulator written in Rust

CHIP-8 emulator written in Rust. This is intended to be a project for gaining experience writing emulators and practice Rust.

Comments
  • Failed to run on linux (No such file or directory)

    Failed to run on linux (No such file or directory)

    Trying to run on Linux results in error.

    $ cargo run --release
       Compiling same-file v1.0.6
       Compiling walkdir v2.3.2
       Compiling win32_fuzzer v1.0.0 (/home/juozas/Win32Fuzzer)
        Finished release [optimized] target(s) in 25.69s
         Running `target/release/win32_fuzzer`
    thread 'main' panicked at 'Failed to open /home/rafal/test/windows-rs/crates/libs/sys/src/Windows/Win32/Graphics/Printing/mod.rs, due Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/parse_file.rs:7:19
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    

    It references a path on non-existing location.

    opened by juozaspo 2
  • Update to windows-rs 0.35.0

    Update to windows-rs 0.35.0

    This require to improve method to gather number of arguments, because currently only sys crate is parsed, but windows-rs adds/remove some arguments, so this is not 100% proper

    opened by qarmin 0
Releases(1.1.0)
  • 1.1.0(Mar 17, 2022)

  • 1.0.0(Mar 12, 2022)

    Binaries of 1.0.0 version of fuzzer with disabled checking for crashed/not implemented in Linux functions

    Running win_project.exe from win_project.zip will run every supported function from any "class"(class in this context means module or something similar)

    Also exists file win_project_disabled_functions which just disable problematic functions, so it should just run fine without any crashes in WIne 7.3(it can crash in later versions due regressions etc.)

    To configure which functions from which classes will be checked, settings.txt file can be configured. Example content

    allowed_functions:
    GetThemeData
    ignored_functions:
    
    allowed_classes:
    
    ignored_classes:
    
    # How much repeat functions in row, one after one
    repeating_number:
    1
    
    # How much time repeat execution of classes(20 means that 20 times will be executed functions for certain classes)
    all_repeating_number:
    -1
    
    # Use random order when executing functions from this class
    random:
    false
    

    List of functions that crashes on Wine Devel 7.3 but not in Wine Staging

    CloseThemeData - Controls
    GetKeyboardLayoutList
    

    Test project to be able to compile single functions is attached and without any changes it will compile several minutes(or even hours), so I suggest to remove some features from Cargo.toml file

    Source code(tar.gz)
    Source code(zip)
    7.3.staging.results.txt(74.28 KB)
    CargoTestProject.zip(32.80 KB)
    settings.txt(175 bytes)
    win_project.zip(46.40 MB)
    win_project_disabled_functions.zip(45.69 MB)
Owner
Rafał Mikrut
Rafał Mikrut
A Game Boy research project and emulator written in Rust

Mooneye GB Mooneye GB is a Game Boy research project and emulator written in Rust. The main goals of this project are accuracy and documentation. Some

Joonas Javanainen 802 Dec 28, 2022
CHIP-8 emulator written in Rust as a side project.

marisa-rs a CHIP-8 emulator, with learning purposes in mind, written in Rust. this is mainly a learning project of mine for deeper knowledge in emulat

Lumine 0 Jul 26, 2022
Commodore 64 emulator written in Rust

Rust64 - a C64 emulator written in Rust This is my attempt to study the Rust programming language and have fun at the same time. The goal is to presen

Krzysztof Kondrak 214 Dec 27, 2022
A Flash Player emulator written in Rust

website | demo | nightly builds | wiki Ruffle Ruffle is an Adobe Flash Player emulator written in the Rust programming language. Ruffle targets both t

Ruffle 11.2k Jan 8, 2023
A Gameboy Emulator in Rust

RBoy A Gameboy Color Emulator written in Rust Implemented CPU All instructions correct All timings correct Double speed mode GPU Normal mode Color mod

Mathijs van de Nes 512 Dec 23, 2022
RGB (Rust Game Boy) is a simple emulator for the original game boy

RGB RGB (Rust Game Boy) is a simple emulator for the original game boy and the color game boy. Warning: This no longer compiles in the latest versions

Niven Achenjang 18 Dec 2, 2022
Full featured Cross-platform GameBoy emulator by Rust. Forever boys!.

Gameboy Full featured Cross-platform GameBoy emulator. Forever boys!. You can start a game with the following command, here with a built-in game "Boxe

Mohanson 1.2k Jan 2, 2023
RustBoyAdvance-NG is a Nintendo™ Game Boy Advance emulator and debugger, written in the rust programming language.

RustBoyAdvance-NG Nintendo GameBoy Advance ™ emulator and debugger, written in rust. WebAssembly Demo: https://michelhe.github.io/rustboyadvance-ng/ P

MishMish 510 Dec 30, 2022
NES emulator written in Rust to learn Rust

OxideNES A NES emulator in Rust. CPU should be accurate, PPU is mostly accurate, timing between the 2 is off for some corner cases and hardware qui

null 37 Nov 7, 2022
An NES emulator written in Rust

Pinky Pinky is an NES emulator written in Rust completely from scratch based only on publicly available documentation. You can run it in your Web brow

Koute 709 Dec 23, 2022