├── .gitattributes ├── .gitignore ├── LICENSE ├── LiteSDKGenerator.sln ├── LiteSDKGenerator ├── Global.cpp ├── Global.h ├── LiteSDKGenerator.vcxproj ├── LiteSDKGenerator.vcxproj.filters ├── Main.cpp ├── Main.h ├── Main.resx ├── Memory.cpp ├── Memory.h ├── SDKGenerator.cpp ├── SDKGenerator.h ├── SDKTypes.cpp ├── SDKTypes.h ├── TinyFormat.h ├── Updates.h └── UtilsDefs.h ├── README.md └── images ├── AutoUpdate.jpg ├── DumpSDK.jpg ├── ExportUseful.jpg ├── FindGNames.jpg ├── MainForm.jpg └── UObjectTest.jpg /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | *- Backup*.rdl 259 | 260 | # Microsoft Fakes 261 | FakesAssemblies/ 262 | 263 | # GhostDoc plugin setting file 264 | *.GhostDoc.xml 265 | 266 | # Node.js Tools for Visual Studio 267 | .ntvs_analysis.dat 268 | node_modules/ 269 | 270 | # Visual Studio 6 build log 271 | *.plg 272 | 273 | # Visual Studio 6 workspace options file 274 | *.opt 275 | 276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 277 | *.vbw 278 | 279 | # Visual Studio LightSwitch build output 280 | **/*.HTMLClient/GeneratedArtifacts 281 | **/*.DesktopClient/GeneratedArtifacts 282 | **/*.DesktopClient/ModelManifest.xml 283 | **/*.Server/GeneratedArtifacts 284 | **/*.Server/ModelManifest.xml 285 | _Pvt_Extensions 286 | 287 | # Paket dependency manager 288 | .paket/paket.exe 289 | paket-files/ 290 | 291 | # FAKE - F# Make 292 | .fake/ 293 | 294 | # JetBrains Rider 295 | .idea/ 296 | *.sln.iml 297 | 298 | # CodeRush personal settings 299 | .cr/personal 300 | 301 | # Python Tools for Visual Studio (PTVS) 302 | __pycache__/ 303 | *.pyc 304 | 305 | # Cake - Uncomment if you are using it 306 | # tools/** 307 | # !tools/packages.config 308 | 309 | # Tabs Studio 310 | *.tss 311 | 312 | # Telerik's JustMock configuration file 313 | *.jmconfig 314 | 315 | # BizTalk build output 316 | *.btp.cs 317 | *.btm.cs 318 | *.odx.cs 319 | *.xsd.cs 320 | 321 | # OpenCover UI analysis results 322 | OpenCover/ 323 | 324 | # Azure Stream Analytics local run output 325 | ASALocalRun/ 326 | 327 | # MSBuild Binary and Structured Log 328 | *.binlog 329 | 330 | # NVidia Nsight GPU debugger configuration file 331 | *.nvuser 332 | 333 | # MFractors (Xamarin productivity tool) working folder 334 | .mfractor/ 335 | 336 | # Local History for Visual Studio 337 | .localhistory/ 338 | 339 | # BeatPulse healthcheck temp database 340 | healthchecksdb -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /LiteSDKGenerator.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29418.71 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LiteSDKGenerator", "LiteSDKGenerator\LiteSDKGenerator.vcxproj", "{F720C7B4-D9C8-4504-B4C5-377C85F7BB3D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {F720C7B4-D9C8-4504-B4C5-377C85F7BB3D}.Debug|x64.ActiveCfg = Debug|x64 17 | {F720C7B4-D9C8-4504-B4C5-377C85F7BB3D}.Debug|x64.Build.0 = Debug|x64 18 | {F720C7B4-D9C8-4504-B4C5-377C85F7BB3D}.Debug|x86.ActiveCfg = Debug|Win32 19 | {F720C7B4-D9C8-4504-B4C5-377C85F7BB3D}.Debug|x86.Build.0 = Debug|Win32 20 | {F720C7B4-D9C8-4504-B4C5-377C85F7BB3D}.Release|x64.ActiveCfg = Release|x64 21 | {F720C7B4-D9C8-4504-B4C5-377C85F7BB3D}.Release|x64.Build.0 = Release|x64 22 | {F720C7B4-D9C8-4504-B4C5-377C85F7BB3D}.Release|x86.ActiveCfg = Release|Win32 23 | {F720C7B4-D9C8-4504-B4C5-377C85F7BB3D}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {6CAE6330-CDEF-4F5E-A99E-86980BDFF4FC} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /LiteSDKGenerator/Global.cpp: -------------------------------------------------------------------------------- 1 | #include "Global.h" 2 | #include "SDKTypes.h" 3 | 4 | using namespace Updates; 5 | 6 | void ObjectsStore::Init(uint64 address) 7 | { 8 | objObjects = Dec::objobjects(Global::GameMemory->Read64(address)); 9 | objCounts = Global::GameMemory->Read32(address + 0x10); 10 | } 11 | 12 | int ObjectsStore::GetObjectsNum() 13 | { 14 | return objCounts; 15 | } 16 | 17 | UEObject ObjectsStore::GetById(int id) 18 | { 19 | return UEObject(Global::GameMemory->Read64(objObjects + 0x18 * id)); 20 | } 21 | 22 | UEClass ObjectsStore::FindClass(std::string className) 23 | { 24 | for (int i = 0; i < GetObjectsNum(); i++) 25 | { 26 | UEObject obj = UEObject(GetById(i)); 27 | if (obj.GetFullName() == className) 28 | { 29 | return obj.Cast(); 30 | } 31 | } 32 | return UEClass(0); 33 | } 34 | 35 | uint64 ObjectsStore::GetAddress() 36 | { 37 | return objObjects; 38 | } 39 | 40 | void NamesStore::Init(uint64 address) 41 | { 42 | baseAddress = Global::GameMemory->Read64(address + Off::static_gnames); 43 | count = 100; 44 | } 45 | 46 | std::string NamesStore::GetById(int Index) 47 | { 48 | int32_t ChunkIndex = Index / Off::chunksize; 49 | int32_t WithinChunkIndex = Index % Off::chunksize; 50 | uint64 Chunk = baseAddress + ChunkIndex * 0x8; 51 | uint64 Name = Global::GameMemory->Read64(Global::GameMemory->Read64(Chunk) + WithinChunkIndex*0x8); 52 | char name[100] = { NULL }; 53 | if (Global::GameMemory->ReadString(Name + 0x10, name, 100) != 0) 54 | { 55 | std::string string = std::string(name); 56 | return string; 57 | } 58 | return std::string("NULL"); 59 | } 60 | 61 | uint64 NamesStore::GetAddress() 62 | { 63 | return baseAddress; 64 | } 65 | 66 | int NamesStore::GetNamesNum() 67 | { 68 | return count; 69 | } 70 | 71 | void NamesStore::SetBase(uint64 address) 72 | { 73 | baseAddress = address; 74 | count = 100; 75 | } -------------------------------------------------------------------------------- /LiteSDKGenerator/Global.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Main.h" 3 | #include "Memory.h" 4 | #include "SDKGenerator.h" 5 | #include "Updates.h" 6 | #include 7 | 8 | class UEObject; 9 | class UEClass; 10 | 11 | ref class NamesStore 12 | { 13 | public: 14 | void Init(uint64 address); 15 | 16 | std::string GetById(int); 17 | 18 | uint64 GetAddress(); 19 | 20 | int GetNamesNum(); 21 | 22 | void SetBase(uint64 address); 23 | private: 24 | uint64 baseAddress; 25 | int count; 26 | }; 27 | 28 | ref class ObjectsStore 29 | { 30 | public: 31 | void Init(uint64 address); 32 | 33 | UEClass FindClass(std::string); 34 | 35 | uint64 GetAddress(); 36 | 37 | int GetObjectsNum(); 38 | 39 | UEObject GetById(int id); 40 | 41 | template 42 | int CountObjects(const std::string& name) 43 | { 44 | static std::unordered_map cache; 45 | 46 | auto it = cache.find(name); 47 | if (it != std::end(cache)) 48 | { 49 | return it->second; 50 | } 51 | 52 | int count = 0; 53 | for (int i = 0; i < GetObjectsNum(); i++) 54 | { 55 | auto obj = GetById(i); 56 | if (obj.IsValid() && obj.IsA()&& obj.GetName() == name) 57 | { 58 | ++count; 59 | } 60 | } 61 | cache[name] = count; 62 | return count; 63 | } 64 | private: 65 | uint64 objObjects; 66 | int objCounts; 67 | }; 68 | 69 | ref class Global 70 | { 71 | public: 72 | static LiteSDKGenerator::Main^ MainForm = gcnew LiteSDKGenerator::Main; 73 | static Memory^ GameMemory = gcnew Memory; 74 | static NamesStore^ Names = gcnew NamesStore(); 75 | static ObjectsStore^ Objects = gcnew ObjectsStore(); 76 | static SDKGenerator^ Generator = gcnew SDKGenerator(); 77 | static void LogLine(String^ text) 78 | { 79 | MainForm->LogBox->AppendText(text); 80 | MainForm->LogBox->AppendText("\n"); 81 | MainForm->LogBox->ScrollToCaret(); 82 | } 83 | static void LogLine(String^ format, ...array^ args) 84 | { 85 | String^ text = String::Format(format, args); 86 | MainForm->LogBox->AppendText(text); 87 | MainForm->LogBox->AppendText("\n"); 88 | MainForm->LogBox->ScrollToCaret(); 89 | } 90 | static void Log(String^ text) 91 | { 92 | MainForm->LogBox->AppendText(text); 93 | MainForm->LogBox->ScrollToCaret(); 94 | } 95 | static void Log(String^ format, ...array^ args) 96 | { 97 | String^ text = String::Format(format, args); 98 | MainForm->LogBox->AppendText(text); 99 | MainForm->LogBox->ScrollToCaret(); 100 | } 101 | 102 | static void LogSplit() 103 | { 104 | MainForm->LogBox->AppendText("--------------------------------------------------------\n"); 105 | MainForm->LogBox->ScrollToCaret(); 106 | } 107 | }; 108 | -------------------------------------------------------------------------------- /LiteSDKGenerator/LiteSDKGenerator.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | {F720C7B4-D9C8-4504-B4C5-377C85F7BB3D} 24 | v4.7.2 25 | ManagedCProj 26 | LiteSDKGenerator 27 | 10.0 28 | 29 | 30 | 31 | Application 32 | true 33 | v142 34 | true 35 | MultiByte 36 | 37 | 38 | Application 39 | false 40 | v142 41 | true 42 | MultiByte 43 | 44 | 45 | Application 46 | true 47 | v142 48 | true 49 | MultiByte 50 | 51 | 52 | Application 53 | false 54 | v142 55 | true 56 | MultiByte 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | true 78 | 79 | 80 | false 81 | 82 | 83 | false 84 | 85 | 86 | false 87 | 88 | 89 | 90 | Level3 91 | Disabled 92 | WIN32;_DEBUG;%(PreprocessorDefinitions) 93 | 94 | 95 | 96 | Console 97 | Main 98 | RequireAdministrator 99 | 100 | 101 | 102 | 103 | Level3 104 | Disabled 105 | _DEBUG;%(PreprocessorDefinitions) 106 | 107 | 108 | 109 | Console 110 | Main 111 | RequireAdministrator 112 | 113 | 114 | 115 | 116 | Level3 117 | WIN32;NDEBUG;%(PreprocessorDefinitions) 118 | 119 | 120 | 121 | Console 122 | Main 123 | RequireAdministrator 124 | 125 | 126 | 127 | 128 | Level3 129 | NDEBUG;%(PreprocessorDefinitions) 130 | 131 | 132 | 133 | Console 134 | Main 135 | RequireAdministrator 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | CppForm 160 | 161 | 162 | 163 | 164 | 165 | 166 | Main.h 167 | 168 | 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /LiteSDKGenerator/LiteSDKGenerator.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | -------------------------------------------------------------------------------- /LiteSDKGenerator/Main.cpp: -------------------------------------------------------------------------------- 1 | #include "Global.h" 2 | #include "SDKTypes.h" 3 | using namespace System; 4 | using namespace System::Windows::Forms; 5 | using namespace System::Collections::Generic; 6 | using namespace System::IO; 7 | using namespace LiteSDKGenerator; 8 | 9 | using namespace Updates; 10 | using namespace Settings; 11 | 12 | std::string managedStrToNative(System::String^ sysstr); 13 | 14 | std::string managedStrToNative(System::String^ sysstr) 15 | { 16 | using System::IntPtr; 17 | using System::Runtime::InteropServices::Marshal; 18 | 19 | IntPtr ip = Marshal::StringToHGlobalAnsi(sysstr); 20 | std::string outString = static_cast(ip.ToPointer()); 21 | Marshal::FreeHGlobal(ip); 22 | return outString; 23 | } 24 | 25 | [STAThread] 26 | void Main(array^ args) 27 | { 28 | Application::Run(Global::MainForm); 29 | } 30 | 31 | System::Void Main::Main_Load(System::Object^ sender, System::EventArgs^ e) 32 | { 33 | Global::LogLine("Process: " + ManagedStr(ProcessName)); 34 | Global::LogLine("Module: " + ManagedStr(MoudleName)); 35 | bool status = Global::GameMemory->Init(); 36 | if (!status) 37 | { 38 | MessageBox::Show("Game not Found!"); 39 | Application::Exit(); 40 | } 41 | Global::Names->Init(Global::GameMemory->GetBase() + Off::GNames); 42 | Global::Objects->Init(Global::GameMemory->GetBase() + Off::ObjObjects); 43 | Global::LogLine("GNames: {0:x}\nNamesNum: {1}", Global::Names->GetAddress(), Global::Names->GetNamesNum()); 44 | Global::LogLine("GObjects: {0:x}\nObjectsNum: {1}", Global::Objects->GetAddress(), Global::Objects->GetObjectsNum()); 45 | } 46 | 47 | System::Void Main::Main_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e) 48 | { 49 | Global::GameMemory->Close(); 50 | } 51 | 52 | System::Void Main::btnDumpSDK_Click(System::Object^ sender, System::EventArgs^ e) 53 | { 54 | if (!cbAll->Checked && !cbSDK->Checked && !cbGObj->Checked) 55 | { 56 | MessageBox::Show("Check at least one output type"); 57 | return; 58 | } 59 | if (folderBrowserDialog1->ShowDialog() == Windows::Forms::DialogResult::OK) 60 | { 61 | std::string OutputDirectory = NativeStr(folderBrowserDialog1->SelectedPath + "\\"); 62 | if (cbSDK->Checked) 63 | { 64 | String^ sdkdir = ManagedStr(OutputDirectory + SDKFolderName); 65 | if (!Directory::Exists(sdkdir)) 66 | Directory::CreateDirectory(sdkdir); 67 | Global::Generator->DumpSDK(OutputDirectory + SDKFolderName + "\\", false); 68 | } 69 | if (cbAll->Checked) 70 | { 71 | Global::Generator->DumpSDK(OutputDirectory, true); 72 | } 73 | if (cbGObj->Checked) 74 | { 75 | Global::Generator->DumpObjectsTxt(OutputDirectory); 76 | } 77 | 78 | if (MessageBox::Show("Show Files In Explorer?", "Dump Finished", MessageBoxButtons::YesNo) == ::DialogResult::Yes) 79 | { 80 | Process::Start(ManagedStr(OutputDirectory)); 81 | } 82 | } 83 | } 84 | 85 | System::Void Main::btnNamesDump_Click(System::Object^ sender, System::EventArgs^ e) 86 | { 87 | if (folderBrowserDialog1->ShowDialog() == Windows::Forms::DialogResult::OK) 88 | { 89 | std::string OutputDirectory = NativeStr(folderBrowserDialog1->SelectedPath + "\\"); 90 | Global::Generator->DumpNamesTxt(OutputDirectory); 91 | if (MessageBox::Show("Show Files In Explorer?", "Dump Finished", MessageBoxButtons::YesNo) == ::DialogResult::Yes) 92 | { 93 | Process::Start(ManagedStr(OutputDirectory)); 94 | } 95 | } 96 | } 97 | 98 | System::Void Main::btnTest_Click(System::Object^ sender, System::EventArgs^ e) 99 | { 100 | Global::LogSplit(); 101 | Global::LogLine(String::Format("Name ID = 1001: {0}", ManagedStr(Global::Names->GetById(1001)))); 102 | for (int i = 0; i < 5; i++) 103 | { 104 | Global::LogSplit(); 105 | Global::LogLine("Object Address: {0:X}", Global::Objects->GetById(i).GetAddress()); 106 | Global::LogLine("Index ID: {0}", Global::Objects->GetById(i).GetIndex()); 107 | Global::Log("Name ID: {0} ", Global::Objects->GetById(i).GetComparisonIndex()); 108 | Global::LogLine("Name: {0}", ManagedStr(Global::Names->GetById(Global::Objects->GetById(i).GetComparisonIndex()))); 109 | Global::Log("Class ID: {0} ", Global::Objects->GetById(i).GetClass().GetIndex()); 110 | Global::LogLine("Name: {0}", ManagedStr(Global::Names->GetById(Global::Objects->GetById(Global::Objects->GetById(i).GetClass().GetIndex()).GetComparisonIndex()))); 111 | Global::Log("Outer ID: {0} ", Global::Objects->GetById(i).GetOuter().GetIndex()); 112 | Global::LogLine("Name: {0}", ManagedStr(Global::Names->GetById(Global::Objects->GetById(Global::Objects->GetById(i).GetClass().GetIndex()).GetComparisonIndex()))); 113 | } 114 | } 115 | 116 | Void Main::btnFindGName_Click(System::Object^ sender, System::EventArgs^ e) 117 | { 118 | MessageBox::Show("Make sure you've updated them in Updates.cpp:\n" 119 | + "Off::GNames" + "\n" 120 | + "Off::chunksize"); 121 | Global::LogSplit(); 122 | Global::LogLine("Finding static GNames from offset: {0:X}, chunksize = {1:X}", Global::GameMemory->GetBase() + Off::GNames, Off::chunksize); 123 | for (int64 i = -0x50000; i <= 0x50000; i++) 124 | { 125 | uint64 GNamesPtr = Global::GameMemory->Read64(Global::GameMemory->GetBase() + Off::GNames + i * 4); 126 | Global::Names->SetBase(GNamesPtr); 127 | if (Global::Names->GetById(1) == "ByteProperty") 128 | { 129 | Global::LogLine(String::Format("Found static GNames at offset: {0:X} , step = {1}", i * 4 , i)); 130 | return; 131 | } 132 | } 133 | Global::LogLine("Couldn't found"); 134 | } 135 | 136 | 137 | System::Void Main::btnAutoUpdate_Click(System::Object^ sender, System::EventArgs^ e) 138 | { 139 | MessageBox::Show("Make sure you've updated them in Updates.cpp:\n" 140 | + "Off:\n" 141 | + "\\\\Main" + "\n" 142 | + "\\\\GNames" + "\n" 143 | + "\\\\UObject" + "\n" 144 | + "\\\\FName" + "\n" 145 | + "Dec:\n" 146 | + "\\\\UObject" + "\n" 147 | + "\\\\FName" + "\n"); 148 | std::unordered_map searchingString; 149 | searchingString.insert(std::pair{"ScriptStruct CoreUObject.Vector", 0}); 150 | searchingString.insert(std::pair("FloatProperty CoreUObject.Vector.X", 0)); 151 | searchingString.insert(std::pair("FloatProperty CoreUObject.Vector.Y", 0)); 152 | searchingString.insert(std::pair("FloatProperty CoreUObject.Vector.Z", 0)); 153 | searchingString.insert(std::pair("Class Engine.Actor", 0)); 154 | searchingString.insert(std::pair("Class Engine.Pawn", 0)); 155 | searchingString.insert(std::pair("Class CoreUObject.Property", 0)); 156 | searchingString.insert(std::pair("Function Engine.Actor.WasRecentlyRendered", 0)); 157 | searchingString.insert(std::pair("Enum Engine.ETextGender", 0)); 158 | progressBar1->Maximum = 9; 159 | int count = 0; 160 | for (int i = 0; i < Global::Objects->GetObjectsNum(); i++) 161 | { 162 | auto obj = Global::Objects->GetById(i); 163 | if (searchingString.count(obj.GetFullName()) == 1) 164 | { 165 | searchingString[obj.GetFullName()] = Global::Objects->GetById(i).GetAddress(); 166 | count++; 167 | progressBar1->Value = count; 168 | if (count == 9) 169 | { 170 | break; 171 | } 172 | } 173 | } 174 | Global::LogSplit(); 175 | Global::LogLine("Auto Update Result:\n"); 176 | int next, enumNames, array_dim, element_size, offset, property_flag, superfield, property_size, children, function_flags, func, uproperty_size; 177 | for (int i = 0x20; i < 0x50; i += 4) 178 | { 179 | uint64 nextPtr = Global::GameMemory->Read64(searchingString["FloatProperty CoreUObject.Vector.X"] + i); 180 | if (nextPtr == searchingString["FloatProperty CoreUObject.Vector.Y"] && Global::GameMemory->Read64(searchingString["FloatProperty CoreUObject.Vector.Y"] + i) == searchingString["FloatProperty CoreUObject.Vector.Z"]) 181 | { 182 | next = i; 183 | break; 184 | } 185 | } 186 | for (int i = 0x30; i < 0xa0; i += 4) 187 | { 188 | if (Global::GameMemory->Read32(searchingString["Enum Engine.ETextGender"] + i + 0x8) == 0x4) 189 | { 190 | if (Global::GameMemory->Read32(searchingString["Enum Engine.ETextGender"] + i + 0xc) == 0x18) 191 | { 192 | enumNames = i; 193 | break; 194 | } 195 | } 196 | } 197 | for (int i = 0x28; i < 0xa0; i += 4) 198 | { 199 | if (Global::GameMemory->Read32(searchingString["FloatProperty CoreUObject.Vector.Z"] + i) == 1) 200 | { 201 | if (Global::GameMemory->Read32(searchingString["FloatProperty CoreUObject.Vector.Y"] + i) == 1) 202 | { 203 | if (Global::GameMemory->Read32(searchingString["FloatProperty CoreUObject.Vector.X"] + i) == 1) 204 | { 205 | array_dim = i; 206 | break; 207 | } 208 | } 209 | } 210 | } 211 | for (int i = 0x28; i < 0xa0; i += 4) 212 | { 213 | if (Global::GameMemory->Read32(searchingString["FloatProperty CoreUObject.Vector.Z"] + i) == 4) 214 | { 215 | if (Global::GameMemory->Read32(searchingString["FloatProperty CoreUObject.Vector.Y"] + i) == 4) 216 | { 217 | if (Global::GameMemory->Read32(searchingString["FloatProperty CoreUObject.Vector.X"] + i) == 4) 218 | { 219 | element_size = i; 220 | break; 221 | } 222 | } 223 | } 224 | } 225 | for (int i = 0x28; i < 0xa0; i += 4) 226 | { 227 | if (Global::GameMemory->Read32(searchingString["FloatProperty CoreUObject.Vector.Z"] + i) == 0x8) 228 | { 229 | if (Global::GameMemory->Read32(searchingString["FloatProperty CoreUObject.Vector.Y"] + i) == 0x4) 230 | { 231 | if (Global::GameMemory->Read32(searchingString["FloatProperty CoreUObject.Vector.X"] + i) == 0x0) 232 | { 233 | offset = i; 234 | break; 235 | } 236 | } 237 | } 238 | } 239 | for (int i = 0x30; i < 0xa0; i += 4) 240 | { 241 | if (StringifyFlags(static_cast(Global::GameMemory->Read(searchingString["FloatProperty CoreUObject.Vector.Z"] + i).A)) == "Edit, BlueprintVisible, ZeroConstructor, SaveGame, IsPlainOldData") 242 | { 243 | if (StringifyFlags(static_cast(Global::GameMemory->Read(searchingString["FloatProperty CoreUObject.Vector.Y"] + i).A)) == "Edit, BlueprintVisible, ZeroConstructor, SaveGame, IsPlainOldData") 244 | { 245 | if (StringifyFlags(static_cast(Global::GameMemory->Read(searchingString["FloatProperty CoreUObject.Vector.X"] + i).A)) == "Edit, BlueprintVisible, ZeroConstructor, SaveGame, IsPlainOldData") 246 | { 247 | property_flag = i; 248 | break; 249 | } 250 | } 251 | } 252 | } 253 | for (int i = 0x28; i < 0xa0; i += 4) 254 | { 255 | if (Global::GameMemory->Read64(searchingString["Class Engine.Pawn"] + i) == searchingString["Class Engine.Actor"]) 256 | { 257 | superfield = i; 258 | break; 259 | } 260 | } 261 | for (int i = 0x24; i < 0xe0; i += 4) 262 | { 263 | if (Global::GameMemory->Read32(searchingString["ScriptStruct CoreUObject.Vector"] + i) == 12) 264 | { 265 | property_size = i; 266 | break; 267 | } 268 | } 269 | for (int i = 0x28; i < 0xa0; i += 4) 270 | { 271 | if (Global::GameMemory->Read64(searchingString["ScriptStruct CoreUObject.Vector"] + i) == searchingString["FloatProperty CoreUObject.Vector.X"]) 272 | { 273 | children = i; 274 | break; 275 | } 276 | } 277 | for (int i = 0x70; i < 0xff; i += 4) 278 | { 279 | if (StringifyFlags(static_cast(Global::GameMemory->Read64(searchingString["Function Engine.Actor.WasRecentlyRendered"] + i))) == "Final, Native, Public, BlueprintCallable, BlueprintPure, Const") 280 | { 281 | function_flags = i; 282 | } 283 | } 284 | for (int i = 0x70; i < 0xff; i += 4) 285 | { 286 | func = Global::GameMemory->Read32(searchingString["Function Engine.Actor.WasRecentlyRendered"] + i); 287 | if (func >= 0x7FF0 && func <= 0x7FFF) 288 | { 289 | func = i; 290 | func = i - 0x4; 291 | break; 292 | } 293 | } 294 | uproperty_size = Global::GameMemory->Read32(searchingString["Class CoreUObject.Property"] + property_size); 295 | Global::Log(ManagedStr(OutPutString),next,enumNames,superfield,property_size,children,func,function_flags,array_dim,element_size,offset,property_flag,uproperty_size); 296 | } 297 | 298 | System::Void Main::btnUpdateUseful_Click(System::Object^ sender, System::EventArgs^ e) 299 | { 300 | Global::Generator->DumpUseful(); 301 | } -------------------------------------------------------------------------------- /LiteSDKGenerator/Main.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define ManagedStr(x) (gcnew String((x).c_str())) 3 | #define NativeStr(x) (managedStrToNative(x)) 4 | namespace LiteSDKGenerator { 5 | using namespace System; 6 | using namespace System::ComponentModel; 7 | using namespace System::Collections; 8 | using namespace System::Windows::Forms; 9 | using namespace System::Data; 10 | using namespace System::Drawing; 11 | /// 12 | /// Summary for Main 13 | /// 14 | public ref class Main : public System::Windows::Forms::Form 15 | { 16 | public: 17 | Main(void) 18 | { 19 | Application::EnableVisualStyles(); 20 | InitializeComponent(); 21 | } 22 | 23 | protected: 24 | ~Main() 25 | { 26 | if (components) 27 | { 28 | delete components; 29 | } 30 | } 31 | private: System::Windows::Forms::Button^ btnDumpSDK; 32 | 33 | public: System::Windows::Forms::ProgressBar^ progressBar1; 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | private: System::Windows::Forms::Button^ btnTest; 42 | private: System::Windows::Forms::Button^ btnGName; 43 | 44 | 45 | 46 | private: System::Windows::Forms::FolderBrowserDialog^ folderBrowserDialog1; 47 | private: System::Windows::Forms::Button^ btnAutoUpdate; 48 | private: System::Windows::Forms::CheckBox^ cbSDK; 49 | private: System::Windows::Forms::CheckBox^ cbAll; 50 | private: System::Windows::Forms::CheckBox^ cbGObj; 51 | private: System::Windows::Forms::Button^ btnNamesDump; 52 | public: System::Windows::Forms::RichTextBox^ LogBox; 53 | private: System::Windows::Forms::Panel^ panel1; 54 | private: System::Windows::Forms::Button^ btnUpdateUseful; 55 | 56 | public: 57 | private: 58 | 59 | private: 60 | 61 | private: 62 | System::ComponentModel::Container ^components; 63 | 64 | #pragma region Windows Form Designer generated code 65 | void InitializeComponent(void) 66 | { 67 | this->btnDumpSDK = (gcnew System::Windows::Forms::Button()); 68 | this->progressBar1 = (gcnew System::Windows::Forms::ProgressBar()); 69 | this->btnTest = (gcnew System::Windows::Forms::Button()); 70 | this->btnGName = (gcnew System::Windows::Forms::Button()); 71 | this->folderBrowserDialog1 = (gcnew System::Windows::Forms::FolderBrowserDialog()); 72 | this->btnAutoUpdate = (gcnew System::Windows::Forms::Button()); 73 | this->cbSDK = (gcnew System::Windows::Forms::CheckBox()); 74 | this->cbAll = (gcnew System::Windows::Forms::CheckBox()); 75 | this->cbGObj = (gcnew System::Windows::Forms::CheckBox()); 76 | this->btnNamesDump = (gcnew System::Windows::Forms::Button()); 77 | this->LogBox = (gcnew System::Windows::Forms::RichTextBox()); 78 | this->panel1 = (gcnew System::Windows::Forms::Panel()); 79 | this->btnUpdateUseful = (gcnew System::Windows::Forms::Button()); 80 | this->panel1->SuspendLayout(); 81 | this->SuspendLayout(); 82 | // 83 | // btnDumpSDK 84 | // 85 | this->btnDumpSDK->Location = System::Drawing::Point(127, 44); 86 | this->btnDumpSDK->Margin = System::Windows::Forms::Padding(4); 87 | this->btnDumpSDK->Name = L"btnDumpSDK"; 88 | this->btnDumpSDK->Size = System::Drawing::Size(115, 32); 89 | this->btnDumpSDK->TabIndex = 0; 90 | this->btnDumpSDK->Text = L"Export SDK"; 91 | this->btnDumpSDK->UseVisualStyleBackColor = true; 92 | this->btnDumpSDK->Click += gcnew System::EventHandler(this, &Main::btnDumpSDK_Click); 93 | // 94 | // progressBar1 95 | // 96 | this->progressBar1->Anchor = static_cast(((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left) 97 | | System::Windows::Forms::AnchorStyles::Right)); 98 | this->progressBar1->Location = System::Drawing::Point(12, 644); 99 | this->progressBar1->Margin = System::Windows::Forms::Padding(4); 100 | this->progressBar1->Name = L"progressBar1"; 101 | this->progressBar1->Size = System::Drawing::Size(667, 33); 102 | this->progressBar1->TabIndex = 2; 103 | // 104 | // btnTest 105 | // 106 | this->btnTest->Location = System::Drawing::Point(4, 4); 107 | this->btnTest->Margin = System::Windows::Forms::Padding(4); 108 | this->btnTest->Name = L"btnTest"; 109 | this->btnTest->Size = System::Drawing::Size(115, 32); 110 | this->btnTest->TabIndex = 12; 111 | this->btnTest->Text = L"UObject Test"; 112 | this->btnTest->UseVisualStyleBackColor = true; 113 | this->btnTest->Click += gcnew System::EventHandler(this, &Main::btnTest_Click); 114 | // 115 | // btnGName 116 | // 117 | this->btnGName->AccessibleRole = System::Windows::Forms::AccessibleRole::None; 118 | this->btnGName->Location = System::Drawing::Point(129, 4); 119 | this->btnGName->Margin = System::Windows::Forms::Padding(4); 120 | this->btnGName->Name = L"btnGName"; 121 | this->btnGName->Size = System::Drawing::Size(115, 32); 122 | this->btnGName->TabIndex = 13; 123 | this->btnGName->Text = L"Find GName"; 124 | this->btnGName->UseVisualStyleBackColor = true; 125 | this->btnGName->Click += gcnew System::EventHandler(this, &Main::btnFindGName_Click); 126 | // 127 | // btnAutoUpdate 128 | // 129 | this->btnAutoUpdate->AccessibleRole = System::Windows::Forms::AccessibleRole::None; 130 | this->btnAutoUpdate->Location = System::Drawing::Point(252, 4); 131 | this->btnAutoUpdate->Margin = System::Windows::Forms::Padding(4); 132 | this->btnAutoUpdate->Name = L"btnAutoUpdate"; 133 | this->btnAutoUpdate->Size = System::Drawing::Size(115, 32); 134 | this->btnAutoUpdate->TabIndex = 17; 135 | this->btnAutoUpdate->Text = L"Auto Update"; 136 | this->btnAutoUpdate->UseVisualStyleBackColor = true; 137 | this->btnAutoUpdate->Click += gcnew System::EventHandler(this, &Main::btnAutoUpdate_Click); 138 | // 139 | // cbSDK 140 | // 141 | this->cbSDK->AutoSize = true; 142 | this->cbSDK->Checked = true; 143 | this->cbSDK->CheckState = System::Windows::Forms::CheckState::Checked; 144 | this->cbSDK->Location = System::Drawing::Point(250, 54); 145 | this->cbSDK->Margin = System::Windows::Forms::Padding(4); 146 | this->cbSDK->Name = L"cbSDK"; 147 | this->cbSDK->Size = System::Drawing::Size(52, 22); 148 | this->cbSDK->TabIndex = 18; 149 | this->cbSDK->Text = L"SDK"; 150 | this->cbSDK->UseVisualStyleBackColor = true; 151 | // 152 | // cbAll 153 | // 154 | this->cbAll->AutoSize = true; 155 | this->cbAll->Checked = true; 156 | this->cbAll->CheckState = System::Windows::Forms::CheckState::Checked; 157 | this->cbAll->Location = System::Drawing::Point(302, 54); 158 | this->cbAll->Margin = System::Windows::Forms::Padding(4); 159 | this->cbAll->Name = L"cbAll"; 160 | this->cbAll->Size = System::Drawing::Size(113, 22); 161 | this->cbAll->TabIndex = 19; 162 | this->cbAll->Text = L"SDK in one file"; 163 | this->cbAll->UseVisualStyleBackColor = true; 164 | // 165 | // cbGObj 166 | // 167 | this->cbGObj->AutoSize = true; 168 | this->cbGObj->Checked = true; 169 | this->cbGObj->CheckState = System::Windows::Forms::CheckState::Checked; 170 | this->cbGObj->Location = System::Drawing::Point(414, 54); 171 | this->cbGObj->Margin = System::Windows::Forms::Padding(4); 172 | this->cbGObj->Name = L"cbGObj"; 173 | this->cbGObj->Size = System::Drawing::Size(103, 22); 174 | this->cbGObj->TabIndex = 20; 175 | this->cbGObj->Text = L"GlobalObects"; 176 | this->cbGObj->UseVisualStyleBackColor = true; 177 | // 178 | // btnNamesDump 179 | // 180 | this->btnNamesDump->Location = System::Drawing::Point(4, 44); 181 | this->btnNamesDump->Margin = System::Windows::Forms::Padding(4); 182 | this->btnNamesDump->Name = L"btnNamesDump"; 183 | this->btnNamesDump->Size = System::Drawing::Size(115, 32); 184 | this->btnNamesDump->TabIndex = 21; 185 | this->btnNamesDump->Text = L"Export Names"; 186 | this->btnNamesDump->UseVisualStyleBackColor = true; 187 | this->btnNamesDump->Click += gcnew System::EventHandler(this, &Main::btnNamesDump_Click); 188 | // 189 | // LogBox 190 | // 191 | this->LogBox->Anchor = static_cast((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom) 192 | | System::Windows::Forms::AnchorStyles::Left) 193 | | System::Windows::Forms::AnchorStyles::Right)); 194 | this->LogBox->Font = (gcnew System::Drawing::Font(L"PingFang SC0", 9.749999F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 195 | static_cast(134))); 196 | this->LogBox->Location = System::Drawing::Point(12, 98); 197 | this->LogBox->Name = L"LogBox"; 198 | this->LogBox->ReadOnly = true; 199 | this->LogBox->Size = System::Drawing::Size(667, 534); 200 | this->LogBox->TabIndex = 22; 201 | this->LogBox->Text = L""; 202 | // 203 | // panel1 204 | // 205 | this->panel1->Anchor = static_cast(((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Left) 206 | | System::Windows::Forms::AnchorStyles::Right)); 207 | this->panel1->Controls->Add(this->btnUpdateUseful); 208 | this->panel1->Controls->Add(this->btnTest); 209 | this->panel1->Controls->Add(this->btnDumpSDK); 210 | this->panel1->Controls->Add(this->btnNamesDump); 211 | this->panel1->Controls->Add(this->btnGName); 212 | this->panel1->Controls->Add(this->cbGObj); 213 | this->panel1->Controls->Add(this->btnAutoUpdate); 214 | this->panel1->Controls->Add(this->cbAll); 215 | this->panel1->Controls->Add(this->cbSDK); 216 | this->panel1->Location = System::Drawing::Point(12, 12); 217 | this->panel1->Name = L"panel1"; 218 | this->panel1->Size = System::Drawing::Size(667, 80); 219 | this->panel1->TabIndex = 23; 220 | // 221 | // btnUpdateUseful 222 | // 223 | this->btnUpdateUseful->Location = System::Drawing::Point(525, 47); 224 | this->btnUpdateUseful->Margin = System::Windows::Forms::Padding(4); 225 | this->btnUpdateUseful->Name = L"btnUpdateUseful"; 226 | this->btnUpdateUseful->Size = System::Drawing::Size(135, 32); 227 | this->btnUpdateUseful->TabIndex = 22; 228 | this->btnUpdateUseful->Text = L"Export Useful"; 229 | this->btnUpdateUseful->UseVisualStyleBackColor = true; 230 | this->btnUpdateUseful->Click += gcnew System::EventHandler(this, &Main::btnUpdateUseful_Click); 231 | // 232 | // Main 233 | // 234 | this->AutoScaleDimensions = System::Drawing::SizeF(7, 18); 235 | this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; 236 | this->ClientSize = System::Drawing::Size(685, 689); 237 | this->Controls->Add(this->panel1); 238 | this->Controls->Add(this->LogBox); 239 | this->Controls->Add(this->progressBar1); 240 | this->Font = (gcnew System::Drawing::Font(L"PingFang SC0", 9.749999F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 241 | static_cast(134))); 242 | this->Margin = System::Windows::Forms::Padding(4); 243 | this->Name = L"Main"; 244 | this->ShowIcon = false; 245 | this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen; 246 | this->Text = L"Lite SDK Generator - COHENRENCE"; 247 | this->FormClosing += gcnew System::Windows::Forms::FormClosingEventHandler(this, &Main::Main_FormClosing); 248 | this->Load += gcnew System::EventHandler(this, &Main::Main_Load); 249 | this->panel1->ResumeLayout(false); 250 | this->panel1->PerformLayout(); 251 | this->ResumeLayout(false); 252 | 253 | } 254 | #pragma endregion 255 | 256 | private: System::Void btnDumpSDK_Click(System::Object^ sender, System::EventArgs^ e); 257 | private: System::Void Main_FormClosing(System::Object^ sender, System::Windows::Forms::FormClosingEventArgs^ e); 258 | private: System::Void Main_Load(System::Object^ sender, System::EventArgs^ e); 259 | private: System::Void btnTest_Click(System::Object^ sender, System::EventArgs^ e); 260 | private: System::Void btnFindGName_Click(System::Object^ sender, System::EventArgs^ e); 261 | private: System::Void btnAutoUpdate_Click(System::Object^ sender, System::EventArgs^ e); 262 | private: System::Void btnNamesDump_Click(System::Object^ sender, System::EventArgs^ e); 263 | private: System::Void btnUpdateUseful_Click(System::Object^ sender, System::EventArgs^ e); 264 | }; 265 | } 266 | -------------------------------------------------------------------------------- /LiteSDKGenerator/Main.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | -------------------------------------------------------------------------------- /LiteSDKGenerator/Memory.cpp: -------------------------------------------------------------------------------- 1 | #include "Global.h" 2 | 3 | bool Memory::Init() 4 | { 5 | HANDLE hToken = nullptr; 6 | LUID luid; 7 | 8 | if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken)) return FALSE; 9 | if (!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &luid)) return FALSE; 10 | 11 | TOKEN_PRIVILEGES tokenPriv; 12 | tokenPriv.PrivilegeCount = 1; 13 | tokenPriv.Privileges[0].Luid = luid; 14 | tokenPriv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 15 | 16 | if (!AdjustTokenPrivileges(hToken, FALSE, &tokenPriv, sizeof(TOKEN_PRIVILEGES), NULL, NULL)) 17 | { 18 | Global::LogLine("SeDebugPrivilege Error: " + (int)GetLastError()); 19 | return false; 20 | } 21 | 22 | HWND hWnd = FindWindow(Settings::WindowsClass.c_str(), Settings::WindowsCaption.c_str()); 23 | DWORD Pid = 0; 24 | GetWindowThreadProcessId(hWnd, &Pid); 25 | if (Pid == 0) 26 | { 27 | Global::LogLine("GetWindowThreadProcessId Error: " + (int)GetLastError()); 28 | return false; 29 | } 30 | hProcess = OpenProcess(PROCESS_ALL_ACCESS, false, Pid); 31 | if (hProcess == 0) 32 | { 33 | Global::LogLine("OpenProcess Error: " + (int)GetLastError()); 34 | return false; 35 | } 36 | 37 | HMODULE hMods[512]; 38 | DWORD cb; 39 | if (EnumProcessModulesEx(hProcess, hMods, sizeof(hMods), &cb, LIST_MODULES_ALL)) 40 | { 41 | char szModName[MAX_PATH] = { NULL }; 42 | for (int i = 0; i < cb / sizeof(HMODULE); i++) 43 | { 44 | GetModuleBaseNameA(hProcess, hMods[i], szModName, MAX_PATH); 45 | if (!Settings::MoudleName.compare(szModName)) 46 | { 47 | Global::LogLine("PID: " + Pid.ToString()); 48 | Global::LogLine(String::Format("Base: {0:x}", (uint64_t)hMods[i])); 49 | Global::LogLine("Handle: " + ((uint64)hProcess).ToString()); 50 | Base = (uint64_t)hMods[i]; 51 | return true; 52 | } 53 | } 54 | } 55 | else 56 | { 57 | Global::LogLine("EnumProcessModulesEx Error: " + (int)GetLastError()); 58 | return false; 59 | } 60 | Global::LogLine("Module not found"); 61 | return false; 62 | } 63 | 64 | uint64_t Memory::GetBase() 65 | { 66 | return Base; 67 | } 68 | 69 | void Memory::Close() 70 | { 71 | CloseHandle(hProcess); 72 | } 73 | 74 | uint64_t Memory::Read64(uint64_t address) 75 | { 76 | return Read(address); 77 | } 78 | 79 | uint32_t Memory::Read32(uint64_t address) 80 | { 81 | return Read(address); 82 | } 83 | 84 | bool Memory::ReadWString(SIZE_T address, wchar_t* buff, DWORD bufSize) 85 | { 86 | return ReadProcessMemory(hProcess, (LPCVOID)address, buff, bufSize, NULL); 87 | } 88 | 89 | bool Memory::ReadString(SIZE_T address, char* buff, DWORD bufSize) 90 | { 91 | return ReadProcessMemory(hProcess, (LPCVOID)address, buff, bufSize, NULL); 92 | } -------------------------------------------------------------------------------- /LiteSDKGenerator/Memory.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #pragma comment(lib, "user32.lib") 6 | #pragma comment(lib, "Advapi32.lib") 7 | 8 | using namespace System; 9 | using namespace System::Diagnostics; 10 | 11 | ref class Memory 12 | { 13 | public: 14 | bool Memory::Init(); 15 | 16 | void Close(); 17 | 18 | uint64_t GetBase(); 19 | 20 | template 21 | T Read(uint64_t address) 22 | { 23 | T buff; 24 | ReadProcessMemory(hProcess, (LPCVOID)address, &buff, sizeof(T), NULL); 25 | return buff; 26 | } 27 | 28 | uint64_t Read64(uint64_t address); 29 | 30 | uint32_t Read32(uint64_t address); 31 | 32 | bool ReadWString(SIZE_T address, wchar_t* buff, DWORD bufSize); 33 | 34 | bool Memory::ReadString(SIZE_T address, char* buff, DWORD bufSize); 35 | 36 | private: 37 | HANDLE hProcess; 38 | 39 | uint64_t Base; 40 | }; -------------------------------------------------------------------------------- /LiteSDKGenerator/SDKGenerator.cpp: -------------------------------------------------------------------------------- 1 | #include "SDKGenerator.h" 2 | #include "Global.h" 3 | #include "SDKTypes.h" 4 | std::string GetTypeCppName(UEProperty prop); 5 | void ProcessPackages(std::string path, bool oneFile); 6 | bool ComparePropertyLess(const UEProperty& lhs, const UEProperty& rhs); 7 | Package::Member CreateBitfieldPadding(size_t id, size_t offset, std::string type, size_t bits); 8 | Package::Member CreatePadding(size_t id, size_t offset, size_t size, std::string reason); 9 | std::string BuildMethodSignature(const Package::Method& m, const Package::Class& c, bool inHeader); 10 | 11 | void SDKGenerator::DumpObjectsTxt(std::string path) 12 | { 13 | Global::LogSplit(); 14 | Global::LogLine("Exporting Objects Dump..."); 15 | Global::MainForm->progressBar1->Maximum = Global::Objects->GetObjectsNum(); 16 | std::ofstream o(path + Settings::GObjectsFileName); 17 | tfm::format(o, "%s\n", Settings::AuthorNotes); 18 | for (int i = 0; i < Global::Objects->GetObjectsNum(); i++) 19 | { 20 | Global::MainForm->progressBar1->Value = i + 1; 21 | auto obj = Global::Objects->GetById(i); 22 | if (!obj.IsValid()) 23 | { 24 | continue; 25 | } 26 | o << tfm::format("[%0x] %s\n", obj.GetAddress(), obj.GetFullName()); 27 | } 28 | o.close(); 29 | } 30 | 31 | void SDKGenerator::DumpNamesTxt(std::string path) 32 | { 33 | Global::LogSplit(); 34 | Global::LogLine("Exporting Names Dump..."); 35 | Global::MainForm->progressBar1->Maximum = 300000; 36 | std::ofstream o(path + Settings::NamesFileName); 37 | tfm::format(o, "%s\n", Settings::AuthorNotes); 38 | for (int i = 0; i < 300000; i++) 39 | { 40 | Global::MainForm->progressBar1->Value = i + 1; 41 | auto name = Global::Names->GetById(i); 42 | o << tfm::format("[%06d] %s\n", i, name); 43 | } 44 | o.close(); 45 | } 46 | 47 | void SDKGenerator::DumpSDK(std::string path,bool oneFile) 48 | { 49 | ProcessPackages(path, oneFile); 50 | } 51 | 52 | void ProcessPackages(std::string path,bool oneFile) 53 | { 54 | Global::LogSplit(); 55 | if (oneFile) 56 | Global::LogLine("Exporting SDK in one file..."); 57 | else 58 | Global::LogLine("Exporting SDK in separated files..."); 59 | 60 | const auto sdkPath = path + Settings::SDKFolderName; 61 | std::unordered_map packageObjects; 62 | Global::MainForm->progressBar1->Maximum = Global::Objects->GetObjectsNum(); 63 | 64 | Global::LogLine("Getting Packages..."); 65 | for (int i = 0; i < Global::Objects->GetObjectsNum(); i++) 66 | { 67 | auto obj = Global::Objects->GetById(i); 68 | Global::MainForm->progressBar1->Value = i + 1; 69 | if (obj.IsValid()) 70 | { 71 | auto packageAddr = obj.GetPackageObject().GetAddress(); 72 | packageObjects[packageAddr] = Package(packageAddr); 73 | } 74 | } 75 | Global::LogLine("Packages Count: {0}", packageObjects.size()); 76 | 77 | Global::LogLine("Getting Members..."); 78 | Global::MainForm->progressBar1->Maximum = Global::Objects->GetObjectsNum(); 79 | for (int i = 0; i < Global::Objects->GetObjectsNum(); i++) 80 | { 81 | auto obj = Global::Objects->GetById(i); 82 | Global::MainForm->progressBar1->Value = i + 1; 83 | if (obj.IsValid()) 84 | { 85 | auto packageAddr = obj.GetPackageObject().GetAddress(); 86 | packageObjects[packageAddr].Process(obj); 87 | } 88 | } 89 | Global::LogLine("Output..."); 90 | Global::MainForm->progressBar1->Maximum = (int)packageObjects.size(); 91 | Global::MainForm->progressBar1->Value = 0; 92 | std::ofstream o; 93 | bool authornotes = true; 94 | for (auto package : packageObjects) 95 | { 96 | if (oneFile&&!o.is_open()) 97 | { 98 | o.open(path + Settings::SDKAllFileName, std::ofstream::out | std::ofstream::app); 99 | if (authornotes) 100 | { 101 | tfm::format(o, "%s\n", Settings::AuthorNotes); 102 | authornotes = false; 103 | } 104 | 105 | } 106 | if (!oneFile) 107 | { 108 | o.open(path + package.second.GetPackageName() + ".cpp", std::ofstream::out | std::ofstream::app); 109 | tfm::format(o, "%s\n", Settings::AuthorNotes); 110 | } 111 | package.second.Save(o); 112 | Global::MainForm->progressBar1->Value += 1; 113 | o.close(); 114 | } 115 | } 116 | 117 | void SDKGenerator::DumpUseful() 118 | { 119 | std::unordered_map names; 120 | names = 121 | { 122 | std::pair("Engine.Actor.RootComponent",false), 123 | 124 | std::pair("ShadowTrackerExtra.STExtraWeapon.WeaponEntityComp",false), 125 | 126 | std::pair("Engine.Character.Mesh",false), 127 | std::pair("Gameplay.UAECharacter.bIsAI",false), 128 | std::pair("Gameplay.UAECharacter.TeamID",false), 129 | std::pair("Gameplay.UAECharacter.PlayerKey",false), 130 | std::pair("Gameplay.UAECharacter.PlayerName",false), 131 | 132 | std::pair("ShadowTrackerExtra.STExtraBaseCharacter.Health",false), 133 | std::pair("ShadowTrackerExtra.STExtraBaseCharacter.HealthStatus",false), 134 | std::pair("ShadowTrackerExtra.STExtraBaseCharacter.SpectatedCount",false), 135 | std::pair("ShadowTrackerExtra.STExtraBaseCharacter.CurrentVehicle",false), 136 | std::pair("ShadowTrackerExtra.STExtraBaseCharacter.VehicleSeatIdx",false), 137 | std::pair("ShadowTrackerExtra.STExtraBaseCharacter.bIsWeaponFiring",false), 138 | std::pair("ShadowTrackerExtra.STExtraBaseCharacter.STCharacterMovement",false), 139 | std::pair("ShadowTrackerExtra.STExtraBaseCharacter.LocalSimulateStates",false), 140 | std::pair("ShadowTrackerExtra.STExtraBaseCharacter.WeaponManagerComponent",false), 141 | 142 | std::pair("ShadowTrackerExtra.STExtraPlayerCharacter.SkydivingComponent",false), 143 | std::pair("ShadowTrackerExtra.STExtraPlayerCharacter.STPlayerController",false), 144 | 145 | std::pair("ShadowTrackerExtra.WeaponAttachmentData.SwayMultiplier",false), 146 | std::pair("ShadowTrackerExtra.WeaponAttachmentData.AnimationKickMultiplier",false), 147 | std::pair("ShadowTrackerExtra.WeaponAttachmentData.RecoilMultiplierVertical",false), 148 | std::pair("ShadowTrackerExtra.WeaponAttachmentData.MultipleFiringBulletsSpread",false), 149 | 150 | std::pair("ShadowTrackerExtra.WeaponEntity.ArrTslWeaponAttachmentData",false), 151 | 152 | std::pair("ShadowTrackerExtra.ShootWeaponEntity.BulletFireSpeed",false), 153 | std::pair("ShadowTrackerExtra.ShootWeaponEntity.bHasAutoFireMode",false), 154 | std::pair("ShadowTrackerExtra.WeaponManagerComponent.CurrentWeaponReplicated",false), 155 | 156 | std::pair("Engine.PrimitiveComponent.LastRenderTime",false), 157 | std::pair("Engine.SceneComponent.RelativeLocation",false), 158 | std::pair("Engine.SceneComponent.ComponentVelocity",false), 159 | 160 | std::pair("ShadowTrackerExtra.STExtraVehicleBase.VehicleShapeType",false), 161 | 162 | std::pair("ShadowTrackerExtra.TslSkydiveComponent.FreefallVelocitySettings",false), 163 | std::pair("Engine.CharacterMovementComponent.JumpZVelocity",false), 164 | std::pair("ShadowTrackerExtra.STCharacterMovementComponent.WalkSpeedCurveScale",false), 165 | std::pair("ShadowTrackerExtra.STCharacterMovementComponent.MinWalkSpeedModifier",false), 166 | 167 | std::pair("Engine.PlayerController.PlayerCameraManager",false), 168 | std::pair("Engine.PlayerCameraManager.CameraCache",false), 169 | std::pair("Engine.CameraCacheEntry.POV",false), 170 | std::pair("Engine.MinimalViewInfo.Location",false), 171 | std::pair("Engine.MinimalViewInfo.Rotation",false), 172 | std::pair("Engine.MinimalViewInfo.FOV",false), 173 | 174 | std::pair("ShadowTrackerExtra.STExtraPlayerController.STExtraBaseCharacter",false), 175 | }; 176 | Global::LogSplit(); 177 | Global::LogLine("Exporting useful offsets..."); 178 | Global::MainForm->progressBar1->Maximum = Global::Objects->GetObjectsNum(); 179 | 180 | int count = 0; 181 | int total = names.size(); 182 | for (int i = 0; i < Global::Objects->GetObjectsNum(); i++) 183 | { 184 | Global::MainForm->progressBar1->Value = i + 1; 185 | auto obj = Global::Objects->GetById(i); 186 | if (!obj.IsValid()) 187 | { 188 | continue; 189 | } 190 | std::string name = obj.GetFullPath(); 191 | if (names.count(name) == 1) 192 | { 193 | UEProperty prop = obj.Cast(); 194 | Global::LogLine("static const uint64_t {0} = 0x{1:x}; // {2} -> {0}",gcnew String(prop.GetName().c_str()), prop.GetOffset(), gcnew String(prop.GetOuter().GetName().c_str())); 195 | names[name] = true; 196 | } 197 | } 198 | Global::LogSplit(); 199 | for (auto i : names) 200 | { 201 | if (i.second == true) 202 | { 203 | count++; 204 | } 205 | else 206 | { 207 | Global::LogLine("{0} Not Found", gcnew String(i.first.c_str())); 208 | } 209 | } 210 | Global::LogLine("Found {0} offsets of {1}", count, total); 211 | } 212 | 213 | void Package::Process(UEObject obj) 214 | { 215 | if (obj.IsA()) 216 | { 217 | GenerateEnum(obj.Cast()); 218 | return; 219 | } 220 | const auto isClass = obj.IsA(); 221 | const auto isScriptStruct = obj.IsA(); 222 | if (!isClass && !isScriptStruct) 223 | { 224 | return; 225 | } 226 | const auto name = obj.GetName(); 227 | if (name.find("Default__") != std::string::npos || name.find("") != std::string::npos || name.find("PLACEHOLDER-CLASS") != std::string::npos) 228 | { 229 | return; 230 | } 231 | if (obj.IsA()) 232 | { 233 | GenerateClass(obj.Cast()); 234 | } 235 | else if (obj.IsA()) 236 | { 237 | GenerateScriptStruct(obj.Cast()); 238 | } 239 | } 240 | 241 | bool Package::Save(std::ofstream& o) 242 | { 243 | if (!enums.empty() || !scriptStructs.empty() || !classes.empty()) 244 | { 245 | if (enums.size() > 0) 246 | { 247 | tfm::format(o, "// %s enums \n", enums.size()); 248 | for (auto e:enums) 249 | { 250 | tfm::format(o, "// %s\nenum class %s : uint8_t\n{\n", e.FullName,e.Name); 251 | for (int i = 0; i < e.Values.size(); i++) 252 | { 253 | tfm::format(o, "\t%s = %d, \n", e.Values[i], i); 254 | } 255 | tfm::format(o, "\n};\n\n"); 256 | } 257 | } 258 | if (scriptStructs.size() > 0) 259 | { 260 | tfm::format(o, "// %s structs\n", scriptStructs.size()); 261 | for (auto ss:scriptStructs) 262 | { 263 | o << "// " << ss.FullName << "\n// "; 264 | if (ss.InheritedSize) 265 | { 266 | o << tfm::format("0x%04X (0x%04X - 0x%04X)\n", ss.Size - ss.InheritedSize, ss.Size, ss.InheritedSize); 267 | } 268 | else 269 | { 270 | o << tfm::format("0x%04X\n", ss.Size); 271 | } 272 | o << ss.NameCppFull << "\n{\n"; 273 | for (auto m : ss.Members) 274 | { 275 | o << tfm::format("\t%-50s %-58s// 0x%04X(0x%04X)", m.Type, m.Name + ";", m.Offset, m.Size) 276 | + (!m.Comment.empty() ? " " + m.Comment : "") 277 | + (!m.FlagsString.empty() ? " (" + m.FlagsString + ")" : "") << "\n"; 278 | } 279 | o << "};\n"; 280 | } 281 | } 282 | if (!classes.empty()) 283 | { 284 | tfm::format(o, "// %s class\n", classes.size()); 285 | 286 | for (auto c:classes) 287 | { 288 | o << "// " << c.FullName << "\n// "; 289 | tfm::format(o, "//%s\n", c.FullName); 290 | if (c.InheritedSize) 291 | { 292 | tfm::format(o, "//0x%04X (0x%04X - 0x%04X)\n", c.Size - c.InheritedSize, c.Size, c.InheritedSize); 293 | } 294 | else 295 | { 296 | tfm::format(o, "0x%04X\n", c.Size); 297 | } 298 | o << c.NameCppFull << "\n{\npublic:\n"; 299 | 300 | for (auto&& m : c.Members) 301 | { 302 | tfm::format(o, "\t%-50s %-58s// 0x%04X(0x%04X)", m.Type, m.Name + ";", m.Offset, m.Size); 303 | if (!m.Comment.empty()) 304 | { 305 | o << " " << m.Comment; 306 | } 307 | if (!m.FlagsString.empty()) 308 | { 309 | o << " (" << m.FlagsString << ")"; 310 | } 311 | o << "\n"; 312 | } 313 | if (!c.Methods.empty()) 314 | { 315 | o << "\n"; 316 | for (auto&& m : c.Methods) 317 | { 318 | o << "\t// " << m.FullName << "\n" << "\t// (" << m.FlagsString << ")\n"; 319 | o << "\t" << BuildMethodSignature(m, {}, true) << ";" << "// " << m.FuncAddr << "\n\n"; 320 | } 321 | } 322 | o << "\n}\n"; 323 | } 324 | } 325 | } 326 | return true; 327 | } 328 | 329 | void Package::GenerateEnum(UEEnum enumObj) 330 | { 331 | Enum e; 332 | e.Name = MakeUniqueCppName(enumObj); 333 | if (e.Name.find("Default__") != std::string::npos || e.Name.find("PLACEHOLDER-CLASS") != std::string::npos) 334 | { 335 | return; 336 | } 337 | e.FullName = enumObj.GetFullName(); 338 | 339 | std::unordered_map conflicts; 340 | for (auto&& s : enumObj.GetNames()) 341 | { 342 | const auto clean = MakeValidName(std::move(s)); 343 | 344 | const auto it = conflicts.find(clean); 345 | if (it == std::end(conflicts)) 346 | { 347 | e.Values.push_back(clean); 348 | conflicts[clean] = 1; 349 | } 350 | else 351 | { 352 | e.Values.push_back(clean + tfm::format("%02d", it->second)); 353 | conflicts[clean]++; 354 | } 355 | } 356 | enums.emplace_back(std::move(e)); 357 | } 358 | 359 | void Package::GenerateClass(UEClass classObj) 360 | { 361 | Class c; 362 | c.Name = classObj.GetName(); 363 | c.FullName = classObj.GetFullName(); 364 | c.NameCpp = MakeValidName(classObj.GetNameCPP()); 365 | c.NameCppFull = "class " + c.NameCpp; 366 | c.Size = classObj.GetPropertySize(); 367 | c.InheritedSize = 0; 368 | size_t offset = 0; 369 | auto super = classObj.GetSuper(); 370 | if (super.IsValid() && super != classObj) 371 | { 372 | c.InheritedSize = offset = super.GetPropertySize(); 373 | c.NameCppFull += " : public " + MakeValidName(super.GetNameCPP()); 374 | } 375 | std::vector properties; 376 | for (auto prop = classObj.GetChildren().Cast(); prop.IsValid(); prop = prop.GetNext().Cast()) 377 | { 378 | if (prop.GetElementSize() > 0 && !prop.IsA() && !prop.IsA() && !prop.IsA() && !prop.IsA() && (!super.IsValid()|| (super != classObj && prop.GetOffset() >= super.GetPropertySize()))) 379 | { 380 | properties.push_back(prop); 381 | } 382 | } 383 | std::sort(std::begin(properties), std::end(properties), ComparePropertyLess); 384 | GenerateMethods(classObj, c.Methods); 385 | GenerateMembers(classObj, offset, properties, c.Members); 386 | classes.emplace_back(std::move(c)); 387 | } 388 | 389 | void Package::GenerateScriptStruct(UEScriptStruct scriptStructObj) 390 | { 391 | ScriptStruct ss; 392 | ss.Size = scriptStructObj.GetPropertySize(); 393 | ss.Name = scriptStructObj.GetName(); 394 | ss.FullName = scriptStructObj.GetFullName(); 395 | ss.NameCpp = MakeValidName(scriptStructObj.GetNameCPP()); 396 | ss.NameCppFull = "struct " + MakeUniqueCppName(scriptStructObj); 397 | ss.InheritedSize = 0; 398 | size_t offset = 0; 399 | auto super = scriptStructObj.GetSuper(); 400 | if (super.IsValid() && super != scriptStructObj) 401 | { 402 | ss.InheritedSize = offset = super.GetPropertySize(); 403 | ss.NameCppFull += " : public " + MakeUniqueCppName(super.Cast()); 404 | } 405 | std::vector properties; 406 | for (auto prop = scriptStructObj.GetChildren().Cast(); prop.IsValid(); prop = prop.GetNext().Cast()) 407 | { 408 | if (prop.GetElementSize() > 0 && !prop.IsA() && !prop.IsA() && !prop.IsA() && !prop.IsA()) 409 | { 410 | properties.push_back(prop); 411 | } 412 | } 413 | std::sort(std::begin(properties), std::end(properties), ComparePropertyLess); 414 | GenerateMembers(scriptStructObj, offset, properties, ss.Members); 415 | scriptStructs.emplace_back(std::move(ss)); 416 | } 417 | 418 | void Package::GenerateMethods(const UEClass& classObj, std::vector& methods) 419 | { 420 | std::unordered_set uniqueMethods; 421 | for (auto prop = classObj.GetChildren().Cast(); prop.IsValid(); prop = prop.GetNext().Cast()) 422 | { 423 | if (prop.IsA()) 424 | { 425 | auto function = prop.Cast(); 426 | Method m; 427 | m.FuncAddr = tfm::format("sub_%X()", function.GetFunc() - Global::GameMemory->GetBase()); 428 | m.Index = function.GetIndex(); 429 | m.FullName = function.GetFullName(); 430 | m.Name = MakeValidName(function.GetName()); 431 | if (uniqueMethods.find(m.FullName) != std::end(uniqueMethods)) 432 | { 433 | continue; 434 | } 435 | uniqueMethods.insert(m.FullName); 436 | m.IsNative = function.GetFunctionFlags() & UEFunctionFlags::Native; 437 | m.IsStatic = function.GetFunctionFlags() & UEFunctionFlags::Static; 438 | m.FlagsString = StringifyFlags(function.GetFunctionFlags()); 439 | 440 | std::vector> parameters; 441 | std::unordered_map unique; 442 | for (auto param = function.GetChildren().Cast(); param.IsValid(); param = param.GetNext().Cast()) 443 | { 444 | if (param.GetElementSize() == 0) 445 | { 446 | continue; 447 | } 448 | const auto info = param.GetInfo(); 449 | if (info.Type != UEProperty::PropertyType::Unknown) 450 | { 451 | using Type = Method::Parameter::Type; 452 | Method::Parameter p; 453 | if (!Method::Parameter::MakeType(param.GetPropertyFlags(), p.ParamType)) 454 | { 455 | continue; 456 | } 457 | p.PassByReference = false; 458 | p.Name = MakeValidName(param.GetName()); 459 | const auto it = unique.find(p.Name); 460 | if (it == std::end(unique)) 461 | { 462 | unique[p.Name] = 1; 463 | } 464 | else 465 | { 466 | ++unique[p.Name]; 467 | p.Name += tfm::format("%02d", it->second); 468 | } 469 | p.CppType = info.CppType; 470 | switch (p.ParamType) 471 | { 472 | case Type::Default: 473 | if (prop.GetArrayDim() > 1) 474 | { 475 | p.CppType = p.CppType + "*"; 476 | } 477 | else if (info.CanBeReference) 478 | { 479 | p.PassByReference = true; 480 | } 481 | break; 482 | } 483 | 484 | parameters.emplace_back(std::make_pair(prop, std::move(p))); 485 | } 486 | } 487 | 488 | std::sort(std::begin(parameters), std::end(parameters), [](auto&& lhs, auto&& rhs) { return ComparePropertyLess(lhs.first, rhs.first); }); 489 | 490 | for (auto& param : parameters) 491 | { 492 | m.Parameters.emplace_back(std::move(param.second)); 493 | } 494 | 495 | methods.emplace_back(std::move(m)); 496 | } 497 | } 498 | } 499 | 500 | void Package::GenerateMembers(const UEStruct& structObj, size_t offset, const std::vector& properties, std::vector& members) 501 | { 502 | std::unordered_map uniqueMemberNames; 503 | UEBoolProperty previousBitfieldProperty; 504 | size_t unknownDataCounter = 0; 505 | for (auto&& prop : properties) 506 | { 507 | if (offset < prop.GetOffset()) 508 | { 509 | previousBitfieldProperty = UEBoolProperty(); 510 | const auto size = prop.GetOffset() - offset; 511 | members.emplace_back(CreatePadding(unknownDataCounter++, offset, size, "MISSED OFFSET")); 512 | } 513 | const auto info = prop.GetInfo(); 514 | if (info.Type != UEProperty::PropertyType::Unknown) 515 | { 516 | Member sp; 517 | sp.Offset = prop.GetOffset(); 518 | sp.Size = info.Size; 519 | sp.Type = info.CppType; 520 | sp.Name = MakeValidName(prop.GetName()); 521 | const auto it = uniqueMemberNames.find(sp.Name); 522 | if (it == std::end(uniqueMemberNames)) 523 | { 524 | uniqueMemberNames[sp.Name] = 1; 525 | } 526 | else 527 | { 528 | ++uniqueMemberNames[sp.Name]; 529 | sp.Name += tfm::format("%02d", it->second); 530 | } 531 | if (prop.GetArrayDim() > 1) 532 | { 533 | sp.Name += tfm::format("[0x%X]", prop.GetArrayDim()); 534 | } 535 | if (prop.IsA() && prop.Cast().IsBitfield()) 536 | { 537 | auto boolProp = prop.Cast(); 538 | const auto missingBits = boolProp.GetMissingBitsCount(previousBitfieldProperty); 539 | if (missingBits[1] != -1) 540 | { 541 | if (missingBits[0] > 0) 542 | { 543 | members.emplace_back(CreateBitfieldPadding(unknownDataCounter++, previousBitfieldProperty.GetOffset(), info.CppType, missingBits[0])); 544 | } 545 | if (missingBits[1] > 0) 546 | { 547 | members.emplace_back(CreateBitfieldPadding(unknownDataCounter++, sp.Offset, info.CppType, missingBits[1])); 548 | } 549 | } 550 | else if (missingBits[0] > 0) 551 | { 552 | members.emplace_back(CreateBitfieldPadding(unknownDataCounter++, sp.Offset, info.CppType, missingBits[0])); 553 | } 554 | previousBitfieldProperty = boolProp; 555 | sp.Name += " : 1"; 556 | } 557 | else 558 | { 559 | previousBitfieldProperty = UEBoolProperty(); 560 | } 561 | sp.Flags = static_cast(prop.GetPropertyFlags()); 562 | sp.FlagsString = StringifyFlags(prop.GetPropertyFlags()); 563 | members.emplace_back(std::move(sp)); 564 | const auto sizeMismatch = static_cast(prop.GetElementSize() * prop.GetArrayDim()) - static_cast(info.Size * prop.GetArrayDim()); 565 | if (sizeMismatch > 0) 566 | { 567 | members.emplace_back(CreatePadding(unknownDataCounter++, offset, sizeMismatch, "FIX WRONG TYPE SIZE OF PREVIOUS PROPERTY")); 568 | } 569 | } 570 | else 571 | { 572 | const auto size = prop.GetElementSize() * prop.GetArrayDim(); 573 | members.emplace_back(CreatePadding(unknownDataCounter++, offset, size, "UNKNOWN PROPERTY: " + prop.GetFullName())); 574 | } 575 | offset = prop.GetOffset() + prop.GetElementSize() * prop.GetArrayDim(); 576 | } 577 | if (offset < structObj.GetPropertySize()) 578 | { 579 | const auto size = structObj.GetPropertySize() - offset; 580 | members.emplace_back(CreatePadding(unknownDataCounter++, offset, size, "MISSED OFFSET")); 581 | } 582 | } 583 | 584 | std::string Package::GetPackageName() 585 | { 586 | return UEObject(packageObj).GetName(); 587 | } 588 | 589 | bool Package::Method::Parameter::MakeType(UEPropertyFlags flags, Type& type) 590 | { 591 | if (flags & UEPropertyFlags::ReturnParm) 592 | { 593 | type = Type::Return; 594 | } 595 | else if (flags & UEPropertyFlags::OutParm) 596 | { 597 | //if it is a const parameter make it a default parameter 598 | if (flags & UEPropertyFlags::ConstParm) 599 | { 600 | type = Type::Default; 601 | } 602 | else 603 | { 604 | type = Type::Out; 605 | } 606 | } 607 | else if (flags & UEPropertyFlags::Parm) 608 | { 609 | type = Type::Default; 610 | } 611 | else 612 | { 613 | return false; 614 | } 615 | 616 | return true; 617 | } 618 | 619 | std::string GetTypeCppName(UEProperty prop) 620 | { 621 | std::string className = prop.GetClass().GetName(); 622 | std::string cppType = ""; 623 | if (className == "StructProperty") 624 | { 625 | cppType = "struct " + UEScriptStruct(UStructProperty(prop.GetAddress()).Struct()).GetNameCPP(); 626 | } 627 | else if (className == "ByteProperty") 628 | { 629 | auto b = UEByteProperty(prop.GetAddress()); 630 | if (b.IsEnum()) 631 | cppType = "TEnumAsByte<" + b.GetEnum().GetNameCPP() + ">"; 632 | else cppType = "unsigned char"; 633 | 634 | } 635 | else if (className == "ObjectProperty" || className == "EncryptedObjectProperty") 636 | { 637 | auto b = UEObjectProperty(prop.GetAddress()); 638 | cppType = "class " + b.GetPropertyClass().GetNameCPP() + "*"; 639 | } 640 | else if (className == "ClassProperty") 641 | { 642 | cppType = "class " + UEClassProperty(prop.GetAddress()).GetMetaClass().GetNameCPP() + "*"; 643 | } 644 | else if (className == "InterfaceProperty") 645 | { 646 | cppType = "TScriptInterface"; 647 | } 648 | else if (className == "WeakObjectProperty") 649 | { 650 | cppType = "TWeakObjectPtr"; 651 | } 652 | else if (className == "LazyObjectProperty") 653 | { 654 | cppType = "TLazyObjectPtr"; 655 | } 656 | else if (className == "BoolProperty") 657 | { 658 | auto b = UEBoolProperty(prop.GetAddress()); 659 | if (b.IsNativeBool()) 660 | { 661 | cppType = "bool"; 662 | } 663 | cppType = "unsigned char"; 664 | } 665 | else if (className == "UInt16Property") 666 | { 667 | cppType = "uint16_t"; 668 | } 669 | else if (className == "UInt32Property") 670 | { 671 | cppType = "uint32_t"; 672 | } 673 | else if (className == "UInt64Property") 674 | { 675 | cppType = "uint64_t"; 676 | } 677 | else if (className == "Int8Property") 678 | { 679 | cppType = "int8_t"; 680 | } 681 | else if (className == "Int16Property") 682 | { 683 | cppType = "int16_t"; 684 | } 685 | else if (className == "IntProperty") 686 | { 687 | cppType = "int"; 688 | } 689 | else if (className == "Int64Property") 690 | { 691 | cppType = "int64_t"; 692 | } 693 | else if (className == "FloatProperty") 694 | { 695 | cppType = "float"; 696 | } 697 | else if (className == "DoubleProperty") 698 | { 699 | cppType = "double"; 700 | } 701 | else if (className == "AssetObjectProperty") 702 | { 703 | cppType = "TAssetPtr"; 704 | } 705 | else if (className == "AssetClassProperty") 706 | { 707 | cppType = "AssetClassProperty"; 708 | } 709 | else if (className == "NameProperty") 710 | { 711 | cppType = "struct FName"; 712 | } 713 | else if (className == "StrProperty") 714 | { 715 | cppType = "struct FString"; 716 | } 717 | else if (className == "TextProperty") 718 | { 719 | cppType = "struct FText"; 720 | } 721 | else if (className == "ArrayProperty") 722 | { 723 | auto b = UEArrayProperty(prop.GetAddress()); 724 | cppType = "TArray<" + GetTypeCppName(b.GetInner()) + ">"; 725 | } 726 | else if (className == "MapProperty") 727 | { 728 | auto key = GetTypeCppName(UEProperty(UMapProperty(prop.GetAddress()).KeyProp())); 729 | auto value = GetTypeCppName(UEProperty(UMapProperty(prop.GetAddress()).ValueProp())); 730 | cppType = "TMap<" + key + ", " + value + ">"; 731 | } 732 | else if (className == "DelegateProperty") 733 | { 734 | cppType = "struct FScriptDelegate"; 735 | } 736 | else if (className == "MulticastDelegateProperty") 737 | { 738 | cppType = "struct FScriptMulticastDelegate"; 739 | } 740 | else if (className == "EnumProperty") 741 | { 742 | cppType = UEEnumProperty(prop.GetAddress()).GetEnum().GetNameCPP(); 743 | } 744 | else 745 | { 746 | cppType = "UnknownProperty"; 747 | } 748 | return cppType; 749 | } 750 | 751 | bool ComparePropertyLess(const UEProperty& lhs, const UEProperty& rhs) 752 | { 753 | if (lhs.GetOffset() == rhs.GetOffset() 754 | && lhs.IsA() 755 | && rhs.IsA()) 756 | { 757 | return lhs.Cast() < rhs.Cast(); 758 | } 759 | 760 | return lhs.GetOffset() < rhs.GetOffset(); 761 | } 762 | 763 | Package::Member CreatePadding(size_t id, size_t offset, size_t size, std::string reason) 764 | { 765 | Package::Member ss; 766 | ss.Name = tfm::format("UnknownData%02d[0x%X]", id, size); 767 | ss.Type = "unsigned char"; 768 | ss.Offset = offset; 769 | ss.Size = size; 770 | ss.Comment = std::move(reason); 771 | return ss; 772 | } 773 | 774 | Package::Member CreateBitfieldPadding(size_t id, size_t offset, std::string type, size_t bits) 775 | { 776 | Package::Member ss; 777 | ss.Name = tfm::format("UnknownData%02d : %d", id, bits); 778 | ss.Type = std::move(type); 779 | ss.Offset = offset; 780 | ss.Size = 1; 781 | return ss; 782 | } 783 | 784 | std::string BuildMethodSignature(const Package::Method& m, const Package::Class& c, bool inHeader) 785 | { 786 | using Type = Package::Method::Parameter::Type; 787 | 788 | std::ostringstream ss; 789 | 790 | if (m.IsStatic && inHeader) 791 | { 792 | ss << "static "; 793 | } 794 | std::string cpptype = "void"; 795 | for (auto param : m.Parameters) 796 | { 797 | if (param.ParamType == Type::Return) 798 | { 799 | cpptype = param.CppType; 800 | break; 801 | } 802 | } 803 | ss << cpptype << " "; 804 | 805 | if (!inHeader) 806 | { 807 | ss << c.NameCpp << "::"; 808 | } 809 | if (m.IsStatic) 810 | { 811 | ss << "STATIC_"; 812 | } 813 | ss << m.Name; 814 | ss << "("; 815 | for (auto param: m.Parameters) 816 | { 817 | if (param.ParamType!=Type::Return) 818 | { 819 | ss << (param.PassByReference ? "const " : "") + param.CppType + (param.PassByReference ? "& " : param.ParamType == Type::Out ? "* " : " ") + param.Name; 820 | } 821 | } 822 | ss << ")"; 823 | return ss.str(); 824 | } -------------------------------------------------------------------------------- /LiteSDKGenerator/SDKGenerator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TinyFormat.h" 3 | #include 4 | #include 5 | #include 6 | 7 | class UEObject; 8 | class UEEnum; 9 | class UEClass; 10 | class UEScriptStruct; 11 | class UEStruct; 12 | class UEProperty; 13 | enum class UEPropertyFlags : uint64_t; 14 | 15 | ref class SDKGenerator 16 | { 17 | public: 18 | void DumpObjectsTxt(std::string path); 19 | void DumpNamesTxt(std::string path); 20 | void DumpSDK(std::string path, bool OneFile); 21 | void DumpUseful(); 22 | }; 23 | 24 | class Package 25 | { 26 | public: 27 | Package() { packageObj = 0; } 28 | 29 | Package(uint64_t address) 30 | { 31 | packageObj = address; 32 | } 33 | 34 | void Process(UEObject obj); 35 | 36 | bool Save(std::ofstream& o); 37 | 38 | struct Enum 39 | { 40 | std::string Name; 41 | std::string FullName; 42 | std::vector Values; 43 | }; 44 | 45 | struct Member 46 | { 47 | std::string Name; 48 | std::string Type; 49 | 50 | size_t Offset; 51 | size_t Size; 52 | 53 | size_t Flags; 54 | std::string FlagsString; 55 | 56 | std::string Comment; 57 | }; 58 | 59 | struct ScriptStruct 60 | { 61 | std::string Name; 62 | std::string FullName; 63 | std::string NameCpp; 64 | std::string NameCppFull; 65 | 66 | size_t Size; 67 | size_t InheritedSize; 68 | 69 | std::vector Members; 70 | }; 71 | 72 | struct Method 73 | { 74 | struct Parameter 75 | { 76 | enum class Type 77 | { 78 | Default, 79 | Out, 80 | Return 81 | }; 82 | 83 | Type ParamType; 84 | bool PassByReference; 85 | std::string CppType; 86 | std::string Name; 87 | std::string FlagsString; 88 | static bool MakeType(UEPropertyFlags flags, Type& type); 89 | }; 90 | 91 | std::string FuncAddr; 92 | size_t Index; 93 | std::string Name; 94 | std::string FullName; 95 | std::vector Parameters; 96 | std::string FlagsString; 97 | bool IsNative; 98 | bool IsStatic; 99 | }; 100 | 101 | struct Class : ScriptStruct 102 | { 103 | std::vector VirtualFunctions; 104 | std::vector Methods; 105 | }; 106 | 107 | void GenerateEnum(UEEnum enumObj); 108 | 109 | void GenerateClass(UEClass obj); 110 | 111 | void GenerateScriptStruct(UEScriptStruct obj); 112 | 113 | void GenerateMethods(const UEClass& classObj, std::vector& methods); 114 | 115 | void GenerateMembers(const UEStruct& structObj, size_t offset, const std::vector& properties, std::vector& members); 116 | 117 | std::string GetPackageName(); 118 | private: 119 | uint64_t packageObj; 120 | std::vector enums; 121 | std::vector scriptStructs; 122 | std::vector classes; 123 | }; -------------------------------------------------------------------------------- /LiteSDKGenerator/SDKTypes.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SDKTypes.h" 3 | 4 | #pragma region EngineTypes 5 | bool operator&(UEPropertyFlags lhs, UEPropertyFlags rhs) 6 | { 7 | return (static_cast>(lhs)& static_cast>(rhs)) == static_cast>(rhs); 8 | } 9 | 10 | std::string StringifyFlags(const UEPropertyFlags flags) 11 | { 12 | std::vector buffer; 13 | 14 | if (flags & UEPropertyFlags::Edit) { buffer.push_back("Edit"); } 15 | if (flags & UEPropertyFlags::ConstParm) { buffer.push_back("ConstParm"); } 16 | if (flags & UEPropertyFlags::BlueprintVisible) { buffer.push_back("BlueprintVisible"); } 17 | if (flags & UEPropertyFlags::ExportObject) { buffer.push_back("ExportObject"); } 18 | if (flags & UEPropertyFlags::BlueprintReadOnly) { buffer.push_back("BlueprintReadOnly"); } 19 | if (flags & UEPropertyFlags::Net) { buffer.push_back("Net"); } 20 | if (flags & UEPropertyFlags::EditFixedSize) { buffer.push_back("EditFixedSize"); } 21 | if (flags & UEPropertyFlags::Parm) { buffer.push_back("Parm"); } 22 | if (flags & UEPropertyFlags::OutParm) { buffer.push_back("OutParm"); } 23 | if (flags & UEPropertyFlags::ZeroConstructor) { buffer.push_back("ZeroConstructor"); } 24 | if (flags & UEPropertyFlags::ReturnParm) { buffer.push_back("ReturnParm"); } 25 | if (flags & UEPropertyFlags::DisableEditOnTemplate) { buffer.push_back("DisableEditOnTemplate"); } 26 | if (flags & UEPropertyFlags::Transient) { buffer.push_back("Transient"); } 27 | if (flags & UEPropertyFlags::Config) { buffer.push_back("Config"); } 28 | if (flags & UEPropertyFlags::DisableEditOnInstance) { buffer.push_back("DisableEditOnInstance"); } 29 | if (flags & UEPropertyFlags::EditConst) { buffer.push_back("EditConst"); } 30 | if (flags & UEPropertyFlags::GlobalConfig) { buffer.push_back("GlobalConfig"); } 31 | if (flags & UEPropertyFlags::InstancedReference) { buffer.push_back("InstancedReference"); } 32 | if (flags & UEPropertyFlags::DuplicateTransient) { buffer.push_back("DuplicateTransient"); } 33 | if (flags & UEPropertyFlags::SubobjectReference) { buffer.push_back("SubobjectReference"); } 34 | if (flags & UEPropertyFlags::SaveGame) { buffer.push_back("SaveGame"); } 35 | if (flags & UEPropertyFlags::NoClear) { buffer.push_back("NoClear"); } 36 | if (flags & UEPropertyFlags::ReferenceParm) { buffer.push_back("ReferenceParm"); } 37 | if (flags & UEPropertyFlags::BlueprintAssignable) { buffer.push_back("BlueprintAssignable"); } 38 | if (flags & UEPropertyFlags::Deprecated) { buffer.push_back("Deprecated"); } 39 | if (flags & UEPropertyFlags::IsPlainOldData) { buffer.push_back("IsPlainOldData"); } 40 | if (flags & UEPropertyFlags::RepSkip) { buffer.push_back("RepSkip"); } 41 | if (flags & UEPropertyFlags::RepNotify) { buffer.push_back("RepNotify"); } 42 | if (flags & UEPropertyFlags::Interp) { buffer.push_back("Interp"); } 43 | if (flags & UEPropertyFlags::NonTransactional) { buffer.push_back("NonTransactional"); } 44 | if (flags & UEPropertyFlags::EditorOnly) { buffer.push_back("EditorOnly"); } 45 | if (flags & UEPropertyFlags::NoDestructor) { buffer.push_back("NoDestructor"); } 46 | if (flags & UEPropertyFlags::AutoWeak) { buffer.push_back("AutoWeak"); } 47 | if (flags & UEPropertyFlags::ContainsInstancedReference) { buffer.push_back("ContainsInstancedReference"); } 48 | if (flags & UEPropertyFlags::AssetRegistrySearchable) { buffer.push_back("AssetRegistrySearchable"); } 49 | if (flags & UEPropertyFlags::SimpleDisplay) { buffer.push_back("SimpleDisplay"); } 50 | if (flags & UEPropertyFlags::AdvancedDisplay) { buffer.push_back("AdvancedDisplay"); } 51 | if (flags & UEPropertyFlags::Protected) { buffer.push_back("Protected"); } 52 | if (flags & UEPropertyFlags::BlueprintCallable) { buffer.push_back("BlueprintCallable"); } 53 | if (flags & UEPropertyFlags::BlueprintAuthorityOnly) { buffer.push_back("BlueprintAuthorityOnly"); } 54 | if (flags & UEPropertyFlags::TextExportTransient) { buffer.push_back("TextExportTransient"); } 55 | if (flags & UEPropertyFlags::NonPIEDuplicateTransient) { buffer.push_back("NonPIEDuplicateTransient"); } 56 | if (flags & UEPropertyFlags::ExposeOnSpawn) { buffer.push_back("ExposeOnSpawn"); } 57 | if (flags & UEPropertyFlags::PersistentInstance) { buffer.push_back("PersistentInstance"); } 58 | if (flags & UEPropertyFlags::UObjectWrapper) { buffer.push_back("UObjectWrapper"); } 59 | if (flags & UEPropertyFlags::HasGetValueTypeHash) { buffer.push_back("HasGetValueTypeHash"); } 60 | if (flags & UEPropertyFlags::NativeAccessSpecifierPublic) { buffer.push_back("NativeAccessSpecifierPublic"); } 61 | if (flags & UEPropertyFlags::NativeAccessSpecifierProtected) { buffer.push_back("NativeAccessSpecifierProtected"); } 62 | if (flags & UEPropertyFlags::NativeAccessSpecifierPrivate) { buffer.push_back("NativeAccessSpecifierPrivate"); } 63 | 64 | switch (buffer.size()) 65 | { 66 | case 0: 67 | return std::string(); 68 | case 1: 69 | return std::string(buffer[0]); 70 | default: 71 | std::ostringstream os; 72 | std::copy(buffer.begin(), buffer.end() - 1, std::ostream_iterator(os, ", ")); 73 | os << *buffer.rbegin(); 74 | return os.str(); 75 | } 76 | } 77 | 78 | bool operator&(UEFunctionFlags lhs, UEFunctionFlags rhs) 79 | { 80 | return (static_cast>(lhs)& static_cast>(rhs)) == static_cast>(rhs); 81 | } 82 | 83 | std::string StringifyFlags(const UEFunctionFlags flags) 84 | { 85 | std::vector buffer; 86 | 87 | if (flags & UEFunctionFlags::Final) { buffer.push_back("Final"); } 88 | if (flags & UEFunctionFlags::RequiredAPI) { buffer.push_back("RequiredAPI"); } 89 | if (flags & UEFunctionFlags::BlueprintAuthorityOnly) { buffer.push_back("BlueprintAuthorityOnly"); } 90 | if (flags & UEFunctionFlags::BlueprintCosmetic) { buffer.push_back("BlueprintCosmetic"); } 91 | if (flags & UEFunctionFlags::Net) { buffer.push_back("Net"); } 92 | if (flags & UEFunctionFlags::NetReliable) { buffer.push_back("NetReliable"); } 93 | if (flags & UEFunctionFlags::NetRequest) { buffer.push_back("NetRequest"); } 94 | if (flags & UEFunctionFlags::Exec) { buffer.push_back("Exec"); } 95 | if (flags & UEFunctionFlags::Native) { buffer.push_back("Native"); } 96 | if (flags & UEFunctionFlags::Event) { buffer.push_back("Event"); } 97 | if (flags & UEFunctionFlags::NetResponse) { buffer.push_back("NetResponse"); } 98 | if (flags & UEFunctionFlags::Static) { buffer.push_back("Static"); } 99 | if (flags & UEFunctionFlags::NetMulticast) { buffer.push_back("NetMulticast"); } 100 | if (flags & UEFunctionFlags::MulticastDelegate) { buffer.push_back("MulticastDelegate"); } 101 | if (flags & UEFunctionFlags::Public) { buffer.push_back("Public"); } 102 | if (flags & UEFunctionFlags::Private) { buffer.push_back("Private"); } 103 | if (flags & UEFunctionFlags::Protected) { buffer.push_back("Protected"); } 104 | if (flags & UEFunctionFlags::Delegate) { buffer.push_back("Delegate"); } 105 | if (flags & UEFunctionFlags::NetServer) { buffer.push_back("NetServer"); } 106 | if (flags & UEFunctionFlags::HasOutParms) { buffer.push_back("HasOutParms"); } 107 | if (flags & UEFunctionFlags::HasDefaults) { buffer.push_back("HasDefaults"); } 108 | if (flags & UEFunctionFlags::NetClient) { buffer.push_back("NetClient"); } 109 | if (flags & UEFunctionFlags::DLLImport) { buffer.push_back("DLLImport"); } 110 | if (flags & UEFunctionFlags::BlueprintCallable) { buffer.push_back("BlueprintCallable"); } 111 | if (flags & UEFunctionFlags::BlueprintEvent) { buffer.push_back("BlueprintEvent"); } 112 | if (flags & UEFunctionFlags::BlueprintPure) { buffer.push_back("BlueprintPure"); } 113 | if (flags & UEFunctionFlags::Const) { buffer.push_back("Const"); } 114 | if (flags & UEFunctionFlags::NetValidate) { buffer.push_back("NetValidate"); } 115 | 116 | switch (buffer.size()) 117 | { 118 | case 0: 119 | return std::string(); 120 | case 1: 121 | return std::string(buffer[0]); 122 | default: 123 | std::ostringstream os; 124 | std::copy(buffer.begin(), buffer.end() - 1, std::ostream_iterator(os, ", ")); 125 | os << *buffer.rbegin(); 126 | return os.str(); 127 | } 128 | } 129 | #pragma endregion 130 | 131 | #pragma region NameValidator 132 | std::string MakeValidName(std::string&& name) 133 | { 134 | std::string valid(name); 135 | 136 | for (auto i = 0u; i < name.length(); ++i) 137 | { 138 | if (valid[i] == ' ' 139 | || valid[i] == '?' 140 | || valid[i] == '+' 141 | || valid[i] == '-' 142 | || valid[i] == ':' 143 | || valid[i] == '/' 144 | || valid[i] == '^' 145 | || valid[i] == '(' 146 | || valid[i] == ')' 147 | || valid[i] == '[' 148 | || valid[i] == ']' 149 | || valid[i] == '<' 150 | || valid[i] == '>' 151 | || valid[i] == '&' 152 | || valid[i] == '.' 153 | || valid[i] == '#' 154 | || valid[i] == '\'' 155 | || valid[i] == '"' 156 | || valid[i] == '%') 157 | { 158 | valid[i] = '_'; 159 | } 160 | } 161 | 162 | if (!valid.empty()) 163 | { 164 | if (std::isdigit(valid[0])) 165 | { 166 | valid = '_' + valid; 167 | } 168 | } 169 | 170 | return valid; 171 | } 172 | 173 | template 174 | std::string MakeUniqueCppNameImpl(const T& t) 175 | { 176 | std::string name; 177 | //if (Global::Objects->CountObjects(t.GetName()) > 1) 178 | //{ 179 | // name += MakeValidName(t.GetOuter().GetName()) + "_"; 180 | //} 181 | return name + MakeValidName(t.GetName()); 182 | } 183 | 184 | std::string MakeUniqueCppName(const UEConst& c) 185 | { 186 | return MakeUniqueCppNameImpl(c); 187 | } 188 | 189 | std::string MakeUniqueCppName(const UEEnum& e) 190 | { 191 | auto name = MakeUniqueCppNameImpl(e); 192 | if (!name.empty() && name[0] != 'E') 193 | { 194 | name = 'E' + name; 195 | } 196 | return name; 197 | } 198 | 199 | std::string MakeUniqueCppName(const UEStruct& ss) 200 | { 201 | std::string name; 202 | //if (Global::Objects->CountObjects(ss.GetName()) > 1) 203 | //{ 204 | // name += MakeValidName(ss.GetOuter().GetNameCPP()) + "_"; 205 | //} 206 | return name + MakeValidName(ss.GetNameCPP()); 207 | } 208 | #pragma endregion 209 | 210 | #pragma region EngineTypes 211 | 212 | FName::FName() 213 | { 214 | base = 0; 215 | } 216 | FName::FName(uint64 _base) 217 | { 218 | base = _base; 219 | } 220 | int FName::GetComparisonIndex() const 221 | { 222 | return Updates::Dec::comparison_id(Global::GameMemory->Read32(base + Updates::Off::comparison_id)); 223 | } 224 | 225 | int FName::GetNumber() const 226 | { 227 | return Updates::Dec::number(Global::GameMemory->Read32(base + Updates::Off::number)); 228 | } 229 | 230 | std::string FString::ToString() const 231 | { 232 | wchar_t Name[64]; 233 | Global::GameMemory->ReadWString(m_Data, Name, m_nCount * sizeof(wchar_t)); 234 | char text[60]; 235 | sprintf_s(text, "%ls", Name); 236 | return text; 237 | } 238 | #pragma endregion 239 | 240 | #pragma region GenericTypes 241 | 242 | 243 | int UEObject::GetIndex() const 244 | { 245 | return uobject.GetInternalIndex(); 246 | } 247 | 248 | UEClass UEObject::GetClass() const 249 | { 250 | return UEClass(uobject.GetClass()); 251 | } 252 | 253 | UEObject UEObject::GetOuter() const 254 | { 255 | return UEObject(uobject.GetOuter()); 256 | } 257 | 258 | std::string UEObject::GetName() const 259 | { 260 | UObject uobj = uobject; 261 | auto name = Global::Names->GetById(uobj.GetFName().GetComparisonIndex()); 262 | if (uobj.GetFName().GetNumber() > 0) 263 | { 264 | name += '_' + std::to_string(uobj.GetFName().GetNumber()); 265 | } 266 | auto pos = name.rfind('/'); 267 | if (pos == std::string::npos) 268 | { 269 | return name; 270 | } 271 | 272 | return name.substr(pos + 1); 273 | } 274 | 275 | uint64 UEObject::GetAddress() const 276 | { 277 | return object; 278 | } 279 | 280 | UEObject UEObject::GetPackageObject() const 281 | { 282 | UEObject package(0); 283 | 284 | for (auto outer = GetOuter(); outer.IsValid(); outer = outer.GetOuter()) 285 | { 286 | package = outer; 287 | } 288 | 289 | return package; 290 | } 291 | 292 | std::string UEObject::GetFullName() const 293 | { 294 | if (GetClass().IsValid()) 295 | { 296 | std::string temp; 297 | 298 | for (auto outer = GetOuter(); outer.IsValid(); outer = outer.GetOuter()) 299 | { 300 | temp = outer.GetName() + "." + temp; 301 | } 302 | 303 | std::string name = GetClass().GetName(); 304 | name += " "; 305 | name += temp; 306 | name += GetName(); 307 | 308 | return name; 309 | } 310 | 311 | return std::string("(null)"); 312 | } 313 | 314 | std::string UEObject::GetFullPath() const 315 | { 316 | if (GetClass().IsValid()) 317 | { 318 | std::string temp; 319 | 320 | for (auto outer = GetOuter(); outer.IsValid(); outer = outer.GetOuter()) 321 | { 322 | temp = outer.GetName() + "." + temp; 323 | } 324 | 325 | temp += GetName(); 326 | 327 | return temp; 328 | } 329 | 330 | return std::string("(null)"); 331 | } 332 | 333 | std::string UEObject::GetNameCPP() const 334 | { 335 | std::string name; 336 | 337 | if (IsA()) 338 | { 339 | auto c = Cast(); 340 | while (c.IsValid()) 341 | { 342 | const auto className = c.GetName(); 343 | if (className == "Actor") 344 | { 345 | name += "A"; 346 | break; 347 | } 348 | if (className == "Object") 349 | { 350 | name += "U"; 351 | break; 352 | } 353 | 354 | c = c.GetSuper().Cast(); 355 | } 356 | } 357 | else 358 | { 359 | name += "F"; 360 | } 361 | 362 | name += GetName(); 363 | 364 | return name; 365 | } 366 | 367 | UEClass UEObject::StaticClass() 368 | { 369 | static auto c = Global::Objects->FindClass("Class CoreUObject.Object"); 370 | return c; 371 | } 372 | 373 | UEField UEField::GetNext() const 374 | { 375 | return UEField(UField(object).Next()); 376 | } 377 | 378 | UEClass UEField::StaticClass() 379 | { 380 | static auto c = Global::Objects->FindClass("Class CoreUObject.Field"); 381 | return c; 382 | } 383 | 384 | std::vector UEEnum::GetNames() const 385 | { 386 | std::vector buffer; 387 | auto names = UEnum(object).Names(); 388 | 389 | for (auto i = 0; i < names.Length(); ++i) 390 | { 391 | buffer.push_back(Global::Names->GetById(Global::GameMemory->Read32(names.GetAddress() + i * 0x10 + Updates::Off::comparison_id))); 392 | } 393 | 394 | return buffer; 395 | } 396 | 397 | int UEObject::GetComparisonIndex() const 398 | { 399 | return uobject.GetFName().GetComparisonIndex(); 400 | } 401 | 402 | UEClass UEEnum::StaticClass() 403 | { 404 | static auto c = Global::Objects->FindClass("Class CoreUObject.Enum"); 405 | return c; 406 | } 407 | 408 | std::string UEConst::GetValue() const 409 | { 410 | throw; 411 | } 412 | 413 | UEClass UEConst::StaticClass() 414 | { 415 | return 0; 416 | } 417 | 418 | UEStruct UEStruct::GetSuper() const 419 | { 420 | return UEStruct(UStruct(object).SuperField()); 421 | } 422 | 423 | UEField UEStruct::GetChildren() const 424 | { 425 | return UEField(UStruct(object).Children()); 426 | } 427 | 428 | size_t UEStruct::GetPropertySize() const 429 | { 430 | return UStruct(object).PropertySize(); 431 | } 432 | 433 | UEClass UEStruct::StaticClass() 434 | { 435 | static auto c = Global::Objects->FindClass("Class CoreUObject.Struct"); 436 | return c; 437 | } 438 | 439 | UEClass UEScriptStruct::StaticClass() 440 | { 441 | static auto c = Global::Objects->FindClass("Class CoreUObject.ScriptStruct"); 442 | return c; 443 | } 444 | 445 | //--------------------------------------------------------------------------- 446 | //UEFunction 447 | //--------------------------------------------------------------------------- 448 | UEFunctionFlags UEFunction::GetFunctionFlags() const 449 | { 450 | return static_cast(UFunction(object).FunctionFlags()); 451 | } 452 | uint64 UEFunction::GetFunc() const 453 | { 454 | return UFunction(object).Func(); 455 | } 456 | //--------------------------------------------------------------------------- 457 | UEClass UEFunction::StaticClass() 458 | { 459 | static auto c = Global::Objects->FindClass("Class CoreUObject.Function"); 460 | return c; 461 | } 462 | //--------------------------------------------------------------------------- 463 | //UEClass 464 | //--------------------------------------------------------------------------- 465 | UEClass UEClass::StaticClass() 466 | { 467 | static auto c = Global::Objects->FindClass("Class CoreUObject.Class"); 468 | return c; 469 | } 470 | //--------------------------------------------------------------------------- 471 | //UEProperty 472 | //--------------------------------------------------------------------------- 473 | size_t UEProperty::GetArrayDim() const 474 | { 475 | return UProperty(object).ArrayDim(); 476 | } 477 | 478 | size_t UEProperty::GetElementSize() const 479 | { 480 | return UProperty(object).ElementSize(); 481 | } 482 | 483 | UEPropertyFlags UEProperty::GetPropertyFlags() const 484 | { 485 | return static_cast(UProperty(object).PropertyFlags().A); 486 | } 487 | 488 | size_t UEProperty::GetOffset() const 489 | { 490 | return UProperty(object).Offset(); 491 | } 492 | 493 | UEClass UEProperty::StaticClass() 494 | { 495 | static auto c = Global::Objects->FindClass("Class CoreUObject.Property"); 496 | return c; 497 | } 498 | 499 | UEProperty::Info UEProperty::GetInfo() const 500 | { 501 | if (IsValid()) 502 | { 503 | std::string className = GetClass().GetName(); 504 | if (className == "BoolProperty") 505 | { 506 | return Cast().GetInfo(); 507 | } 508 | if (className == "ClassProperty") 509 | { 510 | return Cast().GetInfo(); 511 | } 512 | if (className == "ObjectProperty") 513 | { 514 | return Cast().GetInfo(); 515 | } 516 | if (className == "EnumProperty") 517 | { 518 | return Cast().GetInfo(); 519 | } 520 | if (className == "IntProperty") 521 | { 522 | return Cast().GetInfo(); 523 | } 524 | if (className == "FloatProperty") 525 | { 526 | return Cast().GetInfo(); 527 | } 528 | if (className == "ByteProperty") 529 | { 530 | return Cast().GetInfo(); 531 | } 532 | if (className == "UInt16Property") 533 | { 534 | return Cast().GetInfo(); 535 | } 536 | if (className == "UInt32Property") 537 | { 538 | return Cast().GetInfo(); 539 | } 540 | if (className == "UInt64Property") 541 | { 542 | return Cast().GetInfo(); 543 | } 544 | if (className == "Int8Property") 545 | { 546 | return Cast().GetInfo(); 547 | } 548 | if (className == "Int16Property") 549 | { 550 | return Cast().GetInfo(); 551 | } 552 | if (className == "Int64Property") 553 | { 554 | return Cast().GetInfo(); 555 | } 556 | if (className == "DoubleProperty") 557 | { 558 | return Cast().GetInfo(); 559 | } 560 | if (className == "InterfaceProperty") 561 | { 562 | return Cast().GetInfo(); 563 | } 564 | if (className == "WeakObjectProperty") 565 | { 566 | return Cast().GetInfo(); 567 | } 568 | if (className == "LazyObjectProperty") 569 | { 570 | return Cast().GetInfo(); 571 | } 572 | if (className == "EncryptedObjectProperty") 573 | { 574 | return Cast().GetInfo(); 575 | } 576 | if (className == "NameProperty") 577 | { 578 | return Cast().GetInfo(); 579 | } 580 | if (className == "StructProperty") 581 | { 582 | return Cast().GetInfo(); 583 | } 584 | if (className == "StrProperty") 585 | { 586 | return Cast().GetInfo(); 587 | } 588 | if (className == "TextProperty") 589 | { 590 | return Cast().GetInfo(); 591 | } 592 | if (className == "ArrayProperty") 593 | { 594 | return Cast().GetInfo(); 595 | } 596 | if (className == "MapProperty") 597 | { 598 | return Cast().GetInfo(); 599 | } 600 | if (className == "DelegateProperty") 601 | { 602 | return Cast().GetInfo(); 603 | } 604 | if (className == "MulticastDelegateProperty") 605 | { 606 | return Cast().GetInfo(); 607 | } 608 | } 609 | return { PropertyType::Unknown }; 610 | } 611 | //--------------------------------------------------------------------------- 612 | //UENumericProperty 613 | //--------------------------------------------------------------------------- 614 | UEClass UENumericProperty::StaticClass() 615 | { 616 | static auto c = Global::Objects->FindClass("Class CoreUObject.NumericProperty"); 617 | return c; 618 | } 619 | //--------------------------------------------------------------------------- 620 | //UEByteProperty 621 | //--------------------------------------------------------------------------- 622 | bool UEByteProperty::IsEnum() const 623 | { 624 | return GetEnum().IsValid(); 625 | } 626 | UEEnum UEByteProperty::GetEnum() const 627 | { 628 | return UEEnum(UByteProperty(object).Enum()); 629 | } 630 | //--------------------------------------------------------------------------- 631 | UEProperty::Info UEByteProperty::GetInfo() const 632 | { 633 | if (IsEnum()) 634 | { 635 | return Info::Create(PropertyType::Primitive, sizeof(uint8_t), false, "TEnumAsByte<" + MakeUniqueCppName(GetEnum()) + ">"); 636 | } 637 | return Info::Create(PropertyType::Primitive, sizeof(uint8_t), false, "unsigned char"); 638 | } 639 | //--------------------------------------------------------------------------- 640 | UEClass UEByteProperty::StaticClass() 641 | { 642 | static auto c = Global::Objects->FindClass("Class CoreUObject.ByteProperty"); 643 | return c; 644 | } 645 | //--------------------------------------------------------------------------- 646 | //UEUInt16Property 647 | //--------------------------------------------------------------------------- 648 | UEProperty::Info UEUInt16Property::GetInfo() const 649 | { 650 | return Info::Create(PropertyType::Primitive, sizeof(uint16_t), false, "uint16_t"); 651 | } 652 | //--------------------------------------------------------------------------- 653 | UEClass UEUInt16Property::StaticClass() 654 | { 655 | static auto c = Global::Objects->FindClass("Class CoreUObject.UInt16Property"); 656 | return c; 657 | } 658 | //--------------------------------------------------------------------------- 659 | //UEUInt32Property 660 | //--------------------------------------------------------------------------- 661 | UEProperty::Info UEUInt32Property::GetInfo() const 662 | { 663 | return Info::Create(PropertyType::Primitive, sizeof(uint32_t), false, "uint32_t"); 664 | } 665 | //--------------------------------------------------------------------------- 666 | UEClass UEUInt32Property::StaticClass() 667 | { 668 | static auto c = Global::Objects->FindClass("Class CoreUObject.UInt32Property"); 669 | return c; 670 | } 671 | 672 | //--------------------------------------------------------------------------- 673 | //UEUInt64Property 674 | //--------------------------------------------------------------------------- 675 | UEProperty::Info UEUInt64Property::GetInfo() const 676 | { 677 | return Info::Create(PropertyType::Primitive, sizeof(uint64_t), false, "uint64_t"); 678 | } 679 | //--------------------------------------------------------------------------- 680 | UEClass UEUInt64Property::StaticClass() 681 | { 682 | static auto c = Global::Objects->FindClass("Class CoreUObject.UInt64Property"); 683 | return c; 684 | } 685 | //--------------------------------------------------------------------------- 686 | //UEInt8Property 687 | //--------------------------------------------------------------------------- 688 | UEProperty::Info UEInt8Property::GetInfo() const 689 | { 690 | return Info::Create(PropertyType::Primitive, sizeof(int8_t), false, "int8_t"); 691 | } 692 | //--------------------------------------------------------------------------- 693 | UEClass UEInt8Property::StaticClass() 694 | { 695 | static auto c = Global::Objects->FindClass("Class CoreUObject.Int8Property"); 696 | return c; 697 | } 698 | //--------------------------------------------------------------------------- 699 | //UEInt16Property 700 | //--------------------------------------------------------------------------- 701 | UEProperty::Info UEInt16Property::GetInfo() const 702 | { 703 | return Info::Create(PropertyType::Primitive, sizeof(int16_t), false, "int16_t"); 704 | } 705 | //--------------------------------------------------------------------------- 706 | UEClass UEInt16Property::StaticClass() 707 | { 708 | static auto c = Global::Objects->FindClass("Class CoreUObject.Int16Property"); 709 | return c; 710 | } 711 | //--------------------------------------------------------------------------- 712 | //UEIntProperty 713 | //--------------------------------------------------------------------------- 714 | UEProperty::Info UEIntProperty::GetInfo() const 715 | { 716 | return Info::Create(PropertyType::Primitive, sizeof(int), false, "int"); 717 | } 718 | //--------------------------------------------------------------------------- 719 | UEClass UEIntProperty::StaticClass() 720 | { 721 | static auto c = Global::Objects->FindClass("Class CoreUObject.IntProperty"); 722 | return c; 723 | } 724 | //--------------------------------------------------------------------------- 725 | //UEInt64Property 726 | //--------------------------------------------------------------------------- 727 | UEProperty::Info UEInt64Property::GetInfo() const 728 | { 729 | return Info::Create(PropertyType::Primitive, sizeof(int64_t), false, "int64_t"); 730 | } 731 | //--------------------------------------------------------------------------- 732 | UEClass UEInt64Property::StaticClass() 733 | { 734 | static auto c = Global::Objects->FindClass("Class CoreUObject.Int64Property"); 735 | return c; 736 | } 737 | //--------------------------------------------------------------------------- 738 | //UEFloatProperty 739 | //--------------------------------------------------------------------------- 740 | UEProperty::Info UEFloatProperty::GetInfo() const 741 | { 742 | return Info::Create(PropertyType::Primitive, sizeof(float), false, "float"); 743 | } 744 | //--------------------------------------------------------------------------- 745 | UEClass UEFloatProperty::StaticClass() 746 | { 747 | static auto c = Global::Objects->FindClass("Class CoreUObject.FloatProperty"); 748 | return c; 749 | } 750 | //--------------------------------------------------------------------------- 751 | //UEDoubleProperty 752 | //--------------------------------------------------------------------------- 753 | UEProperty::Info UEDoubleProperty::GetInfo() const 754 | { 755 | return Info::Create(PropertyType::Primitive, sizeof(double), false, "double"); 756 | } 757 | //--------------------------------------------------------------------------- 758 | UEClass UEDoubleProperty::StaticClass() 759 | { 760 | static auto c = Global::Objects->FindClass("Class CoreUObject.DoubleProperty"); 761 | return c; 762 | } 763 | //--------------------------------------------------------------------------- 764 | //UEBoolProperty 765 | //--------------------------------------------------------------------------- 766 | uint8_t UEBoolProperty::GetFieldSize() const 767 | { 768 | return UBoolProperty(object).FieldSize(); 769 | } 770 | //--------------------------------------------------------------------------- 771 | uint8_t UEBoolProperty::GetByteOffset() const 772 | { 773 | return UBoolProperty(object).ByteOffset(); 774 | } 775 | //--------------------------------------------------------------------------- 776 | uint8_t UEBoolProperty::GetByteMask() const 777 | { 778 | return UBoolProperty(object).ByteMask(); 779 | } 780 | //--------------------------------------------------------------------------- 781 | uint8_t UEBoolProperty::GetFieldMask() const 782 | { 783 | return UBoolProperty(object).FieldMask(); 784 | } 785 | //--------------------------------------------------------------------------- 786 | UEProperty::Info UEBoolProperty::GetInfo() const 787 | { 788 | if (IsNativeBool()) 789 | { 790 | return Info::Create(PropertyType::Primitive, sizeof(bool), false, "bool"); 791 | } 792 | return Info::Create(PropertyType::Primitive, sizeof(unsigned char), false, "unsigned char"); 793 | } 794 | //--------------------------------------------------------------------------- 795 | UEClass UEBoolProperty::StaticClass() 796 | { 797 | static auto c = Global::Objects->FindClass("Class CoreUObject.BoolProperty"); 798 | return c; 799 | } 800 | //--------------------------------------------------------------------------- 801 | //UEObjectPropertyBase 802 | //--------------------------------------------------------------------------- 803 | UEClass UEObjectPropertyBase::GetPropertyClass() const 804 | { 805 | return UEClass(UObjectPropertyBase(object).PropertyClass()); 806 | } 807 | //--------------------------------------------------------------------------- 808 | UEClass UEObjectPropertyBase::StaticClass() 809 | { 810 | static auto c = Global::Objects->FindClass("Class CoreUObject.ObjectPropertyBase"); 811 | return c; 812 | } 813 | 814 | //--------------------------------------------------------------------------- 815 | //UEObjectProperty 816 | //--------------------------------------------------------------------------- 817 | UEProperty::Info UEObjectProperty::GetInfo() const 818 | { 819 | return Info::Create(PropertyType::Primitive, sizeof(void*), false, "class " + MakeValidName(GetPropertyClass().GetNameCPP()) + "*"); 820 | } 821 | //--------------------------------------------------------------------------- 822 | UEClass UEObjectProperty::StaticClass() 823 | { 824 | static auto c = Global::Objects->FindClass("Class CoreUObject.ObjectProperty"); 825 | return c; 826 | } 827 | //--------------------------------------------------------------------------- 828 | //UEEncryptedObjectProperty 829 | //--------------------------------------------------------------------------- 830 | UEProperty::Info UEEncryptedObjectProperty::GetInfo() const 831 | { 832 | return Info::Create(PropertyType::Primitive, sizeof(void*), false, "class " + MakeValidName(GetPropertyClass().GetNameCPP()) + "*"); 833 | } 834 | //--------------------------------------------------------------------------- 835 | UEClass UEEncryptedObjectProperty::StaticClass() 836 | { 837 | static auto c = Global::Objects->FindClass("Class CoreUObject.EncryptedObjectProperty"); 838 | return c; 839 | } 840 | //--------------------------------------------------------------------------- 841 | //UEClassProperty 842 | //--------------------------------------------------------------------------- 843 | UEClass UEClassProperty::GetMetaClass() const 844 | { 845 | return UEClass(UClassProperty(object).MetaClass()); 846 | } 847 | //--------------------------------------------------------------------------- 848 | UEProperty::Info UEClassProperty::GetInfo() const 849 | { 850 | return Info::Create(PropertyType::Primitive, sizeof(void*), false, "class " + MakeValidName(GetMetaClass().GetNameCPP()) + "*"); 851 | } 852 | //--------------------------------------------------------------------------- 853 | UEClass UEClassProperty::StaticClass() 854 | { 855 | static auto c = Global::Objects->FindClass("Class CoreUObject.ClassProperty"); 856 | return c; 857 | } 858 | //--------------------------------------------------------------------------- 859 | //UEInterfaceProperty 860 | //--------------------------------------------------------------------------- 861 | UEClass UEInterfaceProperty::GetInterfaceClass() const 862 | { 863 | return UEClass(UInterfaceProperty(object).InterfaceClass()); 864 | } 865 | //--------------------------------------------------------------------------- 866 | UEProperty::Info UEInterfaceProperty::GetInfo() const 867 | { 868 | return Info::Create(PropertyType::PredefinedStruct, sizeof(FScriptInterface), true, "TScriptInterface"); 869 | } 870 | //--------------------------------------------------------------------------- 871 | UEClass UEInterfaceProperty::StaticClass() 872 | { 873 | static auto c = Global::Objects->FindClass("Class CoreUObject.InterfaceProperty"); 874 | return c; 875 | } 876 | //--------------------------------------------------------------------------- 877 | //UEWeakObjectProperty 878 | //--------------------------------------------------------------------------- 879 | UEProperty::Info UEWeakObjectProperty::GetInfo() const 880 | { 881 | return Info::Create(PropertyType::Container, sizeof(FWeakObjectPtr), false, "TWeakObjectPtr"); 882 | } 883 | //--------------------------------------------------------------------------- 884 | UEClass UEWeakObjectProperty::StaticClass() 885 | { 886 | static auto c = Global::Objects->FindClass("Class CoreUObject.WeakObjectProperty"); 887 | return c; 888 | } 889 | //--------------------------------------------------------------------------- 890 | //UELazyObjectProperty 891 | //--------------------------------------------------------------------------- 892 | UEProperty::Info UELazyObjectProperty::GetInfo() const 893 | { 894 | return Info::Create(PropertyType::Container, sizeof(FLazyObjectPtr), false, "TLazyObjectPtr"); 895 | } 896 | //--------------------------------------------------------------------------- 897 | UEClass UELazyObjectProperty::StaticClass() 898 | { 899 | static auto c = Global::Objects->FindClass("Class CoreUObject.LazyObjectProperty"); 900 | return c; 901 | } 902 | //--------------------------------------------------------------------------- 903 | //UEAssetObjectProperty 904 | //--------------------------------------------------------------------------- 905 | UEProperty::Info UEAssetObjectProperty::GetInfo() const 906 | { 907 | return Info::Create(PropertyType::Container, sizeof(FAssetPtr), false, "TAssetPtr"); 908 | } 909 | //--------------------------------------------------------------------------- 910 | UEClass UEAssetObjectProperty::StaticClass() 911 | { 912 | static auto c = Global::Objects->FindClass("Class CoreUObject.AssetObjectProperty"); 913 | return c; 914 | } 915 | //--------------------------------------------------------------------------- 916 | //UEAssetClassProperty 917 | //--------------------------------------------------------------------------- 918 | UEClass UEAssetClassProperty::GetMetaClass() const 919 | { 920 | return UEClass(UAssetClassProperty(object).MetaClass()); 921 | } 922 | //--------------------------------------------------------------------------- 923 | UEProperty::Info UEAssetClassProperty::GetInfo() const 924 | { 925 | return Info::Create(PropertyType::Primitive, sizeof(uint8_t), false, ""); 926 | } 927 | //--------------------------------------------------------------------------- 928 | UEClass UEAssetClassProperty::StaticClass() 929 | { 930 | static auto c = Global::Objects->FindClass("Class CoreUObject.AssetClassProperty"); 931 | return c; 932 | } 933 | //--------------------------------------------------------------------------- 934 | //UENameProperty 935 | //--------------------------------------------------------------------------- 936 | UEProperty::Info UENameProperty::GetInfo() const 937 | { 938 | return Info::Create(PropertyType::PredefinedStruct, sizeof(FName), true, "struct FName"); 939 | } 940 | //--------------------------------------------------------------------------- 941 | UEClass UENameProperty::StaticClass() 942 | { 943 | static auto c = Global::Objects->FindClass("Class CoreUObject.NameProperty"); 944 | return c; 945 | } 946 | //--------------------------------------------------------------------------- 947 | //UEStructProperty 948 | //--------------------------------------------------------------------------- 949 | UEScriptStruct UEStructProperty::GetStruct() const 950 | { 951 | return UEScriptStruct(UStructProperty(object).Struct()); 952 | } 953 | //--------------------------------------------------------------------------- 954 | UEProperty::Info UEStructProperty::GetInfo() const 955 | { 956 | return Info::Create(PropertyType::CustomStruct, GetElementSize(), true, "struct " + MakeUniqueCppName(GetStruct())); 957 | } 958 | //--------------------------------------------------------------------------- 959 | UEClass UEStructProperty::StaticClass() 960 | { 961 | static auto c = Global::Objects->FindClass("Class CoreUObject.StructProperty"); 962 | return c; 963 | } 964 | //--------------------------------------------------------------------------- 965 | //UEStrProperty 966 | //--------------------------------------------------------------------------- 967 | UEProperty::Info UEStrProperty::GetInfo() const 968 | { 969 | return Info::Create(PropertyType::PredefinedStruct, sizeof(FString), true, "struct FString"); 970 | } 971 | //--------------------------------------------------------------------------- 972 | UEClass UEStrProperty::StaticClass() 973 | { 974 | static auto c = Global::Objects->FindClass("Class CoreUObject.StrProperty"); 975 | return c; 976 | } 977 | //--------------------------------------------------------------------------- 978 | //UETextProperty 979 | //--------------------------------------------------------------------------- 980 | UEProperty::Info UETextProperty::GetInfo() const 981 | { 982 | return Info::Create(PropertyType::PredefinedStruct, sizeof(FText), true, "struct FText"); 983 | } 984 | //--------------------------------------------------------------------------- 985 | UEClass UETextProperty::StaticClass() 986 | { 987 | static auto c = Global::Objects->FindClass("Class CoreUObject.TextProperty"); 988 | return c; 989 | } 990 | //--------------------------------------------------------------------------- 991 | //UEArrayProperty 992 | //--------------------------------------------------------------------------- 993 | UEProperty UEArrayProperty::GetInner() const 994 | { 995 | return UEProperty(UArrayProperty(object).Inner()); 996 | } 997 | //--------------------------------------------------------------------------- 998 | UEProperty::Info UEArrayProperty::GetInfo() const 999 | { 1000 | auto inner = GetInner().GetInfo(); 1001 | if (inner.Type != PropertyType::Unknown) 1002 | { 1003 | return Info::Create(PropertyType::Container, sizeof(TArray), false, "TArray<" + inner.CppType + ">"); 1004 | } 1005 | 1006 | return { PropertyType::Unknown }; 1007 | } 1008 | //--------------------------------------------------------------------------- 1009 | UEClass UEArrayProperty::StaticClass() 1010 | { 1011 | static auto c = Global::Objects->FindClass("Class CoreUObject.ArrayProperty"); 1012 | return c; 1013 | } 1014 | //--------------------------------------------------------------------------- 1015 | //UEMapProperty 1016 | //--------------------------------------------------------------------------- 1017 | UEProperty UEMapProperty::GetKeyProperty() const 1018 | { 1019 | return UEProperty(UMapProperty(object).KeyProp()); 1020 | } 1021 | //--------------------------------------------------------------------------- 1022 | UEProperty UEMapProperty::GetValueProperty() const 1023 | { 1024 | return UEProperty(UMapProperty(object).ValueProp()); 1025 | } 1026 | //--------------------------------------------------------------------------- 1027 | UEProperty::Info UEMapProperty::GetInfo() const 1028 | { 1029 | auto key = GetKeyProperty().GetInfo(); 1030 | auto value = GetValueProperty().GetInfo(); 1031 | if (key.Type != PropertyType::Unknown && value.Type != PropertyType::Unknown) 1032 | { 1033 | return Info::Create(PropertyType::Container, 0x50, false, "TMap<" + key.CppType + ", " + value.CppType + ">"); 1034 | } 1035 | 1036 | return { PropertyType::Unknown }; 1037 | } 1038 | //--------------------------------------------------------------------------- 1039 | UEClass UEMapProperty::StaticClass() 1040 | { 1041 | static auto c = Global::Objects->FindClass("Class CoreUObject.MapProperty"); 1042 | return c; 1043 | } 1044 | //--------------------------------------------------------------------------- 1045 | //UEDelegateProperty 1046 | //--------------------------------------------------------------------------- 1047 | UEFunction UEDelegateProperty::GetSignatureFunction() const 1048 | { 1049 | return UEFunction(UDelegateProperty(object).SignatureFunction()); 1050 | } 1051 | //--------------------------------------------------------------------------- 1052 | UEProperty::Info UEDelegateProperty::GetInfo() const 1053 | { 1054 | return Info::Create(PropertyType::PredefinedStruct, sizeof(FScriptDelegate), true, "struct FScriptDelegate"); 1055 | } 1056 | //--------------------------------------------------------------------------- 1057 | UEClass UEDelegateProperty::StaticClass() 1058 | { 1059 | static auto c = Global::Objects->FindClass("Class CoreUObject.DelegateProperty"); 1060 | return c; 1061 | } 1062 | //--------------------------------------------------------------------------- 1063 | //UEMulticastDelegateProperty 1064 | //--------------------------------------------------------------------------- 1065 | UEFunction UEMulticastDelegateProperty::GetSignatureFunction() const 1066 | { 1067 | return UEFunction(UDelegateProperty(object).SignatureFunction()); 1068 | } 1069 | //--------------------------------------------------------------------------- 1070 | UEProperty::Info UEMulticastDelegateProperty::GetInfo() const 1071 | { 1072 | return Info::Create(PropertyType::PredefinedStruct, sizeof(FScriptMulticastDelegate), true, "struct FScriptMulticastDelegate"); 1073 | } 1074 | //--------------------------------------------------------------------------- 1075 | UEClass UEMulticastDelegateProperty::StaticClass() 1076 | { 1077 | static auto c = Global::Objects->FindClass("Class CoreUObject.MulticastDelegateProperty"); 1078 | return c; 1079 | } 1080 | //--------------------------------------------------------------------------- 1081 | //UEEnumProperty 1082 | //--------------------------------------------------------------------------- 1083 | UENumericProperty UEEnumProperty::GetUnderlyingProperty() const 1084 | { 1085 | return UENumericProperty(UEnumProperty(object).UnderlyingProp()); 1086 | } 1087 | //--------------------------------------------------------------------------- 1088 | UEEnum UEEnumProperty::GetEnum() const 1089 | { 1090 | return UEEnum(UEnumProperty(object).Enum()); 1091 | } 1092 | //--------------------------------------------------------------------------- 1093 | UEProperty::Info UEEnumProperty::GetInfo() const 1094 | { 1095 | return Info::Create(PropertyType::Primitive, sizeof(uint8_t), false, MakeUniqueCppName(GetEnum())); 1096 | } 1097 | //--------------------------------------------------------------------------- 1098 | UEClass UEEnumProperty::StaticClass() 1099 | { 1100 | static auto c = Global::Objects->FindClass("Class CoreUObject.EnumProperty"); 1101 | return c; 1102 | } 1103 | //--------------------------------------------------------------------------- 1104 | int GetBitPosition(uint8_t value) 1105 | { 1106 | int i4 = !(value & 0xf) << 2; 1107 | value >>= i4; 1108 | 1109 | int i2 = !(value & 0x3) << 1; 1110 | value >>= i2; 1111 | 1112 | int i1 = !(value & 0x1); 1113 | 1114 | int i0 = (value >> i1) & 1 ? 0 : -8; 1115 | 1116 | return i4 + i2 + i1 + i0; 1117 | } 1118 | 1119 | std::array UEBoolProperty::GetMissingBitsCount(const UEBoolProperty& other) const 1120 | { 1121 | if (!other.IsValid()) 1122 | { 1123 | return { GetBitPosition(GetByteMask()), -1 }; 1124 | } 1125 | 1126 | if (GetOffset() == other.GetOffset()) 1127 | { 1128 | return { GetBitPosition(GetByteMask()) - GetBitPosition(other.GetByteMask()) - 1, -1 }; 1129 | } 1130 | return { std::numeric_limits::digits - GetBitPosition(other.GetByteMask()) - 1, GetBitPosition(GetByteMask()) }; 1131 | } 1132 | #pragma endregion 1133 | -------------------------------------------------------------------------------- /LiteSDKGenerator/SDKTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Global.h" 3 | #include 4 | #include 5 | 6 | #pragma region EngineFlags 7 | enum class UEPropertyFlags : uint64_t 8 | { 9 | Edit = 0x0000000000000001, 10 | ConstParm = 0x0000000000000002, 11 | BlueprintVisible = 0x0000000000000004, 12 | ExportObject = 0x0000000000000008, 13 | BlueprintReadOnly = 0x0000000000000010, 14 | Net = 0x0000000000000020, 15 | EditFixedSize = 0x0000000000000040, 16 | Parm = 0x0000000000000080, 17 | OutParm = 0x0000000000000100, 18 | ZeroConstructor = 0x0000000000000200, 19 | ReturnParm = 0x0000000000000400, 20 | DisableEditOnTemplate = 0x0000000000000800, 21 | Transient = 0x0000000000002000, 22 | Config = 0x0000000000004000, 23 | DisableEditOnInstance = 0x0000000000010000, 24 | EditConst = 0x0000000000020000, 25 | GlobalConfig = 0x0000000000040000, 26 | InstancedReference = 0x0000000000080000, 27 | DuplicateTransient = 0x0000000000200000, 28 | SubobjectReference = 0x0000000000400000, 29 | SaveGame = 0x0000000001000000, 30 | NoClear = 0x0000000002000000, 31 | ReferenceParm = 0x0000000008000000, 32 | BlueprintAssignable = 0x0000000010000000, 33 | Deprecated = 0x0000000020000000, 34 | IsPlainOldData = 0x0000000040000000, 35 | RepSkip = 0x0000000080000000, 36 | RepNotify = 0x0000000100000000, 37 | Interp = 0x0000000200000000, 38 | NonTransactional = 0x0000000400000000, 39 | EditorOnly = 0x0000000800000000, 40 | NoDestructor = 0x0000001000000000, 41 | AutoWeak = 0x0000004000000000, 42 | ContainsInstancedReference = 0x0000008000000000, 43 | AssetRegistrySearchable = 0x0000010000000000, 44 | SimpleDisplay = 0x0000020000000000, 45 | AdvancedDisplay = 0x0000040000000000, 46 | Protected = 0x0000080000000000, 47 | BlueprintCallable = 0x0000100000000000, 48 | BlueprintAuthorityOnly = 0x0000200000000000, 49 | TextExportTransient = 0x0000400000000000, 50 | NonPIEDuplicateTransient = 0x0000800000000000, 51 | ExposeOnSpawn = 0x0001000000000000, 52 | PersistentInstance = 0x0002000000000000, 53 | UObjectWrapper = 0x0004000000000000, 54 | HasGetValueTypeHash = 0x0008000000000000, 55 | NativeAccessSpecifierPublic = 0x0010000000000000, 56 | NativeAccessSpecifierProtected = 0x0020000000000000, 57 | NativeAccessSpecifierPrivate = 0x0040000000000000 58 | }; 59 | 60 | bool operator&(UEPropertyFlags lhs, UEPropertyFlags rhs); 61 | 62 | std::string StringifyFlags(const UEPropertyFlags flags); 63 | 64 | enum class UEFunctionFlags : uint32_t 65 | { 66 | Final = 0x00000001, 67 | RequiredAPI = 0x00000002, 68 | BlueprintAuthorityOnly = 0x00000004, 69 | BlueprintCosmetic = 0x00000008, 70 | Net = 0x00000040, 71 | NetReliable = 0x00000080, 72 | NetRequest = 0x00000100, 73 | Exec = 0x00000200, 74 | Native = 0x00000400, 75 | Event = 0x00000800, 76 | NetResponse = 0x00001000, 77 | Static = 0x00002000, 78 | NetMulticast = 0x00004000, 79 | MulticastDelegate = 0x00010000, 80 | Public = 0x00020000, 81 | Private = 0x00040000, 82 | Protected = 0x00080000, 83 | Delegate = 0x00100000, 84 | NetServer = 0x00200000, 85 | HasOutParms = 0x00400000, 86 | HasDefaults = 0x00800000, 87 | NetClient = 0x01000000, 88 | DLLImport = 0x02000000, 89 | BlueprintCallable = 0x04000000, 90 | BlueprintEvent = 0x08000000, 91 | BlueprintPure = 0x10000000, 92 | Const = 0x40000000, 93 | NetValidate = 0x80000000 94 | }; 95 | 96 | bool operator&(UEFunctionFlags lhs, UEFunctionFlags rhs); 97 | 98 | std::string StringifyFlags(const UEFunctionFlags flags); 99 | 100 | #pragma endregion 101 | 102 | #pragma region EngineTypes 103 | class FName 104 | { 105 | public: 106 | FName(); 107 | 108 | FName(uint64 _base); 109 | 110 | int GetComparisonIndex() const; 111 | 112 | int GetNumber() const; 113 | 114 | private: 115 | uint64 base; 116 | }; 117 | 118 | template 119 | class TArray 120 | { 121 | friend struct FString; 122 | 123 | public: 124 | int Length() const 125 | { 126 | return m_nCount; 127 | } 128 | 129 | bool IsValid() const 130 | { 131 | if (m_nCount > m_nMax) 132 | return false; 133 | if (!m_Data) 134 | return false; 135 | return true; 136 | } 137 | 138 | uint64 GetAddress() const 139 | { 140 | return m_Data; 141 | } 142 | 143 | T operator[](size_t i) 144 | { 145 | return Global::GameMemory->Read(m_Data + i * sizeof(T)); 146 | }; 147 | 148 | const T operator[](size_t i) const 149 | { 150 | return Global::GameMemory->Read(m_Data + i * sizeof(T)); 151 | }; 152 | 153 | T GetById(int i) 154 | { 155 | return T(Global::GameMemory->Read64(m_Data + i * 8)); 156 | } 157 | 158 | protected: 159 | uint64 m_Data; 160 | uint32 m_nCount; 161 | uint32 m_nMax; 162 | }; 163 | 164 | struct FPointer 165 | { 166 | uintptr_t Dummy; 167 | }; 168 | 169 | struct FQWord 170 | { 171 | int A; 172 | int B; 173 | }; 174 | 175 | template 176 | class TPair 177 | { 178 | public: 179 | KeyType Key; 180 | ValueType Value; 181 | }; 182 | 183 | struct FString : public TArray 184 | { 185 | std::string ToString() const; 186 | }; 187 | 188 | struct FText 189 | { 190 | char UnknownData[0x18]; 191 | }; 192 | 193 | class FScriptInterface 194 | { 195 | private: 196 | uint64* ObjectPointer; 197 | void* InterfacePointer; 198 | 199 | public: 200 | uint64* GetObject() const 201 | { 202 | return ObjectPointer; 203 | } 204 | 205 | uint64*& GetObjectRef() 206 | { 207 | return ObjectPointer; 208 | } 209 | 210 | void* GetInterface() const 211 | { 212 | return ObjectPointer != nullptr ? InterfacePointer : nullptr; 213 | } 214 | }; 215 | 216 | struct FWeakObjectPtr 217 | { 218 | int32_t ObjectIndex; 219 | int32_t ObjectSerialNumber; 220 | }; 221 | 222 | struct FStringAssetReference 223 | { 224 | FString AssetLongPathname; 225 | }; 226 | 227 | template 228 | class TPersistentObjectPtr 229 | { 230 | public: 231 | FWeakObjectPtr WeakPtr; 232 | int32_t TagAtLastTest; 233 | TObjectID ObjectID; 234 | }; 235 | 236 | class FAssetPtr : public TPersistentObjectPtr 237 | { 238 | 239 | }; 240 | 241 | struct FGuid 242 | { 243 | uint32_t A; 244 | uint32_t B; 245 | uint32_t C; 246 | uint32_t D; 247 | }; 248 | 249 | struct FUniqueObjectGuid 250 | { 251 | FGuid Guid; 252 | }; 253 | 254 | class FLazyObjectPtr : public TPersistentObjectPtr 255 | { 256 | 257 | }; 258 | 259 | struct FScriptDelegate 260 | { 261 | unsigned char UnknownData[20]; 262 | }; 263 | 264 | struct FScriptMulticastDelegate 265 | { 266 | unsigned char UnknownData[16]; 267 | }; 268 | #pragma endregion 269 | 270 | #pragma region EngineClasses 271 | 272 | class UObject 273 | { 274 | protected: 275 | uint64 base; 276 | public: 277 | UObject(uint64 _base) 278 | { 279 | base = _base; 280 | } 281 | UObject() 282 | { 283 | 284 | } 285 | int32 GetInternalIndex() const 286 | { 287 | return Updates::Dec::internal_id(Global::GameMemory->Read32(base + Updates::Off::internal_id)); 288 | } 289 | 290 | uint64 GetClass() const 291 | { 292 | return Updates::Dec::uclass(Global::GameMemory->Read64(base + Updates::Off::ulcass)); 293 | } 294 | 295 | uint64 GetOuter() const 296 | { 297 | return Updates::Dec::outer(Global::GameMemory->Read64(base + Updates::Off::outer)); 298 | } 299 | 300 | FName GetFName() const 301 | { 302 | return FName(base + Updates::Off::name); 303 | } 304 | }; 305 | 306 | class UField : public UObject 307 | { 308 | using UObject::UObject; 309 | public: 310 | uint64 Next() const 311 | { 312 | return Global::GameMemory->Read64(UObject::base + Updates::Off::next);//Vector 313 | } 314 | }; 315 | 316 | class UEnum : public UField 317 | { 318 | using UField::UField; 319 | public: 320 | TArray> Names() 321 | { 322 | return Global::GameMemory->Read>>(UObject::base + Updates::Off::enumNames); 323 | } 324 | }; 325 | 326 | class UStruct : public UField 327 | { 328 | using UField::UField; 329 | public: 330 | uint64_t SuperField() 331 | { 332 | return Global::GameMemory->Read64(UObject::base + Updates::Off::superfield); //Engine.Pawn Engine.Actor 333 | } 334 | uint32_t PropertySize() 335 | { 336 | return Global::GameMemory->Read32(UObject::base + Updates::Off::property_size); // Vector 337 | } 338 | uint64_t Children() 339 | { 340 | return Global::GameMemory->Read64(UObject::base + Updates::Off::children); // Vector 341 | } 342 | }; 343 | 344 | class UScriptStruct : public UStruct 345 | { 346 | public: 347 | }; 348 | 349 | class UFunction : public UStruct 350 | { 351 | using UStruct::UStruct; 352 | public: 353 | uint64_t Func() 354 | { 355 | return Global::GameMemory->Read64(UObject::base + Updates::Off::func); 356 | } 357 | uint32_t FunctionFlags() 358 | { 359 | return Global::GameMemory->Read32(UObject::base + Updates::Off::function_flags); 360 | } 361 | }; 362 | 363 | class UClass : public UStruct 364 | { 365 | public: 366 | }; 367 | 368 | class UProperty : public UField 369 | { 370 | using UField::UField; 371 | public: 372 | uint32_t ArrayDim() 373 | { 374 | return Global::GameMemory->Read32(UObject::base + Updates::Off::array_dim); // Vector.X=1 375 | } 376 | uint32_t ElementSize() 377 | { 378 | return Global::GameMemory->Read32(UObject::base + Updates::Off::element_size); // Vector.X = 4 379 | } 380 | uint32_t Offset() 381 | { 382 | return Global::GameMemory->Read32(UObject::base + Updates::Off::offset); // Vector.Z = 8 383 | } 384 | FQWord PropertyFlags() 385 | { 386 | return Global::GameMemory->Read(UObject::base + Updates::Off::property_flag); 387 | } 388 | }; 389 | 390 | 391 | class UNumericProperty : public UProperty 392 | { 393 | using UProperty::UProperty; 394 | public: 395 | 396 | }; 397 | 398 | class UByteProperty : public UNumericProperty 399 | { 400 | using UNumericProperty::UNumericProperty; 401 | public: 402 | uint64 Enum() 403 | { 404 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size); 405 | } 406 | }; 407 | 408 | class UUInt16Property : public UNumericProperty 409 | { 410 | public: 411 | 412 | }; 413 | 414 | class UUInt32Property : public UNumericProperty 415 | { 416 | public: 417 | 418 | }; 419 | 420 | class UUInt64Property : public UNumericProperty 421 | { 422 | public: 423 | 424 | }; 425 | 426 | class UInt8Property : public UNumericProperty 427 | { 428 | public: 429 | 430 | }; 431 | 432 | class UInt16Property : public UNumericProperty 433 | { 434 | public: 435 | 436 | }; 437 | 438 | class UIntProperty : public UNumericProperty 439 | { 440 | public: 441 | 442 | }; 443 | 444 | class UInt64Property : public UNumericProperty 445 | { 446 | public: 447 | 448 | }; 449 | 450 | class UFloatProperty : public UNumericProperty 451 | { 452 | public: 453 | 454 | }; 455 | 456 | class UDoubleProperty : public UNumericProperty 457 | { 458 | public: 459 | 460 | }; 461 | 462 | class UBoolProperty : public UProperty 463 | { 464 | using UProperty::UProperty; 465 | public: 466 | uint8_t FieldSize() 467 | { 468 | return Global::GameMemory->Read(UObject::base + Updates::Off::uproperty_size); 469 | } 470 | uint8_t ByteOffset() 471 | { 472 | return Global::GameMemory->Read(UObject::base + Updates::Off::uproperty_size + 0x2); 473 | } 474 | uint8_t ByteMask() 475 | { 476 | return Global::GameMemory->Read(UObject::base + Updates::Off::uproperty_size + 0x4); 477 | } 478 | uint8_t FieldMask() 479 | { 480 | return Global::GameMemory->Read(UObject::base + Updates::Off::uproperty_size + 0x6); 481 | } 482 | }; 483 | 484 | class UObjectPropertyBase : public UProperty 485 | { 486 | using UProperty::UProperty; 487 | public: 488 | uint64 PropertyClass() 489 | { 490 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size); 491 | } 492 | }; 493 | 494 | class UObjectProperty : public UObjectPropertyBase 495 | { 496 | using UObjectPropertyBase::UObjectPropertyBase; 497 | public: 498 | 499 | }; 500 | 501 | class UClassProperty : public UObjectProperty 502 | { 503 | using UObjectProperty::UObjectProperty; 504 | public: 505 | uint64 MetaClass() 506 | { 507 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size + 0x8); 508 | } 509 | }; 510 | 511 | class UInterfaceProperty : public UProperty 512 | { 513 | using UProperty::UProperty; 514 | public: 515 | uint64 InterfaceClass() 516 | { 517 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size); 518 | } 519 | }; 520 | 521 | class UWeakObjectProperty : public UObjectPropertyBase 522 | { 523 | public: 524 | 525 | }; 526 | 527 | class ULazyObjectProperty : public UObjectPropertyBase 528 | { 529 | public: 530 | 531 | }; 532 | 533 | class UAssetObjectProperty : public UObjectPropertyBase 534 | { 535 | using UObjectPropertyBase::UObjectPropertyBase; 536 | public: 537 | 538 | }; 539 | 540 | class UAssetClassProperty : public UAssetObjectProperty 541 | { 542 | using UAssetObjectProperty::UAssetObjectProperty; 543 | public: 544 | uint64 MetaClass() 545 | { 546 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size + 0x8); 547 | } 548 | }; 549 | 550 | class UNameProperty : public UProperty 551 | { 552 | public: 553 | 554 | }; 555 | 556 | class UStructProperty : public UProperty 557 | { 558 | using UProperty::UProperty; 559 | public: 560 | uint64 Struct() 561 | { 562 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size); 563 | } 564 | }; 565 | 566 | class UStrProperty : public UProperty 567 | { 568 | public: 569 | 570 | }; 571 | 572 | class UTextProperty : public UProperty 573 | { 574 | public: 575 | 576 | }; 577 | 578 | class UArrayProperty : public UProperty 579 | { 580 | using UProperty::UProperty; 581 | public: 582 | uint64 Inner() 583 | { 584 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size); 585 | } 586 | }; 587 | 588 | class UMapProperty : public UProperty 589 | { 590 | using UProperty::UProperty; 591 | public: 592 | uint64 KeyProp() 593 | { 594 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size); 595 | } 596 | uint64 ValueProp() 597 | { 598 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size + 0x8); 599 | } 600 | }; 601 | 602 | class UDelegateProperty : public UProperty 603 | { 604 | using UProperty::UProperty; 605 | public: 606 | uint64 SignatureFunction() 607 | { 608 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size); 609 | } 610 | }; 611 | 612 | class UMulticastDelegateProperty : public UProperty 613 | { 614 | public: 615 | uint64 SignatureFunction() 616 | { 617 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size); 618 | } 619 | }; 620 | 621 | class UEnumProperty : public UProperty 622 | { 623 | using UProperty::UProperty; 624 | public: 625 | uint64 UnderlyingProp() 626 | { 627 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size); 628 | } 629 | uint64 Enum() 630 | { 631 | return Global::GameMemory->Read64(UObject::base + Updates::Off::uproperty_size + 0x8); 632 | } 633 | }; 634 | #pragma endregion 635 | 636 | #pragma region GenericTypes 637 | class UEClass; 638 | 639 | class UEObject 640 | { 641 | public: 642 | UEObject() 643 | { 644 | object = 0; 645 | } 646 | UEObject(uint64 _object) 647 | { 648 | object = _object; 649 | uobject = UObject(_object); 650 | } 651 | 652 | bool IsValid() const 653 | { 654 | return object != 0; 655 | } 656 | 657 | int GetIndex() const; 658 | 659 | UEClass GetClass() const; 660 | 661 | UEObject GetOuter() const; 662 | 663 | std::string GetName() const; 664 | 665 | std::string GetFullName() const; 666 | 667 | std::string GetFullPath() const; 668 | 669 | std::string GetNameCPP() const; 670 | 671 | UEObject GetPackageObject() const; 672 | 673 | int GetComparisonIndex() const; 674 | 675 | uint64 GetAddress() const; 676 | 677 | bool operator!=(UEObject b) 678 | { 679 | return object != b.object; 680 | } 681 | 682 | template 683 | Type Cast() const 684 | { 685 | return Type(object); 686 | } 687 | 688 | template bool IsA() const 689 | { 690 | auto cmp = T::StaticClass(); 691 | if (!cmp.IsValid()) 692 | { 693 | return false; 694 | } 695 | for (auto super = GetClass(); super.IsValid(); super = super.GetSuper().Cast()) 696 | { 697 | if (super.object == cmp.object) 698 | { 699 | return true; 700 | } 701 | } 702 | 703 | return false; 704 | } 705 | 706 | static UEClass StaticClass(); 707 | 708 | protected: 709 | uint64 object; 710 | UObject uobject; 711 | }; 712 | 713 | class UEField : public UEObject 714 | { 715 | public: 716 | using UEObject::UEObject; 717 | 718 | UEField GetNext() const; 719 | 720 | static UEClass StaticClass(); 721 | }; 722 | class UEEnum : public UEField 723 | { 724 | public: 725 | using UEField::UEField; 726 | 727 | std::vector GetNames() const; 728 | static UEClass StaticClass(); 729 | }; 730 | 731 | class UEConst : public UEField 732 | { 733 | public: 734 | using UEField::UEField; 735 | 736 | std::string GetValue() const; 737 | 738 | static UEClass StaticClass(); 739 | }; 740 | 741 | class UEStruct : public UEField 742 | { 743 | public: 744 | using UEField::UEField; 745 | 746 | UEStruct GetSuper() const; 747 | 748 | UEField GetChildren() const; 749 | 750 | size_t GetPropertySize() const; 751 | 752 | static UEClass StaticClass(); 753 | }; 754 | 755 | class UEProperty : public UEField 756 | { 757 | public: 758 | using UEField::UEField; 759 | 760 | size_t GetArrayDim() const; 761 | 762 | size_t GetElementSize() const; 763 | 764 | UEPropertyFlags GetPropertyFlags() const; 765 | 766 | size_t GetOffset() const; 767 | 768 | enum class PropertyType 769 | { 770 | Unknown, 771 | Primitive, 772 | PredefinedStruct, 773 | CustomStruct, 774 | Container 775 | }; 776 | 777 | struct Info 778 | { 779 | PropertyType Type; 780 | size_t Size; 781 | bool CanBeReference; 782 | std::string CppType; 783 | static Info Create(PropertyType type, size_t size, bool reference, std::string&& cppType) 784 | { 785 | return { type, size, reference, cppType }; 786 | } 787 | }; 788 | 789 | 790 | Info GetInfo() const; 791 | 792 | static UEClass StaticClass(); 793 | }; 794 | 795 | /* 796 | UEStruct: 797 | UEScriptStruct 798 | UEClass 799 | */ 800 | 801 | class UEFunction : public UEStruct 802 | { 803 | public: 804 | using UEStruct::UEStruct; 805 | 806 | UEFunctionFlags GetFunctionFlags() const; 807 | 808 | uint64 GetFunc() const; 809 | 810 | static UEClass StaticClass(); 811 | }; 812 | 813 | class UEScriptStruct : public UEStruct 814 | { 815 | public: 816 | using UEStruct::UEStruct; 817 | 818 | static UEClass StaticClass(); 819 | }; 820 | 821 | class UEClass : public UEStruct 822 | { 823 | public: 824 | using UEStruct::UEStruct; 825 | 826 | static UEClass StaticClass(); 827 | }; 828 | 829 | class UENumericProperty : public UEProperty 830 | { 831 | public: 832 | using UEProperty::UEProperty; 833 | 834 | static UEClass StaticClass(); 835 | }; 836 | 837 | class UEByteProperty : public UENumericProperty 838 | { 839 | public: 840 | using UENumericProperty::UENumericProperty; 841 | 842 | bool IsEnum() const; 843 | 844 | UEEnum GetEnum() const; 845 | 846 | UEProperty::Info GetInfo() const; 847 | 848 | static UEClass StaticClass(); 849 | }; 850 | 851 | class UEUInt16Property : public UENumericProperty 852 | { 853 | public: 854 | using UENumericProperty::UENumericProperty; 855 | 856 | UEProperty::Info GetInfo() const; 857 | 858 | static UEClass StaticClass(); 859 | }; 860 | 861 | class UEUInt32Property : public UENumericProperty 862 | { 863 | public: 864 | using UENumericProperty::UENumericProperty; 865 | 866 | UEProperty::Info GetInfo() const; 867 | 868 | static UEClass StaticClass(); 869 | }; 870 | 871 | class UEUInt64Property : public UENumericProperty 872 | { 873 | public: 874 | using UENumericProperty::UENumericProperty; 875 | 876 | UEProperty::Info GetInfo() const; 877 | 878 | static UEClass StaticClass(); 879 | }; 880 | 881 | class UEInt8Property : public UENumericProperty 882 | { 883 | public: 884 | using UENumericProperty::UENumericProperty; 885 | 886 | UEProperty::Info GetInfo() const; 887 | 888 | static UEClass StaticClass(); 889 | }; 890 | 891 | class UEInt16Property : public UENumericProperty 892 | { 893 | public: 894 | using UENumericProperty::UENumericProperty; 895 | 896 | UEProperty::Info GetInfo() const; 897 | 898 | static UEClass StaticClass(); 899 | }; 900 | 901 | class UEIntProperty : public UENumericProperty 902 | { 903 | public: 904 | using UENumericProperty::UENumericProperty; 905 | 906 | UEProperty::Info GetInfo() const; 907 | 908 | static UEClass StaticClass(); 909 | }; 910 | 911 | class UEInt64Property : public UENumericProperty 912 | { 913 | public: 914 | using UENumericProperty::UENumericProperty; 915 | 916 | UEProperty::Info GetInfo() const; 917 | 918 | static UEClass StaticClass(); 919 | }; 920 | 921 | class UEFloatProperty : public UENumericProperty 922 | { 923 | public: 924 | using UENumericProperty::UENumericProperty; 925 | 926 | UEProperty::Info GetInfo() const; 927 | 928 | static UEClass StaticClass(); 929 | }; 930 | 931 | class UEDoubleProperty : public UENumericProperty 932 | { 933 | public: 934 | using UENumericProperty::UENumericProperty; 935 | 936 | UEProperty::Info GetInfo() const; 937 | 938 | static UEClass StaticClass(); 939 | }; 940 | 941 | class UEBoolProperty : public UEProperty 942 | { 943 | public: 944 | using UEProperty::UEProperty; 945 | 946 | bool IsNativeBool() const { return GetFieldMask() == 0xFF; } 947 | 948 | bool IsBitfield() const { return !IsNativeBool(); } 949 | 950 | uint8_t GetFieldSize() const; 951 | 952 | uint8_t GetByteOffset() const; 953 | 954 | uint8_t GetByteMask() const; 955 | 956 | uint8_t GetFieldMask() const; 957 | 958 | std::array GetMissingBitsCount(const UEBoolProperty& other) const; 959 | 960 | UEProperty::Info GetInfo() const; 961 | 962 | static UEClass StaticClass(); 963 | }; 964 | 965 | inline bool operator<(const UEBoolProperty& lhs, const UEBoolProperty& rhs) 966 | { 967 | if (lhs.GetByteOffset() == rhs.GetByteOffset()) 968 | { 969 | return lhs.GetByteMask() < rhs.GetByteMask(); 970 | } 971 | return lhs.GetByteOffset() < rhs.GetByteOffset(); 972 | } 973 | 974 | class UEObjectPropertyBase : public UEProperty 975 | { 976 | public: 977 | using UEProperty::UEProperty; 978 | 979 | UEClass GetPropertyClass() const; 980 | 981 | static UEClass StaticClass(); 982 | }; 983 | 984 | class UEObjectProperty : public UEObjectPropertyBase 985 | { 986 | public: 987 | using UEObjectPropertyBase::UEObjectPropertyBase; 988 | 989 | UEProperty::Info GetInfo() const; 990 | 991 | static UEClass StaticClass(); 992 | }; 993 | 994 | class UEEncryptedObjectProperty : public UEObjectPropertyBase 995 | { 996 | public: 997 | using UEObjectPropertyBase::UEObjectPropertyBase; 998 | 999 | UEProperty::Info GetInfo() const; 1000 | 1001 | static UEClass StaticClass(); 1002 | }; 1003 | 1004 | class UEClassProperty : public UEObjectProperty 1005 | { 1006 | public: 1007 | using UEObjectProperty::UEObjectProperty; 1008 | 1009 | UEClass GetMetaClass() const; 1010 | 1011 | UEProperty::Info GetInfo() const; 1012 | 1013 | static UEClass StaticClass(); 1014 | }; 1015 | 1016 | class UEInterfaceProperty : public UEProperty 1017 | { 1018 | public: 1019 | using UEProperty::UEProperty; 1020 | 1021 | UEClass GetInterfaceClass() const; 1022 | 1023 | UEProperty::Info GetInfo() const; 1024 | 1025 | static UEClass StaticClass(); 1026 | }; 1027 | 1028 | class UEWeakObjectProperty : public UEObjectPropertyBase 1029 | { 1030 | public: 1031 | using UEObjectPropertyBase::UEObjectPropertyBase; 1032 | 1033 | UEProperty::Info GetInfo() const; 1034 | 1035 | static UEClass StaticClass(); 1036 | }; 1037 | 1038 | class UELazyObjectProperty : public UEObjectPropertyBase 1039 | { 1040 | public: 1041 | using UEObjectPropertyBase::UEObjectPropertyBase; 1042 | 1043 | UEProperty::Info GetInfo() const; 1044 | 1045 | static UEClass StaticClass(); 1046 | }; 1047 | 1048 | class UEAssetObjectProperty : public UEObjectPropertyBase 1049 | { 1050 | public: 1051 | using UEObjectPropertyBase::UEObjectPropertyBase; 1052 | 1053 | UEProperty::Info GetInfo() const; 1054 | 1055 | static UEClass StaticClass(); 1056 | }; 1057 | 1058 | class UEAssetClassProperty : public UEAssetObjectProperty 1059 | { 1060 | public: 1061 | using UEAssetObjectProperty::UEAssetObjectProperty; 1062 | 1063 | UEClass GetMetaClass() const; 1064 | 1065 | UEProperty::Info GetInfo() const; 1066 | 1067 | static UEClass StaticClass(); 1068 | }; 1069 | 1070 | class UENameProperty : public UEProperty 1071 | { 1072 | public: 1073 | using UEProperty::UEProperty; 1074 | 1075 | UEProperty::Info GetInfo() const; 1076 | 1077 | static UEClass StaticClass(); 1078 | }; 1079 | 1080 | class UEStructProperty : public UEProperty 1081 | { 1082 | public: 1083 | using UEProperty::UEProperty; 1084 | 1085 | UEScriptStruct GetStruct() const; 1086 | 1087 | UEProperty::Info GetInfo() const; 1088 | 1089 | static UEClass StaticClass(); 1090 | }; 1091 | 1092 | class UEStrProperty : public UEProperty 1093 | { 1094 | public: 1095 | using UEProperty::UEProperty; 1096 | 1097 | UEProperty::Info GetInfo() const; 1098 | 1099 | static UEClass StaticClass(); 1100 | }; 1101 | 1102 | class UETextProperty : public UEProperty 1103 | { 1104 | public: 1105 | using UEProperty::UEProperty; 1106 | 1107 | UEProperty::Info GetInfo() const; 1108 | 1109 | static UEClass StaticClass(); 1110 | }; 1111 | 1112 | class UEArrayProperty : public UEProperty 1113 | { 1114 | public: 1115 | using UEProperty::UEProperty; 1116 | 1117 | UEProperty GetInner() const; 1118 | 1119 | UEProperty::Info GetInfo() const; 1120 | 1121 | static UEClass StaticClass(); 1122 | }; 1123 | 1124 | class UEMapProperty : public UEProperty 1125 | { 1126 | public: 1127 | using UEProperty::UEProperty; 1128 | 1129 | UEProperty GetKeyProperty() const; 1130 | UEProperty GetValueProperty() const; 1131 | 1132 | UEProperty::Info GetInfo() const; 1133 | 1134 | static UEClass StaticClass(); 1135 | }; 1136 | 1137 | class UEDelegateProperty : public UEProperty 1138 | { 1139 | public: 1140 | using UEProperty::UEProperty; 1141 | 1142 | UEFunction GetSignatureFunction() const; 1143 | 1144 | UEProperty::Info GetInfo() const; 1145 | 1146 | static UEClass StaticClass(); 1147 | }; 1148 | 1149 | class UEMulticastDelegateProperty : public UEProperty 1150 | { 1151 | public: 1152 | using UEProperty::UEProperty; 1153 | 1154 | UEFunction GetSignatureFunction() const; 1155 | 1156 | UEProperty::Info GetInfo() const; 1157 | 1158 | static UEClass StaticClass(); 1159 | }; 1160 | 1161 | class UEEnumProperty : public UEProperty 1162 | { 1163 | public: 1164 | using UEProperty::UEProperty; 1165 | 1166 | UENumericProperty GetUnderlyingProperty() const; 1167 | UEEnum GetEnum() const; 1168 | 1169 | UEProperty::Info GetInfo() const; 1170 | 1171 | static UEClass StaticClass(); 1172 | }; 1173 | 1174 | #pragma endregion 1175 | 1176 | #pragma region NameValidator 1177 | std::string MakeValidName(std::string&& name); 1178 | 1179 | template 1180 | std::string MakeUniqueCppNameImpl(const T& t); 1181 | 1182 | std::string MakeUniqueCppName(const UEEnum& e); 1183 | 1184 | std::string MakeUniqueCppName(const UEStruct& ss); 1185 | 1186 | #pragma endregion -------------------------------------------------------------------------------- /LiteSDKGenerator/Updates.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "UtilsDefs.h" 3 | #include "Memory.h" 4 | 5 | namespace Updates 6 | { 7 | class Off 8 | { 9 | public: 10 | // Main 11 | static const uint64 GNames = 0x453B6F0; 12 | static const uint64 ObjObjects = 0x46BCDB0; 13 | //GNames 14 | static const uint64 chunksize = 0x4030; 15 | static const uint64 static_gnames = 0x11EA78; 16 | // UObject 17 | static const uint64 ulcass = 0x20; 18 | static const uint64 internal_id = 0x1c; 19 | static const uint64 name = 0x14; 20 | static const uint64 outer = 0x8; 21 | // FName 22 | static const uint64 number = 0x4; 23 | static const uint64 comparison_id = 0x0; 24 | // UField 25 | static const uint64 next = 0x28; 26 | // UEnum 27 | static const uint64 enumNames = 0x40; 28 | // UStruct 29 | static const uint64 superfield = 0x68; 30 | static const uint64 property_size = 0x88; 31 | static const uint64 children = 0x50; 32 | // UFunction 33 | static const uint64 func = 0x90; 34 | static const uint64 function_flags = 0xB8; 35 | // UProperty 36 | static const uint64 array_dim = 0x30; 37 | static const uint64 element_size = 0x34; 38 | static const uint64 offset = 0x44; 39 | static const uint64 property_flag = 0x38; 40 | 41 | static const uint64 uproperty_size = 0x70; 42 | }; 43 | 44 | class Dec 45 | { 46 | public: 47 | // UObject 48 | static uint64 objobjects(uint64 v7) 49 | { 50 | uint64 add = ((v7 & 0x15151515 ^ v7 & 0xEAEAEAEA) - 1960050811) ^ 0x8B2BFF85; 51 | HIDWORD(add) = 0x0000021e; // manual edit here. 52 | return add; 53 | } 54 | static int32 internal_id(uint32 v248) 55 | { 56 | return __ROL4__(v248 ^ 0x3F134169, 5) ^ (__ROL4__(v248 ^ 0x3F134169, 5) << 16) ^ 0x7A7E1103; 57 | } 58 | static uint64 uclass(uint64 v14) 59 | { 60 | return __ROL8__(v14 ^ 0x6D93A24294179303i64, 19) ^ (__ROL8__(v14 ^ 0x6D93A24294179303i64, 19) << 32) ^ 0xE87A094B09D169B2ui64; 61 | } 62 | static uint64 outer(uint64 v30) 63 | { 64 | return __ROR8__(v30 ^ 0x6215B3BA387150AAi64, 28) ^ (__ROR8__(v30 ^ 0x6215B3BA387150AAi64, 28) << 32) ^ 0x479B8E128B695D5Ai64; 65 | } 66 | //FName 67 | static int32 comparison_id(uint32 v15) 68 | { 69 | return __ROR4__(v15 ^ 0x7766ED5E, 14) ^ (__ROR4__(v15 ^ 0x7766ED5E, 14) << 16) ^ 0xF159012D; 70 | } 71 | static int32 number(uint32 v6) 72 | { 73 | return __ROR4__(v6 ^ 0x12DF074, 4) ^ (__ROR4__(v6 ^ 0x12DF074, 4) << 16) ^ 0x9A387766; 74 | } 75 | }; 76 | } 77 | 78 | namespace Settings 79 | { 80 | static std::string ProcessName = "PUBGLite-Win64-Shipping"; 81 | static std::string MoudleName = "PUBGLite-Win64-Shipping.exe"; 82 | static std::string WindowsClass = "UnrealWindow"; 83 | static std::string WindowsCaption = "PUBG LITE "; 84 | static std::string SDKFolderName = "PUBGLITE_SDK"; 85 | static std::string SDKAllFileName = "SDK_All.cpp"; 86 | static std::string GObjectsFileName = "ObjectsDump.txt"; 87 | static std::string NamesFileName = "NamesDump.txt"; 88 | static std::string AuthorNotes = "By COHERENCE\nSDK Generator: https://github.com/C0HERENCE/LiteSDKGenerator \n"; 89 | static std::string OutPutString = 90 | R"(// UField 91 | static const uint64 next = 0x{0:X}; 92 | // UEnum 93 | static const uint64 enumNames = 0x{1:X}; 94 | // UStruct 95 | static const uint64 superfield = 0x{2:X}; 96 | static const uint64 property_size = 0x{3:X}; 97 | static const uint64 children = 0x{4:X}; 98 | // UFunction 99 | static const uint64 func = 0x{5:X}; 100 | static const uint64 function_flags = 0x{6:X}; 101 | // UProperty 102 | static const uint64 array_dim = 0x{7:X}; 103 | static const uint64 element_size = 0x{8:X}; 104 | static const uint64 offset = 0x{9:X}; 105 | static const uint64 property_flag = 0x{10:X}; 106 | 107 | static const uint64 uproperty_size = 0x{11:X};\n)"; 108 | } -------------------------------------------------------------------------------- /LiteSDKGenerator/UtilsDefs.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | typedef char int8; 3 | typedef unsigned char uint8; 4 | typedef short int16; 5 | typedef unsigned short uint16; 6 | typedef int int32; 7 | typedef unsigned int uint32; 8 | typedef __int64 int64; 9 | typedef unsigned __int64 uint64; 10 | 11 | #define _BYTE uint8 12 | #define _WORD uint16 13 | #define _DWORD uint32 14 | #define _QWORD uint64 15 | #define NULL 0 16 | #define LAST_IND(x,part_type) (sizeof(x)/sizeof(part_type) - 1) 17 | #define HIGH_IND(x,part_type) LAST_IND(x,part_type) 18 | #define LOW_IND(x,part_type) 0 19 | #define BYTEn(x, n) (*((_BYTE*)&(x)+n)) 20 | #define WORDn(x, n) (*((_WORD*)&(x)+n)) 21 | #define DWORDn(x, n) (*((_DWORD*)&(x)+n)) 22 | #define LODWORD(x) DWORDn(x,LOW_IND(x,_DWORD)) 23 | #define HIDWORD(x) DWORDn(x,HIGH_IND(x,_DWORD)) 24 | #define BYTE1(x) BYTEn(x, 1) // byte 1 (counting from 0) 25 | #define BYTE2(x) BYTEn(x, 2) 26 | #define BYTE3(x) BYTEn(x, 3) 27 | #define BYTE4(x) BYTEn(x, 4) 28 | #define BYTE5(x) BYTEn(x, 5) 29 | #define BYTE6(x) BYTEn(x, 6) 30 | #define BYTE7(x) BYTEn(x, 7) 31 | #define BYTE8(x) BYTEn(x, 8) 32 | #define BYTE9(x) BYTEn(x, 9) 33 | #define BYTE10(x) BYTEn(x, 10) 34 | #define BYTE11(x) BYTEn(x, 11) 35 | #define BYTE12(x) BYTEn(x, 12) 36 | #define BYTE13(x) BYTEn(x, 13) 37 | #define BYTE14(x) BYTEn(x, 14) 38 | #define BYTE15(x) BYTEn(x, 15) 39 | #define WORD1(x) WORDn(x, 1) 40 | #define WORD2(x) WORDn(x, 2) // third word of the object, unsigned 41 | #define WORD3(x) WORDn(x, 3) 42 | #define WORD4(x) WORDn(x, 4) 43 | #define WORD5(x) WORDn(x, 5) 44 | #define WORD6(x) WORDn(x, 6) 45 | #define WORD7(x) WORDn(x, 7) 46 | 47 | template int16 __PAIR__(int8 high, T low) { return (((int16)high) << sizeof(high) * 8) | uint8(low); } 48 | template int32 __PAIR__(int16 high, T low) { return (((int32)high) << sizeof(high) * 8) | uint16(low); } 49 | template int64 __PAIR__(int32 high, T low) { return (((int64)high) << sizeof(high) * 8) | uint32(low); } 50 | template uint16 __PAIR__(uint8 high, T low) { return (((uint16)high) << sizeof(high) * 8) | uint8(low); } 51 | template uint32 __PAIR__(uint16 high, T low) { return (((uint32)high) << sizeof(high) * 8) | uint16(low); } 52 | template uint64 __PAIR__(uint32 high, T low) { return (((uint64)high) << sizeof(high) * 8) | uint32(low); } 53 | 54 | template T __ROL__(T value, int count) 55 | { 56 | const uint32 nbits = sizeof(T) * 8; 57 | 58 | if (count > 0) 59 | { 60 | count %= nbits; 61 | T high = value >> (nbits - count); 62 | if (T(-1) < 0) // signed value 63 | high &= ~((T(-1) << count)); 64 | value <<= count; 65 | value |= high; 66 | } 67 | else 68 | { 69 | count = -count % nbits; 70 | T low = value << (nbits - count); 71 | value >>= count; 72 | value |= low; 73 | } 74 | return value; 75 | } 76 | 77 | inline uint8 __ROL1__(uint8 value, int count) { return __ROL__((uint8)value, count); } 78 | inline uint16 __ROL2__(uint16 value, int count) { return __ROL__((uint16)value, count); } 79 | inline uint32 __ROL4__(uint32 value, int count) { return __ROL__((uint32)value, count); } 80 | inline uint64 __ROL8__(uint64 value, int count) { return __ROL__((uint64)value, count); } 81 | inline uint8 __ROR1__(uint8 value, int count) { return __ROL__((uint8)value, -count); } 82 | inline uint16 __ROR2__(uint16 value, int count) { return __ROL__((uint16)value, -count); } 83 | inline uint32 __ROR4__(uint32 value, int count) { return __ROL__((uint32)value, -count); } 84 | inline uint64 __ROR8__(uint64 value, int count) { return __ROL__((uint64)value, -count); } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ```cpp 2 | Thanks for your stars || forks 😀 3 | ``` 4 | # LiteSDKGenerator 5 | PUBG Lite SDK External Generator 6 | # Purpose 7 | The SDK exported is **simple and rough** , use it for reference only. 8 | 9 | # Usage 10 | 11 | - First Update offsets and decryptions in **Updates.h**. 12 | - **UObject Test** will list first 5 UObjects info. 13 | - **Find GName** will scan for static GName offset. 14 | - **Auto Update** could help you find offsets of UnrealEngine Types. 15 | - **Export Names** will export all names in GNames 16 | - **Export Useful** could help you get useful offsets quickly 17 | - **Expor SDK** will generates a simple sdk 18 | - Optionnaly edit some export settings in **Updates.h**. 19 | 20 | # Screenshot 21 | ![6}I{ST3VW1_U4W{4Q{QGJJL.png](./images/MainForm.jpg?raw=true)![6}I{ST3VW1_U4W{4Q{QGJJL.png](./images/FindGNames.jpg?raw=true)![6}I{ST3VW1_U4W{4Q{QGJJL.png](./images/AutoUpdate.jpg?raw=true)![6}I{ST3VW1_U4W{4Q{QGJJL.png](./images/UObjectTest.jpg?raw=true)![6}I{ST3VW1_U4W{4Q{QGJJL.png](./images/ExportUseful.jpg?raw=true)![6}I{ST3VW1_U4W{4Q{QGJJL.png](./images/DumpSDK.jpg?raw=true) -------------------------------------------------------------------------------- /images/AutoUpdate.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/C0HERENCE/LiteSDKGenerator/2371178cba902e137f54e6ab9036400e1998b8ba/images/AutoUpdate.jpg -------------------------------------------------------------------------------- /images/DumpSDK.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/C0HERENCE/LiteSDKGenerator/2371178cba902e137f54e6ab9036400e1998b8ba/images/DumpSDK.jpg -------------------------------------------------------------------------------- /images/ExportUseful.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/C0HERENCE/LiteSDKGenerator/2371178cba902e137f54e6ab9036400e1998b8ba/images/ExportUseful.jpg -------------------------------------------------------------------------------- /images/FindGNames.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/C0HERENCE/LiteSDKGenerator/2371178cba902e137f54e6ab9036400e1998b8ba/images/FindGNames.jpg -------------------------------------------------------------------------------- /images/MainForm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/C0HERENCE/LiteSDKGenerator/2371178cba902e137f54e6ab9036400e1998b8ba/images/MainForm.jpg -------------------------------------------------------------------------------- /images/UObjectTest.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/C0HERENCE/LiteSDKGenerator/2371178cba902e137f54e6ab9036400e1998b8ba/images/UObjectTest.jpg --------------------------------------------------------------------------------