1 Commits
Author SHA1 Message Date
MikiraSora 31c184adf7 unity: support debugging (#99)
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`
![image.png](/attachments/60a681ac-f050-4923-b955-6b3fdd93a75e)

2.   Inject mu3 with hook dll
![image.png](/attachments/b51391e8-92b4-4c6b-b531-f4171f2f4447)

3.   dnspy connect unity
![image.png](/attachments/513906d3-0f14-4e40-be9f-da87928eeaaf)

4.  open Modules tab and double click Assembly-CSharp.dll, yeah, now you can add breakpoints now.
![image.png](/attachments/5e2a1f0b-62fd-4e68-997f-c2c68efee9ef)

</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>
2026-08-10 15:42:41 +00:00