UnityResolve.hpp icon indicating copy to clipboard operation
UnityResolve.hpp copied to clipboard

Crashed on Unity3D(2021.3.14f1 or higher)

Open RiritoNinigaya opened this issue 2 years ago • 23 comments

Mono Mode is Crashed Unity3D(2021.3.14f1 or higher)... Idk why, but it's strange...

IL2Cpp Mode Is Not Crashed Unity3D!!!

RiritoNinigaya avatar Jan 01 '24 21:01 RiritoNinigaya

auto CoreModule = UnityResolve::Get("UnityEngine.CoreModule.dll");
auto camerafunction = CoreModule->Get("Camera", "UnityEngine");
float fov = camerafunction->GetValue<float>(camerafunction, "fieldOfView");

Modified code is as follows

auto CoreModule = UnityResolve::Get("UnityEngine.CoreModule.dll");
auto camerafunction = CoreModule->Get("Camera", "UnityEngine");
auto instance = UnityResolve::UnityType::Camera::GetMain();
float fov = camerafunction->GetValue<float>(instance, "fieldOfView");

issuimo avatar Jan 02 '24 08:01 issuimo

ok, thanks

RiritoNinigaya avatar Jan 02 '24 09:01 RiritoNinigaya

auto CoreModule = UnityResolve::Get("UnityEngine.CoreModule.dll");
auto camerafunction = CoreModule->Get("Camera", "UnityEngine");
float fov = camerafunction->GetValue<float>(camerafunction, "fieldOfView");

It is Not Crashing... Init Function is Calling Crash on Unity3D....

RiritoNinigaya avatar Jan 02 '24 09:01 RiritoNinigaya

ZZBEyd7XKI

Maybe it's Windows 10 Bug...

RiritoNinigaya avatar Jan 02 '24 12:01 RiritoNinigaya

It's not a Windows bug. Currently, we are fixing the issue. The error originates from the line

if (pField->static_field) pField->vTable = Invoke<void*>("mono_class_vtable", pDomain, pClass);

issuimo avatar Jan 02 '24 13:01 issuimo

again crash... T_T

RiritoNinigaya avatar Mar 03 '24 22:03 RiritoNinigaya

Exception thrown at 0x00007FF8BAEAC8F3 (mono-2.0-bdwgc.dll) in GeckoGirlProject.exe: 0xC0000005: Access violation reading location 0x0000000000000110.

And I'm Getting This Exception while Getting Camera Function...

RiritoNinigaya avatar Mar 03 '24 22:03 RiritoNinigaya

Exception thrown at 0x00007FF8BAEAC8F3 (mono-2.0-bdwgc.dll) in GeckoGirlProject.exe: 0xC0000005: Access violation reading location 0x0000000000000110.

And I'm Getting This Exception while Getting Camera Function...

Could you please provide the code?

issuimo avatar Mar 04 '24 03:03 issuimo

Exception thrown at 0x00007FF8BAEAC8F3 (mono-2.0-bdwgc.dll) in GeckoGirlProject.exe: 0xC0000005: Access violation reading location 0x0000000000000110.

我在获得相机功能时遇到此异常......

Perhaps you can use exception handling to solve it. (SEH) try {} catch() {} or __try {} __except (EXCEPTION_EXECUTE_HANDLER) {}

issuimo avatar Mar 04 '24 03:03 issuimo

again crash... T_T

Error With New Version:

Exception thrown at 0x00007FFF08F560F5 (mono-2.0-bdwgc.dll) in GeckoGirlProject.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.

RiritoNinigaya avatar Mar 04 '24 07:03 RiritoNinigaya

Code while crashing in mono:

if (address_[funcName] != nullptr) return reinterpret_cast<Return(UNITY_CALLING_CONVENTION*)(Args...)>(address_[funcName])(args...)

RiritoNinigaya avatar Mar 04 '24 07:03 RiritoNinigaya

Now i'm getting this error while getting camera function in il2cpp:

Exception thrown at 0x00007FFEEA3C739A (4dd5de18.dll) in Holoearth.exe: 0xC0000005: Access violation reading location 0x0000000000000038.

Code:

auto GetValue(void* obj, const std::string& name) -> RType { return *reinterpret_cast<RType*>(reinterpret_cast<uintptr_t>(obj) + Get<Field>(name)->offset); }

RiritoNinigaya avatar Mar 04 '24 07:03 RiritoNinigaya

现在我在 il2cpp 中获取相机功能时收到此错误:

Exception thrown at 0x00007FFEEA3C739A (4dd5de18.dll) in Holoearth.exe: 0xC0000005: Access violation reading location 0x0000000000000038.

法典:

auto GetValue(void* obj, const std::string& name) -> RType { return *reinterpret_cast<RType*>(reinterpret_cast<uintptr_t>(obj) + Get<Field>(name)->offset); }

GetValue is used to retrieve field values, but as far as I know, UnityEngine.Camera does not have any retrievable fields (fields of static properties do not have memory offsets).

issuimo avatar Mar 04 '24 08:03 issuimo

现在我在 il2cpp 中获取相机功能时收到此错误:

Exception thrown at 0x00007FFEEA3C739A (4dd5de18.dll) in Holoearth.exe: 0xC0000005: Access violation reading location 0x0000000000000038.

法典:

auto GetValue(void* obj, const std::string& name) -> RType { return *reinterpret_cast<RType*>(reinterpret_cast<uintptr_t>(obj) + Get<Field>(name)->offset); }

GetValue is used to retrieve field values, but as far as I know, UnityEngine.Camera does not have any retrievable fields (fields of static properties do not have memory offsets).

just the opposite, you can retrieve not static field value(as public int offset_name), but it will be difficult

RiritoNinigaya avatar Mar 04 '24 08:03 RiritoNinigaya

Link as Proof of Concept What Camera Fields is retrievable

image In fact, UnityEngine.Camera only has static fields. The content in the link you provided is the property ( float depth { get; set; } ) in UnityEngine.Camera, not a field in the form of ( float depth; ). Please use a method like float get_depth() to retrieve it.

issuimo avatar Mar 04 '24 08:03 issuimo

Link as Proof of Concept What Camera Fields is retrievable

image In fact, UnityEngine.Camera only has static fields. The content in the link you provided is the property ( float depth { get; set; } ) in UnityEngine.Camera, not a field in the form of ( float depth; ). Please use a method like float get_depth() to retrieve it.

OMG, I fixed get and set the field of view :D

RiritoNinigaya avatar Mar 04 '24 09:03 RiritoNinigaya

reopen pls

RiritoNinigaya avatar Mar 04 '24 09:03 RiritoNinigaya

this is not the end yet, the issue with Mono remains to be resolved

RiritoNinigaya avatar Mar 04 '24 09:03 RiritoNinigaya

Code while crashing in mono:

if (address_[funcName] != nullptr) return reinterpret_cast<Return(UNITY_CALLING_CONVENTION*)(Args...)>(address_[funcName])(args...)

Can you provide some call stack information?

issuimo avatar Mar 04 '24 09:03 issuimo

Code while crashing in mono:

if (address_[funcName] != nullptr) return reinterpret_cast<Return(UNITY_CALLING_CONVENTION*)(Args...)>(address_[funcName])(args...)

Can you provide some call stack information?

How?!

RiritoNinigaya avatar Mar 04 '24 13:03 RiritoNinigaya

Code while crashing in mono:

if (address_[funcName] != nullptr) return reinterpret_cast<Return(UNITY_CALLING_CONVENTION*)(Args...)>(address_[funcName])(args...)

Can you provide some call stack information?

devenv_k6OT8fORqw

RiritoNinigaya avatar Mar 04 '24 13:03 RiritoNinigaya

Cheat Engine

issuimo avatar Mar 05 '24 04:03 issuimo