Giter Club home page Giter Club logo

spore-modapi's Introduction

Spore ModAPI SDK

This GitHub page hosts the Spore ModAPI development kit, used to create Spore mods with C++. To use those mods, you need the ModAPI Launcher and Installers.

The Spore ModAPI SDK allows you to create C++ mods for Spore. These mods are compiled into .dll files, that can then be used by the ModAPI Launcher Kit to inject them into Spore.

The documentation of the SDK is available here: https://emd4600.github.io/Spore-ModAPI/

Instructions about download, installation and updating can be found in this tutorial.

The source code can be found in this GitHub repository. If you want to see the SDK in action, check the list of open source mods. This project also includes the source code of some example mods made with the ModAPI SDK:

To compile the core DLLs (unless you want to develop the SDK itself, you don't need to do this):

  1. Open the Visual Studio Command Prompt
  2. Navigate to the SDK root directory.
  3. Execute msbuild "Spore ModAPI" -t:BuildDlls -p:BuildVer=177 -p:Config=Release (changing the version and config accordingly)

Working with Ghidra

If you want to extend the SDK, or just want to investigate Spore's source code, you can use the free program Ghidra to do so. The SDK includes a plugin and some files, that can be used to add all the known data from the SDK into Ghidra. These are prepared to work with Ghidra's function decompiler, making reverse engineering much easier:

To use them:

  1. Open your project in Ghidra.
  2. If you hadn't done it yet, analyze the executable (this finds all functions).
  3. Open Windows > Script Manager.
  4. On the top bar of the new window, click on the Manage Script Directories
  5. On the popup window, click on the + button and search the Spore ModAPI SDK/SDKtoGhidra/GhidraScript folder in your SDK installation.
  6. Close that popup and go back to the script manager, find the ImportSporeSDK.java script (it's in the Data category).
  7. Execute it: it will ask for a file, select the Spore ModAPI SDK/SDKtoGhidra/SporeGhidra_march2017.xml (or SporeGhidra_disk.xml if you use a disk Spore installation).
  8. Wait for it to complete; in the console, you can see all the functions and data types that have been added.

Keep in mind that Ghidra's decompiler is only an approximation, and it will not produce code that is directly executable on the SDK. There are several differences to keep in mind, among others:

  • Ghidra data types have no inheritance, so the decompiler isn't aware of superclass/subclass relationships.
  • Ghidra does not understand virtual functions. When calling a virtual function, Ghidra first grabs the function pointer from the virtual function table, and then executes it.
  • Ghidra does not understand intrusive_ptrs, which means the code it generates makes calls to AddRef() and Release() (which you never see in the SDK).

Generating Ghidra files (only for SDK maintainers)

If you are extending the SDK and need to update the Ghidra files, you need to install Python 3.9 (at least) and the library libclang, then run extract.py.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.