# Open source memory scanner written in C++: XenoScan

2018-08-21T18:36:14
ID N0WHERE:172910
Type n0where
Reporter N0where
Modified 2018-08-21T18:36:14

## Sub-projects

### XenoLua

_ XenoLua _ is a wrapper around Lua that provides a ton of functionality. Most notably, it provides a LuaVariant class which wraps the functionality of converting between C / C++ and Lua types. Additionally, it has helper functions for working with Lua in the LuaPrimitive class.

### XenoScanEngine

_ XenoScanEngine _ is the meat of the project. It contains the code for the scanning, data structure detection, and everything else.

### XenoScanLua

_ XenoScanLua _ ties _ XenoScanEngine _ to _ XenoLua _ to provide a Lua-scriptable frontend for the scanner. Currently, this is the only entry-point to the scanner.

Additionally, this project contains some test code that ensures everything is working properly. A test is a combination of a .cpp , a .h , and a .lua file. For examples on how to use the scanner, you can check out the .lua test files.

## Compiling

_ XenoScan _ uses _ CMake _ , and has been tested with Visual Studio 2017. In theory, you should be able to build the code with any modernish compiler, as long as you use CMake to generate the project files. Before you can compile, you will need to make sure you’ve checked out the submodules. Once that’s done, you’ll also have to build the _ luajit _ submodule so _ XenoScan _ can link against the libraries.

If you’re using Visual Studio, this should be easy. Simply run buildmsvc2017.bat from a _ Developer Command Prompt for VS _ . As an example, to build a project for _ Visual Studio 2017 _ , I run

cd C:\path\to\XenoScan
buildmsvc2017.bat


Which would make a file named XenoScan.sln appear in my build directory (e.g. C:\path\to\XenoScan\build ).

The main development of XenoScan is done on this version of Visual Studio.

If you’re on another system or using another compiler or IDE, you’ll have to build _ luajit _ on your own and run _ CMake _ manually.

## Platform

The code is designed to be platform-agnostic. Theoretically, to compile on any other platform, you would need to

1. Create project/make files for your target IDE/compiler.
2. Remove the ScannerTargetWindows.cpp and ScannerTargetWindows.h files from the project.
3. Implement the ScannerTarget interface for your platform.
5. ???? _ profit _

## Features

Basic scanning functionality supports the following types:

• Integral types*:
• int8_t
• uint8_t
• int16_t
• uint16_t
• int32_t
• uint32_t
• int64_t
• uint64_t
• float
• double
• ascii strings
• wide strings
• Custom data structures (think C++ struct )

• Can consist of any combination integral and decimal types
• _ Lua frontend may choke on 64-bit integers, but the scanner library supports them. _

Scanning supports the following types of matching:

• Equal to
• Greater than
• Greater than or equal to
• Less than
• Less than or equal to
• Ranges ( min &lt;= check &lt;= max )

Additionally, there is functionality to detect all instances of the following types:

• std::map
• std::list
• Any class with a virtual-function table