xiaoxiao921 / DearImGuiInjection

15 stars 3 forks source link

Crash with Sons of the Forest, no error message from BepInEx (CoreClr Access Violation) #7

Open WoodenSquid opened 8 months ago

WoodenSquid commented 8 months ago

I am encountering an issue of the game completely closing while loading without any error output. I am using .Net 6. I made modifications to combine all references into one dll, but this error occurred before implementing this. I've narrowed it down to this function in the RendererFinder. https://github.com/xiaoxiao921/DearImGuiInjection/blob/af1e9534c67088d11779ad09d1aab2c19226e34a/RendererFinder/Renderers/DX11Renderer.cs#L150-L187 more specifically this line https://github.com/xiaoxiao921/DearImGuiInjection/blob/af1e9534c67088d11779ad09d1aab2c19226e34a/RendererFinder/Renderers/DX11Renderer.cs#L169 an access violation.. Current workaround is either run from debugger, or run game as administrator. image below is the log from BepInEx

[Message: Preloader] BepInEx 6.0.0-be.667 - SonsOfTheForest [Message: Preloader] Built from commit 6b500b35727716f8ba182dedae304a628dbbb608 [Info : BepInEx] System platform: Windows 10 64-bit [Info : BepInEx] Process bitness: 64-bit (x64) [Info : BepInEx] Running under Unity 2022.2.16f1 [Info : BepInEx] Runtime version: 6.0.7 [Info : BepInEx] Runtime information: .NET 6.0.7 [Info : Preloader] 0 patcher plugins loaded [Info : Preloader] 0 assemblies discovered [Message:AssemblyPatcher] Executing 0 patch(es) [Message: BepInEx] Chainloader initialized [Debug : Preloader] Runtime invoke pointer: 0x7FFAE3F54DD0 [Debug :DobbyDetour] Preparing detour from 0x7FFAE3F54DD0 to 0x7FFA839A3264 [Debug :DobbyDetour] Prepared detour; Trampoline: 0x7FFAA3F60000 [Debug :DobbyDetour] Original: 7FFAE3F54DD0, Trampoline: 7FFAA3F60000, diff: 3FFF4DD0 [Debug : Preloader] Runtime invoke patched [Debug :Il2CppInterop] il2cpp_object_get_virtual_method: 0x7FFAE3F54CE0 [Debug :Il2CppInterop] Object::GetVirtualMethod: 0x7FFAE3EE45C0 [Debug :Il2CppInterop] GenericMethod::GetMethod: 0x7FFAE3F1A550 [Debug :DobbyDetour] Preparing detour from 0x7FFAE3F1A550 to 0x7FFA839A32A4 [Debug :DobbyDetour] Prepared detour; Trampoline: 0x7FFAA3F60020 [Debug :DobbyDetour] Original: 7FFAE3F1A550, Trampoline: 7FFAA3F60020, diff: 3FFBA530 [Debug :Il2CppInterop] il2cpp_image_get_class: 0x7FFAE3F556E0 [Debug :Il2CppInterop] Image::GetType: 0x7FFAE3F5E990 [Debug :Il2CppInterop] MetadataCache::GetTypeInfoFromTypeDefinitionIndex: 0x7FFAE3F5E990 [Debug :DobbyDetour] Preparing detour from 0x7FFAE3F5E990 to 0x7FFA839A32E4 [Debug :DobbyDetour] Prepared detour; Trampoline: 0x7FFAA3F60040 [Debug :DobbyDetour] Original: 7FFAE3F5E990, Trampoline: 7FFAA3F60040, diff: 3FFFE950 [Debug :Il2CppInterop] Couldn't fetch Class::GetDefaultFieldValue with signatures, using method traversal [Debug :Il2CppInterop] il2cpp_field_static_get_value: 0x7FFAE3F542B0 [Debug :Il2CppInterop] Field::StaticGetValue: 0x7FFAE3F75950 [Debug :Il2CppInterop] Field::StaticGetValueInternal: 0x7FFAE3F759D0 [Debug :Il2CppInterop] Class::GetDefaultFieldValue: 0x7FFAE3F5EBD0 [Debug :DobbyDetour] Preparing detour from 0x7FFAE3F5EBD0 to 0x7FFA839A3324 [Debug :DobbyDetour] Prepared detour; Trampoline: 0x7FFAA3F60060 [Debug :DobbyDetour] Original: 7FFAE3F5EBD0, Trampoline: 7FFAA3F60060, diff: 3FFFEB70 [Warning:Il2CppInterop] Class::Init signatures have been exhausted, using a substitute! [Debug :Il2CppInterop] Picked mono_class_instance_size as a Class::Init substitute [Debug :Il2CppInterop] Class::Init: 0x7FFAE3F56040 [Debug :Il2CppInterop] il2cpp_class_from_il2cpp_type: 0x7FFAE3F53300 [Debug :Il2CppInterop] Class::FromIl2CppType: 0x7FFAE3F22890 [Debug :DobbyDetour] Preparing detour from 0x7FFAE3F22890 to 0x7FFA839A3364 [Debug :DobbyDetour] Prepared detour; Trampoline: 0x7FFAA3F60080 [Debug :DobbyDetour] Original: 7FFAE3F22890, Trampoline: 7FFAA3F60080, diff: 3FFC2810 [Debug :Il2CppInterop] il2cpp_class_from_name: 0x7FFAE3F53310 [Debug :Il2CppInterop] Class::FromName: 0x7FFAE3F6F470 [Debug :DobbyDetour] Preparing detour from 0x7FFAE3F6F470 to 0x7FFA839A33A4 [Debug :DobbyDetour] Prepared detour; Trampoline: 0x7FFAA3F70000 [Debug :DobbyDetour] Original: 7FFAE3F6F470, Trampoline: 7FFAA3F70000, diff: 3FFFF470 [Info :Il2CppInterop] Registered mono type Il2CppInterop.Runtime.DelegateSupport+Il2CppToMonoDelegateReference in il2cpp domain [Debug : Unity] Test call after applying unity logging hook [Debug : BepInEx] Examining 'D:\SteamLibrary\steamapps\common\Sons Of The Forest\BepInEx\plugins\DearImGuiInjection.dll' [Info : BepInEx] 2 plugins to load [Info : BepInEx] Loading [DearImGuiInjection 1.0.2] [Info :DearImGuiInjection] Costura.Fody Init in DearImGuiInjectionBasePlugin [Info : Console] [RendererFinder] Costura.Fody Init [Info : Console] [RendererFinder] DX11Renderer.Init() [Info : Console] [Reloaded.Assmebler] Executing Assembly Location: C:\Users\jacob\AppData\Local\Temp\Costura\AAD9B7C6C0E5EC1BD890F0C637C35ED0\reloaded.assembler.dll [Info : Console] [Reloaded.Assmebler] Executing Assembly CodeBase: file:///C:/Users/jacob/AppData/Local/Temp/Costura/AAD9B7C6C0E5EC1BD890F0C637C35ED0/reloaded.assembler.dll [Info : Console] [Reloaded.Assmebler] App Domain Location: [Info : Console] [Reloaded.Assmebler] GetExecutingDLLDirectory Result: C:\Users\jacob\AppData\Local\Temp\Costura\AAD9B7C6C0E5EC1BD890F0C637C35ED0 [Debug :DobbyDetour] Preparing detour from 0x7FFAE85ACA60 to 0x7FFA839A3664 [Debug :DobbyDetour] Prepared detour; Trampoline: 0x7FFAA85B0000 [Debug :DobbyDetour] Original: 7FFAE85ACA60, Trampoline: 7FFAA85B0000, diff: 3FFFCA60 [Info :Il2CppInterop] Registered mono type UnityMainThreadDispatcher in il2cpp domain [Info : BepInEx] Loading [TestPluginDearImGui 1.0.0] [Info :Il2CppInterop] Registered mono type TestPlugin.TestPluginBehaviour in il2cpp domain [Message: BepInEx] Chainloader startup complete [Debug : Preloader] Runtime invoke unpatched [Message: Unity] Releases.Initialize [Message: Unity] Releases : 12/01/2023 01:00:00 [Message: Unity] Version.Initialize [Message: Unity] Version : EarlyAccess.42457 [Error : Unity] Missing GameSettingsManager Instance! [Message: Unity] Fps Limiter set to 0 [Message: Unity] FMOD Setting Voice Count 128 [Message: Unity] FMOD Setting maxVorbisCodecs 118 [Message: Unity] FMOD System output rate: 48000 speaker mode: STEREO [Message: Unity] Screen.brightness : 1 [Message: Unity] [EnvironmentArgs] ... {} [Message: Unity] User data path: C:/Users/jacob/AppData/LocalLow/Endnight/SonsOfTheForest [Message: Unity] Steam Started [Message: Unity] CoopSteamManager Initialize [Message: Unity] Initializing Steam Stats and Achievements. [Error : Unity] Missing GameSettingsManager Instance! [Message: Unity] Fps Limiter set to 30 [Error : Unity] Missing GameSettingsManager Instance! [Error : Unity] Missing GameSettingsManager Instance! [Info :DearImGuiInjection] ImGuiImplWin32Init, Window Handle: 2814EC [Message: Unity] Couldn't find Volume Profile [Message: Unity] Couldn't find Volume Profile [Message: Unity] SaveGameManager Registered Serializer: GameSetup. [Message: Unity] GameSetup mode = Normal [Warning: Unity] Duplicate FpsLimiter "FpsLimiter", removing latest. [Message: Unity] SaveGameManager Registered Serializer: GameState. [Message: Unity] New resolution is 2560 x 1440 (16:9) [Message: Unity] No backtrace command arg found, Backtrace disabled [Warning: Unity] Already set to the same number of voices 128 [Message: Unity] Applying grass setting HIGH [Message: Unity] Applying Terrain Parallax setting HIGH [Message: Unity] Applying Billboard setting HIGH [Message: Unity] SaveGameManager Started. (2 queued serializers) [Error : Unity] Invalid fullscreen mode "Exclusive FullScreen" [Message: Unity] vSync set to 1 [Message: Unity] Setting resolution to 2560 x 1440 (FullScreenWindow) [Message: Unity] New resolution is 2560 x 1440 (16:9) [Message: Unity] Fps Limiter set to 155 [Info :DearImGuiInjection] [DX11 ResizeBuffers] Window Handle 2814EC

krulci commented 7 months ago

Most likely the same error I was having; I was able to resolved it by attaching.