mirror of
https://gitea.tendokyu.moe/TeamTofuShop/segatools.git
synced 2026-09-24 23:38:03 +03:00
User can debug their Unity game with dnspy and other debugger, it needn't patch mono.dll. most code is copied&modified from [UnityDoorstop](https://github.com/NeighTools/UnityDoorstop/blob/master/src/bootstrap.c#L328) currently it work on SDEZ/SDDT <details> <summary>How to debug and breakpoint Unity game (For example SDDT)</summary> 1. Modify segatools.ini and set `enableDebug` and `debugAddress`  2. Inject mu3 with hook dll  3. dnspy connect unity  4. open Modules tab and double click Assembly-CSharp.dll, yeah, now you can add breakpoints now.  </details> and make unity_config.target_assembly is optional if we just want to debug unity. Now PR is ready to code review and merge into upstream. Reviewed-on: https://gitea.tendokyu.moe/TeamTofuShop/segatools/pulls/99 Co-authored-by: MikiraSora <mikirasora0409@126.com> Co-committed-by: MikiraSora <mikirasora0409@126.com>
28 lines
748 B
C
28 lines
748 B
C
#include <stdlib.h>
|
|
|
|
#include "config.h"
|
|
|
|
void unity_config_load(struct unity_config *cfg, const wchar_t *filename) {
|
|
cfg->enable = GetPrivateProfileIntW(L"unity", L"enable", 1, filename);
|
|
cfg->debug_enable = GetPrivateProfileIntW(L"unity", L"enableDebug", 0, filename);
|
|
cfg->debug_suspend = GetPrivateProfileIntW(L"unity", L"debugSuspend", 0, filename);
|
|
|
|
GetPrivateProfileStringW(
|
|
L"unity",
|
|
L"targetAssembly",
|
|
L"",
|
|
cfg->target_assembly,
|
|
_countof(cfg->target_assembly),
|
|
filename
|
|
);
|
|
|
|
GetPrivateProfileStringW(
|
|
L"unity",
|
|
L"debugAddress",
|
|
L"127.0.0.1:55555",
|
|
cfg->debug_address,
|
|
_countof(cfg->debug_address),
|
|
filename
|
|
);
|
|
}
|