Skip to content

Latest commit

 

History

History
53 lines (47 loc) · 3.02 KB

File metadata and controls

53 lines (47 loc) · 3.02 KB

Quick Start Guide with xwf-api-rs

Prerequisites

  • Skills
  • Installation of Visual Studio Build Tools 2022
    • select Workload C++ Desktop Development
    • also select Component C++/CLI Support for v143-Buildtools (latest)
  • Installation of latest rustup
    • Installation of rust toolchain stable-x86_64-pc-windows-msvc
  • X-Ways Forensics 20.0 or higher required
    • older XWF versions are not supported by this project, as I do not intend to account for differing API feature levels in earlier versions.
  • A set-up XWF-project with some evidences and files as a playground
    • a huge database of forensic image datasets from NIST can be found here

Compile and test Example Project

  • clone the github source code, e.g. within terminal

    cd <your favourite path>
    git clone https://github.com/ThomasVogl/xwf-api-rs
    
  • goto the cloned project path compile everything with cargo

    cd xwf-api-rs
    cargo build --release
    
  • now the compiled example X-Tensions (dll-File) can be found in xwf-api-rs\target\release

    • Load one of the compiled dlls into X-Ways via Main Menu (<Shift+F8>) to execute them.
  • You can use one of the example projects as a starting point/boilerplate for your own X-Tensions:

    • You will just need the files cargo.toml and src\lib.rs from an example, nothing more.
      • copy these two files from xwf-api-rs git workspace or directly download them from github.
      • xwf-api-rs dependency should be automatically pulled by cargo from github, you should not need the whole project source of xwf-api-rs
    • adapt cargo.toml to your needs
      • change project name and version

      • change API level feature for xwf-api-rs (feature api_<major>_<minor>) to the expected minimum version you want to support.

        For example, the feature api_20_3 will enable X-Tension API features that were introduced by X-Ways in version 20.3. Of course you would need then at least this version for executing the X-Tension. (this is checked at runtime in XT_Init automatically)

    • load the new project in you favourite IDE. I personally would suggest RustRover for maximum convenience)
    • adapt src/lib.rs to your needs
      • change the name of the struct that implements XTension-trait
      • change the last line in the code:
        export_all_functions!(<name of static variable (can be anything)>, <struct-Name that impls XTension trait>);`
        
        This macro statement does all the magic of defining and exporting functions for the resulting DLL-Library
    • Have fun with Rust and X-Ways!