{"id":13831424,"url":"https://github.com/polivilas/UnrealEngineSDKGenerator","last_synced_at":"2025-07-09T14:32:48.887Z","repository":{"id":45738674,"uuid":"109998511","full_name":"polivilas/UnrealEngineSDKGenerator","owner":"polivilas","description":"Generate SDKs from Unreal Engine games (UE1 - 4 supported).","archived":false,"fork":false,"pushed_at":"2017-11-08T14:40:58.000Z","size":257,"stargazers_count":335,"open_issues_count":0,"forks_count":229,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-08-04T10:06:33.705Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polivilas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-08T16:08:03.000Z","updated_at":"2024-08-02T17:56:30.000Z","dependencies_parsed_at":"2022-09-07T02:50:56.129Z","dependency_job_id":null,"html_url":"https://github.com/polivilas/UnrealEngineSDKGenerator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polivilas%2FUnrealEngineSDKGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polivilas%2FUnrealEngineSDKGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polivilas%2FUnrealEngineSDKGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polivilas%2FUnrealEngineSDKGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polivilas","download_url":"https://codeload.github.com/polivilas/UnrealEngineSDKGenerator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225565769,"owners_count":17489264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T10:01:27.691Z","updated_at":"2024-11-20T13:30:28.055Z","avatar_url":"https://github.com/polivilas.png","language":"C++","funding_links":[],"categories":["C++","Various (no categorie name found hihi ) :"],"sub_categories":["Videos"],"readme":"# How to generate a new SDK?\nTo generate a new SDK you need to follow these steps.\n\n## 1. Choose the engine version your game uses\nTo make your life easier, you should copy the files from a game which uses the same version of UE as the new game because you need to make less code changes.\n\nShipped games to choose from are:\n\n\tUnreal Engine 1:\n\t\tUnreal\n\t\n\tUnreal Engine 2:\n\t\tUnreal 2\n\t\tUnreal Tournament 2004\n\t\n\tUnreal Engine 3:\n\t\tAll Points Bulletin: Reloaded\n\t\tHawken\n\t\tTribes: Ascends\n\t\tUnreal Tournament 3\n\t\n\tUnreal Engine 4:\n\t\tAlone in the Dark: Illumination\n\t\tARK Survival Evolved\n\t\tParagon\n\t\tUnreal Tournament 4\n\n## 2. Generate new project files\nIf you have choosen a game to copy from just run the _CreateNewProject.bat_ file. This will run a powershell script which will ask you for the name of the project to copy from and the name of the new project.\n\n**Example**:\nYou want to generate a SDK for a game called MyCoolGame. MyCoolGame uses the Unreal Engine 3 so you can then use Tribes: Ascends as template project. To create the new project files you execute the _CreateNewProject.bat_ file and enter \n\n\t\u003e copy from: TribesAscend\n\t\u003e new name: MyCoolGame\n\n(Hint: If the batch file is in the same folder as the other project files you can use TAB to autocomplete the names. Just remove the file extension in the name.)\n\nThe batch file copies the content, replaces some text and creates the new project files for you. You can do this manual too but why should you...? :smile:\n\nAs last step you need to open the _UnrealEngineSDKGenerator.sln_ and add the new _MyCoolGame.vcxproj_ to the solution.\n\n### List of generated files\nEach game has 5 files you may need to change.\n\n_EngineClasses.hpp_\nThis file contains the classes which are needed to generate the SDK. The classes are game dependend and usually you need to make changes here.\n\n_Generator.cpp_\nThis file contains settings which control the SDK generation. The classes are game dependen and usually you need to make changes here.\n\n_GenericTypes.cpp_\nThis file contains wrapper classes which map the classes from _EngineClasses.hpp_ to an interface which allows the generator to work with every version of Unreal Engine without making changes everywhere.\nNormaly you don't need to make changes here.\n\n_NamesStore.cpp_\nThis file contains the game dependend access to the names used by the game. Here you need to provide access to the global names array used by Unreal Engine. With the pattern library you can use signatures to automaticly find the correct adress at runtime.\n\n_ObjectsStore.cpp_\nSame as the _NamesStore.cpp_ but with code for the objects array used by Unreal Engine.  \n\n## 3. Reverse engineer the needed classes\nTo get the classes you need to insert into _EngineClasses.hpp_ I recommend this video https://www.youtube.com/watch?v=yNe4jz1v0R4 from The Feckless.\nIt shows how you can find the name array (put the signature in _NamesStore.cpp_), the object array (put the signature in _ObjectsStore.cpp_) and the needed classes (put them in _EngineClasses.hpp_).\nAgain: To make your life easier, you should use the same member names in the classes so you don't need to change other places too.\n\n## 4. Implement the project specific code\nThe _Generator.cpp_ file contains settings which control the SDK generation.\n\n### First the easy methods:\n\n`GetOutputDirectory()`\nThis method gets the path where the files should be generated. You don't need to add the game name because the name will get automaticly appended.\nIf you specify an absolute path (ex. \"C:/SDK_GEN\") the files will get generated there.\nIf you specify an relative path (ex. \"SDK_GEN\") the files will get generated in the directory where compiled dll is injected from appended with the relative path.\n**Example**:\nThe dll gets injected from \"C:/UnrealEngineSDKGenerator/bin/MyCoolGame.dll\". So the output directory will be \"C:/UnrealEngineSDKGenerator/bin/SDK_GEN\".\nThe default value is \"C:/SDK_GEN\".\n\n`GetGameName()`\nThis method should return the full name of the game. (ex. \"MyCoolGame\")\n\n`GetGameNameShort()`\nThis method should return an abbreviation for the full name. The generated files get prefixed with this short name. (ex. \"MCG\")\n\n`GetGameVersion()`\nThis method should return the current version of the game. The version number gets printed to the header of every file. (ex. \"1.2.3.4\")\n\n`ShouldDumpArrays()`\nIf this method returns true (default) the SDK dumper generates two textfiles which contain a list of all names and the names of the objects.\n\n`ShouldGenerateEmptyFiles()`\nIf this method returns false (default) no package files are generated when the package doesn't contain classes, constants or enums.\n\n`ShouldUseStrings()`\nIf this method returns true (default) the objects are referenced by their name. Otherwise the objects global index will be used.\nWarning: The index may change on updates or even on every start of the games.\n\n`ShouldXorStrings()`\nIf this method returns true (default: false) the strings printed by the generator get surrounded by `_xor_(...)`. With the XorStr library these strings get xor encrypted at compile time.\nhttps://svn.oldschoolhack.me/listing.php?repname=XorStr+%28...%2Fxorstr%29\n\n`ShouldConvertStaticMethods()`\nIf this method returns true (default) the static methods of a class are converted to normal methods. Static methods are only syntactic sugar from the engine. They are normal methods but called with the default object of a class. From the user point of view they are static methods but in reality they are not. If you want to use static methods you need to provide a method called `CreateDefaultObject()` in the UObject class. Some of the projects have signatures for the engine method but they could be hard to find. `ShouldConvertStaticMethods()` allows to rewrite the static methods to work like normal methods which require a class instance to get called. Additionaly these methods get a \"STATIC_\" prefix.\n\n`GetNamespaceName()`\nTo seperated the generated classes from the rest of your project you can surround the classes with a namespace. By default no namespace is generated.\nThis method should return the name of the namespace. If an empty name is given no namespace will be generated. (ex. \"Classes\")\nThe generated output looks like:\n\n```cpp\nnamespace Classes\n{\n\t...\n}\n```\n\n`GetIncludes()`\nIf your code needs some special header files to work return them in this method. For example you could need a pattern search library so add the related header file.\n**Example**:\n\n```cpp\nreturn {\n\tR\"(\"../my/relative/path/patternscan.hpp\")\", //with the raw literal you don't need to escape the quotes\n\t\"\\\"../math/vector.hpp\\\"\",\n\t\"\u003cwindows.h\u003e\"\n};\n```\n\n`GetGlobalMemberAlignment()`\nThis method returns the alignment of members. By default this method returns 4 at 32bit and 8 at 64bit.\nSee https://msdn.microsoft.com/en-us/library/2e70t5y1.aspx for more information.\n\n### The following methods are just getters and should not be modified:\n\n`GetOverrideType()`\nThis method checks if you have specified an override type for the related type. If no override type is found the original type is returned. This is usefull if you want to map some of your classes into the SDK. For example you could replace the provided `FVector` class with a version of your choice. You need to make sure the replacement hast the same size as the original class. If your override type is declared in an other header file you should add the include with the `GetIncludes()` method.\n\n`GetPredefinedClassMembers()`\nFor some classes the dumper can't generate members. If a class needs to have meaningfull members (for example the important `UObject` class) you can specify the members and this class will return them if the classname is matched.\n\n`GetPredefinedClassStaticMembers()`\nSometimes classes should have static members. This methods returns them if you have specified them.\n\n`GetVirtualFunctionPatterns()`\nIf you need virtual methods in a class you can specify patterns to match these methods. The generator loops the virtual methods of the class and checks for pattern matches. If a pattern matches the specific method will be added to the class.\n\n`GetPredefinedClassMethods()`\nIf you want to add methods to a class you can specify them and this method returns them.\n\n`GetClassAlignas()`\nSome classes need a special memory alignment (since Unreal Engine 4). This method gets the alignas value for the classes you have specified.\n\n### And now the advanced methods: :wink:\n\n`GetBasicDeclarations()`\nThis method returns a string with code which contains all the basic classes. Usually this is the same code you need to put in the _EngineClasses.hpp_. You should check the contained projects for examples.\n\n`GetBasicDefinitions()`\nThis method returns a string with code which contains definitions for the classes defined by the `GetBasicDeclarations()` method. You should check the contained projects for examples.\n\n`Initialize()`\nThis is the main method for you! This method initializes all the stuff the other methods need to work. You can do anything here (disable a possible protection, ...) but usually you just need to provide some data the getter methods can return.\nIt looks complicated but for the best explanation of this method you should have a look at the provided projects.\n\n*\t`overrideTypes`\n\tThis map contains the override classes used by `GetOverrideType()`.\n\n\t**Example**:\n\tThis example forces the generator to override both `FVector` classes with the custom classes.\n\t```cpp\n\toverrideTypes = {\n\t\t{ \"struct FVector\", \"class Vector3D\" },\n\t\t{ \"struct FVector2D\", \"class Vector2D\" }\n\t};\n\t```\n*\t`alignasClasses`\n\tThis map contains the alignas classes used by `GetClassAlignas()`.\n\n\t**Example**:\n\tThis example forces the alignas keyword for the three listed classes.\n\t```cpp\n\talignasClasses = {\n\t\t{ \"ScriptStruct CoreUObject.Plane\", 16 },\n\t\t{ \"ScriptStruct CoreUObject.Vector4\", 16 },\n\t\t{ \"ScriptStruct Engine.RootMotionSourceGroup\", 8 }\n\t};\n\t```\n\n*\t`virtualFunctionPattern`\n\tThis map is used by `GetVirtualFunctionPatterns()` and contains signatures which are used to find virtual methods in classes.\n\n\t**Example**:\n\tThis example adds a signature which if found adds the ProcessEvent method to the Object class.\n\t```cpp\n\tvirtualFunctionPattern[\"Class CoreUObject.Object\"] = {\n\t\t{\n\t\t\t\"\\x45\\x33\\xF6\\x4D\\x8B\\xE0\",\n\t\t\t\"xxxxxx\",\n\t\t\tR\"(inline void ProcessEvent(class UFunction* function, void* parms)\n\t\t\t{\n\t\t\t\treturn GetVFunction\u003cvoid(*)(UObject*, class UFunction*, void*)\u003e(this, %d)(this, function, parms);\n\t\t\t})\"\n\t\t}\n\t};\n\t```\n\n*\t`predefinedMembers`\n\tThis map is used by `GetPredefinedClassMembers()` and contains member variables which can't be dumped. At the moment you can't mix auto generated and predefined members.\n\tThe members are added in the class in the same order as in the map.\n\n\t**Example**:\n\tThis example adds the listed members to the Object class.\n\t```cpp\n\tpredefinedMembers[\"Class CoreUObject.Object\"] = {\n\t\t{ \"void*\", \"Vtable\" },\n\t\t{ \"int32_t\", \"ObjectFlags\" },\n\t\t{ \"int32_t\", \"InternalIndex\" },\n\t\t{ \"class UClass*\", \"Class\" },\n\t\t{ \"FName\", \"Name\" },\n\t\t{ \"class UObject*\", \"Outer\" }\n\t};\n\t```\n\n*\t`predefinedStaticMembers`\n\tThis map is used by `GetPredefinedClassStaticMembers()` and contains static member variables.\n\n\t**Example**:\n\tThis example adds the static member GObjects with the type FUObjectArray* to the Object class.\n\t```cpp\n\tpredefinedStaticMembers[\"Class CoreUObject.Object\"] = {\n\t\t{ \"FUObjectArray*\", \"GObjects\" }\n\t};\n\t```\n\n*\t`predefinedMethods`\n\tThis map is used by `GetPredefinedClassMethods()` and contains custom methods. This can be used to add helper functions like constructors.\n\n\t**Example**:\n\tThis example adds two constructors to the Vector2D class to make initialization easier.\n\t```cpp\n\tpredefinedMethods[\"ScriptStruct CoreUObject.Vector2D\"] = {\n\t\tPredefinedMethod::Inline(R\"(inline FVector2D() : X(0), Y(0) { })\"),\n\t\tPredefinedMethod::Inline(R\"(inline FVector2D(float x, float y) : X(x), Y(y) { })\")\n\t};\n\t```\n\n## And now?\nCompile the project and inject the DLL into the target. Use the debug build and a debugger to fix errors but use the release build to really generate the sdk. Otherwise you need to wait some minutes because the debug build is very slow. After you see the \"Finished!\" messagebox you can have a look at your new sdk.\n\nThe generated folder structure looks like this:\n```\nXXX\n+-- Generator.log\n+-- NamesDump.txt\n+-- ObjectsDump.txt\n+-- SDK.hpp\n+-- SDK\n|   +-- XXX_Basic.hpp\n|   +-- XXX_Basic.cpp\n|   +-- XXX_..._classes.hpp\n|   +-- XXX_..._functions.cpp\n|   +-- XXX_..._structs.hpp\n```\n\n_Generator.log_\nThis file contains the log messages the generator outputs.\n_NamesDump.txt_\nThis file is generated if `ShouldDumpArrays()` is true and it contains all names available in the names array.\n_ObjectsDump.txt_\nThis file is generated if `ShouldDumpArrays()` is true and it contains all objects names available in the objects array.\n_SDK.hpp_\nThis file contains all includes you need for the SDK.\n\n*XXX_Basic.hpp* / *XXX_Basic.cpp*\nThese files contain the code outputted by `GetBasicDeclarations()` and `GetBasicDefinitions()`.\n*XXX_..._classes.hpp* / *XXX_..._structs.hpp*\nThese files contain the code of the classes and structs.\n*XXX_..._functions.cpp*\nThis file contains the code of the class methods.\n\nThe SDK folder contains the generated code for every package. You need to copy the _SDK.hpp_ and the _SDK_ folder to your project. In your code you need an include to the _SDK.hpp_ and add the _*.cpp_ files to the project. Most of the time you don't need all the cpp files.\nFiles you may always need:\n```\nXXX_Basic.cpp\nXXX_Core(UObject)_functions.cpp\nXXX_Engine_functions.cpp\n```\nTo find these files just sort the SDK folder by file size. The biggest files are the files you are looking for.\n\nNow you can use the SDK in your project. Have fun. :smile:\n\n## Known Errors\nSometimes you can't compile the generated SDK. Here are some known errors and a solution how to fix them:\n\n- (UE4) In the generated enum EPixelFormat (CoreUObject_classes.hpp) is a PF_MAX value. The windows.h header defines a constant with the same name so this will keep you from compiling. Just remove the PF_MAX value from enum and all should work.\n- Sometimes class members or method parameters get a name like \"return\", \"continue\", \"break\" which are reserved keywords so the compiler will complain. To fix this error just rename these to something else.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolivilas%2FUnrealEngineSDKGenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolivilas%2FUnrealEngineSDKGenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolivilas%2FUnrealEngineSDKGenerator/lists"}