No Man's Sky python modding API
Project description
NMS.py
NMS.py is a python library to expose interal game functions for No Man's Sky.
NOTE: This library is missing a lot of info which will gradually get added over time. It should also be noted that Game updates can very easily break mods utilising NMS.py, so care should be taken when using mods. Any responsibility for broken saves is entirely on the users of this library.
Also note that this library will never contain functions relating to online functionality to avoid any abuse. The author of this library does not condone any use of this code for any purpose that is directly detrimental to other players.
Installation
Note: It is recommended that you download python from the official site as the windows store version may have issues, as well as the managed python which uv installs.
Note: Python 3.14 is not yet supported. This will come in time but requires some changes to a dependency in pyMHF.
The recommended way to install NMS.py is to simply run python -m pip install nmspy. This will install NMS.py and its' dependency pyMHF into your system python. You can of course install it in a venv or as a dependency using uv if you prefer.
Usage
To run NMS.py, enter the following command into a terminal:
pymhf run nmspy
This will display some config options to complete. The only option to consider is the location of the mods folder. It is recommended that you specify the MODS folder inside the GAMEDATA folder as your mod directory (ie. the same one you put normal mods in).
All mods will be placed in either this folder, or in a chcild folder of this. You can essentially think of any mod using NMS.py being able to be "installed" in the same way you would any other normal mod.
If NMS.py starts up successfully you should see two extra windows; an auto-created GUI from pyMHF, and a terminal window which will show the logs for pyMHF.
If you want to stop NMS, you can press ctrl + C in the window you started the process in to kill it.
Writing mods
Currently the best way to see how to write a mod is to look at the example_mods folder, as well as looking at the pyMHF docs which has comprehensive details on how to use pyMHF.
Contributing
NMS.py can always be better! If you are interested in improving it, the best way to do so is to either make mods using it, or, if you have reverse engineering skills, you can contribute either new functions or new field offsets.
Adding new functions to hook
To add a new function to hook you need to add the details to tools/data.json as well as the nmspy/data/types.py file.
The data for these can generally be found by comparing the structure of the function in the latest exe to either the mac binary or the 4.13 binary.
It is recommended to use either IDA Fusion or SigmakerEX for IDA or some other plugin for any other disassembler to get the unique byte pattern for the function you are providing.
Adding new struct fields
This is a bit trickier and will often involve a good amount of reverse engineering of the exe, comparing the data to the 4.13 binary as well as potentially the mac binary. It is best if a comment is made above the added field so that it's possible to find it again when the game updates so that it's possible to check if the offset has changed.
Credits
Thanks to the developers of minhook, cyminhook and pymem, all of which are instrumental in making this framework possible.
Big thanks to vitalised for their constant RE discussions, and gurren3 for the same as well as the initial work done on NMS.API which heavily inspired the creation of this.
Thanks also to the many people I have discussed various NMS details with, both big and small.
Thanks to RaYRoD for initially discovering the pdb as well as regular insightful discussions regarding all things reverse engineering NMS.
Thanks also to anyone who has contributed function definitions or patterns. Any and all help is always appreciated!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nmspy-159106.0.tar.gz.
File metadata
- Download URL: nmspy-159106.0.tar.gz
- Upload date:
- Size: 664.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a74cad4b6daf80445289e61ea9f72ee183697972e6430393fa04149166b2ad52
|
|
| MD5 |
cf02ff089465eaf51574b02fc9996fc6
|
|
| BLAKE2b-256 |
d0aa9ea273cc57d7b12c25f48314e198c30300ce3e01cdec7e537c8d0f4d82bf
|
Provenance
The following attestation bundles were made for nmspy-159106.0.tar.gz:
Publisher:
pipeline.yml on monkeyman192/NMS.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nmspy-159106.0.tar.gz -
Subject digest:
a74cad4b6daf80445289e61ea9f72ee183697972e6430393fa04149166b2ad52 - Sigstore transparency entry: 938622263
- Sigstore integration time:
-
Permalink:
monkeyman192/NMS.py@6b7cfb9e8450856f683db43dda1ae6a37cc289a0 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/monkeyman192
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline.yml@6b7cfb9e8450856f683db43dda1ae6a37cc289a0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nmspy-159106.0-py3-none-any.whl.
File metadata
- Download URL: nmspy-159106.0-py3-none-any.whl
- Upload date:
- Size: 386.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0183e365df39c8eca7ebe2cd389a6c42b52e47360fae28419051f111f812a0ca
|
|
| MD5 |
42ab3a632e5057f81a5b0d03d6144e82
|
|
| BLAKE2b-256 |
2c466d5dcb51ea237789ead0a3af3fe313c2537d41f5b6159e20bd6e951fcbb4
|
Provenance
The following attestation bundles were made for nmspy-159106.0-py3-none-any.whl:
Publisher:
pipeline.yml on monkeyman192/NMS.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nmspy-159106.0-py3-none-any.whl -
Subject digest:
0183e365df39c8eca7ebe2cd389a6c42b52e47360fae28419051f111f812a0ca - Sigstore transparency entry: 938622269
- Sigstore integration time:
-
Permalink:
monkeyman192/NMS.py@6b7cfb9e8450856f683db43dda1ae6a37cc289a0 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/monkeyman192
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline.yml@6b7cfb9e8450856f683db43dda1ae6a37cc289a0 -
Trigger Event:
push
-
Statement type: