CodeRedModding / CodeRed-Generator

A modern C++20 internal SDK generator for Unreal Engine 3 games.
MIT License
44 stars 19 forks source link

Random Crashing when generating SDK. #10

Closed frauderik closed 4 months ago

frauderik commented 4 months ago

When the structs and offsets where bad, this would work find. Compiling in 32BIT and injecting would properly give me errors about sizes and offsets. After finding them via ReClass and via trial and error I reduced it down to just the UFunction and the UProperty. It would still generate the SDK but with 0 props, just empty padding (this is the behaviour i expected). Until I updated the UProperty class. Once I changed it to be proper, the generator just crashes. I have added console logs to try and deduce what is happeneing but am still unsure and wondering if you have come accross this behaviour before?

Video Demonstration (UProperty Correct)

https://github.com/CodeRedModding/CodeRed-Generator/assets/121964555/1d280659-e854-48f4-848a-7a8d0570ae4a

Video Demonstration (UProperty Incorrect)

https://github.com/CodeRedModding/CodeRed-Generator/assets/121964555/32b950a1-4948-4abc-8dcf-56d6acb6c3b3

ReClass Deconstructed

image

frauderik commented 4 months ago

Also, my UFunction offsets do not matter as they never get to that point. It could be size 9999 and would still crash at the same point

frauderik commented 4 months ago

Okasy update apparently some of my offsets and padding where bad, for anyone looking here is what I have found it to be: image

I have gotten further to the point of successfully generating the consts, enums, and structs. It crashes as soon as it tries to generate classes:

(StructGenerator::ProcessStructs(Core_structs.hpp, Core)) Completed
(ConstGenerator::ProcessConsts(Core_classes.hpp, Core)) Completed
(EnumGenerator::ProcessEnums(Core_classes.hpp, Core)) Completed
ProcessClasses(Core) Starting
GenerateClassPre(Core, TextBuffer) Starting PreGeneration
GenerateClassPre(Core, Object) Starting PreGeneration
GenerateClass(Object) Starting Class Generation
Class Member - Could not auto generate

I will investigate further and from the looks of it, it is probably a fault on my end however some input would be helpful.

ItsBranK commented 4 months ago

You can comment everything out in the generator so it only tries to generate structs, would help you narrow down the issue in your classes as you'd only have to look at a few of them (UObject, UField, UStruct, and UProperty). Double checking all the classes that inherit from UProperty would also help in case one of those are wrong too and the issue is there, like UStructProperty, UStrProperty, UObjectProperty, etc...

frauderik commented 4 months ago

Hello. It appears that yes my classes or property definitions are incorrect 😭 image

Do you have discord? if so please add me: @frauderik I would like to ask something of you privately

ItsBranK commented 4 months ago

Added on discord and it was an issue with class padding / offsets being wrong in his classes, closing this issue for now