Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/InsultingPros/Unflect
https://github.com/InsultingPros/Unflect
killing-floor unrealscript whitelisted
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/InsultingPros/Unflect
- Owner: InsultingPros
- License: mit
- Fork: true (EliotVU/UnrealScript-Unflect)
- Created: 2023-04-01T20:33:46.000Z (over 1 year ago)
- Default Branch: frozen
- Last Pushed: 2023-10-13T12:51:03.000Z (about 1 year ago)
- Last Synced: 2024-07-30T20:58:48.997Z (5 months ago)
- Topics: killing-floor, unrealscript, whitelisted
- Language: UnrealScript
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unflect
Unflect is a proof-of-concept that exploits the UnrealScript compiler to trick it into compiling an illegal class casting. For example, we can retrieve the values of strictly native fields by casting a UFunction instance into our own mirrored UFunction.
![image](Docs/media/example.png)
## Compiling
The source is written for Unreal Tournament 2004, but the code should compile for most UE2 games, possibly requiring some minor alignment changes in the native mirror classes.
* Requires /System/[MakeCommandletUtils.u](https://github.com/EliotVU/UnrealScript-MakeCommandletUtils)
* Run `make.bat` (The directory with the `/Classes/` directory has to be located at the root of the UE2 installation e.g. (`C:\\UT2004/Unflect/`).
* Run `test.bat` to confirm that everything's working.## Usage
### Function Replacement
If you need to replace a function in a class, follow these steps:
* Create a new class that extends the class in which the function you want to replace is located.
* Declare that function in the created class.
* DO NOT change the function declaration and argument types/amount.
* DO NOT create new local variables, as this can cause random crashes. If you need additional variables, make them global and access them using the `class'myNewClass'.default.myNewVariable` syntax.
* If you want to call or override parent code, make sure to always specify the desired parent class name. For example, use `super(TargetClass).PostBeginPlay()` instead of `super.PostBeginPlay()`. This will prevent runaway loop crashes.
* Make your edits to the function's code, and then call the replacement function:```unrealscript
class'CoreAPI'.static.ReplaceFunction(self, "package.class.targetFunction", "myNewClass.newFunction")
```Following these steps will help ensure that your code changes are compatible with the rest of the codebase and do not cause unexpected crashes.
### Type Metadata
Works with `int`, `float`, `bool`, `byte`, `string`, `name` types, make sure that your variable name length >= 2 characters.
```unrealscript
var int MyCommentStringProperty "Hello world!";log("MetaData: " $ class'CoreAPI'.static.GetTypeMetaData(Property'MyCommentStringProperty'));
```