Repository navigation
Tuanjie Support - #3
neptuwunium wants to merge 3 commits into
Conversation
| if ((x.Protection & ExecutableSection::kSectionProtectionRead) == 0) | ||
| return false; | ||
|
|
||
| if (x.Data.size() < sizeof(RuntimeTypeArray)) |
There was a problem hiding this comment.
note: without this check, sections that are less than the size of the runtime array will loop indefinitely.
Linux has a bunch of tiny < 1KiB sections, maybe Android too under certain situations.
| static Revision CachedRevision = Revision::Count; | ||
|
|
||
| int vfprintf(FILE *stream, const char *format, va_list ap) { | ||
| orig_vfprintf_type orig_vfprintf = (orig_vfprintf_type)dlsym(RTLD_NEXT, "vfprintf"); |
There was a problem hiding this comment.
LD_PRELOAD=libTypeTreeRipper.so ./Unity
| // "engine version:" -> Runtime: Version | ||
| // "Editor version:" -> Editor: version | ||
| // is there a better way?? | ||
| if (CachedRevision == Revision::Count && strstr(tmp_buffer, "engine version:")) { |
There was a problem hiding this comment.
Count comparison is necessary because the process forks into a player runtime, making the editor dump from the editor module with player structs.
Likely a better way to determine this.
| { | ||
| t.GetData()->SetGenerationFlags(options); | ||
| } | ||
| *reinterpret_cast<int64_t *>((char*)(this) + 0x5c) = 0x4d; |
Likely because the VTable and structs keeps getting updated. I'll take a look but there needs to be a better way to handle all 70 different Tuanjie versions. 3.62t2, 3.61t1 and 3.38t1 all have differences. Unity China actually doing major work to the internals of Unity/Tuanjie with only bumping the Tuanjie version is problematic for the way this project tracks versions. I only tested 2022.3.62t17 |
I made some attempts to get this working on On this version of the Tuanjie Editor, It can process most types up until
I haven't figured out why it fails yet. My code is here: AXiX-official/TuanjieTypeTreeRipper@fae2b7f |
This happens when the graphics managers aren't initialized, since the camera object tries to get global rendering settings.
This seems like the GenerateTypeTreeTransfer class changed between these versions. I would look at that constructor in Ghidra/Ida/Binary Ninja and see if it still matches up to my lazy copy. In an older project which uses TypeTreeCache::GetTypeTree instead of Object::VirtualRedirectTransfer, this problem does not occur but that constructor is also handled internally within Unity in that path so that's where I would look first. |
That's probably because Hmm. Maybe finding the RTTI array early and trying to hook the |
There is an assertion in there to check if the singleton is initialized, but it's in a |
I made it works for all 71 existing Tuanjie version. code here: TuanjieTypeTreeRipper and dumps here: TuanjieTypeTreeDumps |



Oh boy.
This is a draft because it requires some architectural changes. Tuanjie uses the same version number (in fact, everything is on 2022.3.62 with an increasing f number (
tin this case) 1.11.0 is 2022.3.62t17.)As such for Tuanjie version tracking, the sub-revision number needs to be tracked and compared as well, and likely another 2 variants since they did make some changes.
DO NOT MERGE THIS, I made this PR because I don't intend on cleaning it up and just putting my notes here in case someone wants to.
Also includes badly implemented Linux support which is some frankensteined half-Android half-Windows loader.