UnrealMappingsDumper icon indicating copy to clipboard operation
UnrealMappingsDumper copied to clipboard

UE 5.1 Release support

Open Kein opened this issue 2 years ago • 17 comments

I'm getting a hard crash after injection and I'm unable to get any debug info because it seems to be inside engine code (that, or Visual Studio debugger being shit again).

Kein avatar Nov 21 '22 19:11 Kein

Compile it in debug mode and attach to your game. Inject the compiled DLL and send where it crashes and the call stack

TheNaeem avatar Nov 21 '22 19:11 TheNaeem

That is what I did.

Kein avatar Nov 21 '22 20:11 Kein

Can you send it?

TheNaeem avatar Nov 21 '22 20:11 TheNaeem

I'm unable to get any debug info because it seems to be inside engine code (that, or Visual Studio debugger being shit again).

Kein avatar Nov 21 '22 20:11 Kein

You can still get the line it crashes on from the call stack. If you can't, just step through it line by line until it crashes and see where it happens

TheNaeem avatar Nov 21 '22 22:11 TheNaeem

Nope, it simply does not work, it just segfaults without any break as if no debugger attached. I managed to get a break in Rider, but its output is hard to read. Looks like it fails at DefaultEngine<T>::UObject::GetPathName(std::wstring& Result, UObject* StopOuter) in engine.cpp:41: Result += NamePrivate.AsString(); ComparisonIndex and Number seem valid for FName: 117768197 and 87832 The final crash is inside Engine code: image

Full stack:

[Inlined] FName::ToString(FString &) UnrealNames.cpp:3399
FName::ToString() UnrealNames.cpp:3371
FNameBase::AsString() engine.cpp:9
DefaultEngine<UObjectDependency>::UObject::GetPathName(std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > &,DefaultEngine<UObjectDependency>::UObject *) engine.cpp:41
DefaultEngine<UObjectDependency>::UObject::GetPath() engine.h:75
DefaultEngine<UObjectDependency>::FindObject<DefaultEngine<UObjectDependency>::UClass>(basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >) engine.h:39
DefaultEngine<UObjectDependency>::UClass::StaticClass() engine.h:393
`Dumper<Engine_UE5>::Run'::`2'::<lambda_2>::operator()(DefaultEngine<UObjectDependency>::UObject *&) dumper.cpp:130
std::invoke<`Dumper<Engine_UE5>::Run'::`2'::<lambda_2> &,DefaultEngine<UObjectDependency>::UObject * &>(<lambda_2> &,DefaultEngine<UObjectDependency>::UObject *&) type_traits:1534
std::_Invoker_ret<void,1>::_Call<`Dumper<Engine_UE5>::Run'::`2'::<lambda_2> &,DefaultEngine<UObjectDependency>::UObject * &>(<lambda_2> &,DefaultEngine<UObjectDependency>::UObject *&) functional:651
std::_Func_impl_no_alloc<`Dumper<Engine_UE5>::Run'::`2'::<lambda_2>,void,DefaultEngine<UObjectDependency>::UObject * &>::_Do_call(DefaultEngine<UObjectDependency>::UObject *&) functional:822
std::_Func_class<void,DefaultEngine<UObjectDependency>::UObject * &>::operator()(DefaultEngine<UObjectDependency>::UObject *&) functional:869
DefaultEngine<UObjectDependency>::ObjObjects::ForEach(function<void __cdecl(DefaultEngine<UObjectDependency>::UObject * &)>) engine.cpp:204
Dumper<Engine_UE5>::Run(ECompressionMethod) dumper.cpp:128
Main(HINSTANCE__ *) dllmain.cpp:40
<unknown> 0x00007ffb6c937034
<unknown> 0x00007ffb6e922651

Kein avatar Nov 21 '22 23:11 Kein

What game is this for?

TheNaeem avatar Nov 22 '22 08:11 TheNaeem

No game, 5.1 vanilla build, I've just compiled UnrealGame target

Kein avatar Nov 22 '22 09:11 Kein

I'm currently on vacation so I can't do much to help but the problem is very likely to be the patterns of GObjects and/or FNameToString

I recommend reversing them yourself if you can, and override the addresses. Unfortunately someone pushed some faulty patterns for them recently and that commit will be reverted soon

TheNaeem avatar Nov 22 '22 09:11 TheNaeem

If FNameToString is invalid pattern then how come it ended up in UE's FName::ToString in the end? What do you mean by reversing.

Kein avatar Nov 22 '22 10:11 Kein

There's nothing to indicate that it ended up in UE's fnametostring. If you look at the code of the dumper it calls the function pointer which points to what should be fnametostring, but if it isn't fnametostring it would be invalid

And if you don't know what I mean by reversing then don't worry about it. Like I said I'm not gonna be home for like another week but if you send a link to download the exe of ur game, I can see what I can do

TheNaeem avatar Nov 22 '22 10:11 TheNaeem

There's nothing to indicate that it ended up in UE's fnametostring.

What do you mean there is nothing? Callstack?

FName::ToString() UnrealNames.cpp:3371
FNameBase::AsString() engine.cpp:9

if this does not indicate FNAME:ToString pattern was correct then what else? Which patterns the tool is looking for? Where they are defined?

Kein avatar Nov 22 '22 23:11 Kein

🤦‍♂️🤦‍♂️🤦‍♂️ that's the FNameToString wrapper in my code. It just calls UE's FNameToString, but we don't know that it actually did fall UE's FNameToString cause the address could be wrong

There's a big difference between dumper code and engine code. I recommend actually reading that code to see what's happening

TheNaeem avatar Nov 23 '22 09:11 TheNaeem

that's the FNameToString wrapper in my code. It just calls UE's FNameToString, but we don't know that it actually did fall UE's FNameToString

Literally in my callstack posted above where break is being triggered inside Engine code: [Inlined] FName::ToString(FString &) UnrealNames.cpp:3399

Kein avatar Nov 23 '22 10:11 Kein

Can you provide a link to download the games exe. The problem is likely GObjects

TheNaeem avatar Nov 23 '22 13:11 TheNaeem

https://www58.zippyshare.com/v/vL7TE779/file.html

Kein avatar Nov 23 '22 13:11 Kein

Thanks. I'll have a look at it when I can but no guarantees it will be quick, I'm pretty busy.

TheNaeem avatar Nov 23 '22 13:11 TheNaeem