wh0am15533 / Patched-Unity-Mono

Patched Unity Mono Builds for use with dnSpy
130 stars 37 forks source link

unity-2020.3.33-mbe #7

Open soft17 opened 1 year ago

soft17 commented 1 year ago

please @wh0am15533 you helped me before with dnspy mono mbe on unnowncheats, but you are banned for now :/ can i please get from you patched unity-2020.3.33-mbe this time? or can you send me a guide how to patch it alone for dummies? i have umpatcher and follow your guide but im stucked in some steps 7-13...

Patching Mono Dll

This patches Mono for use with a debugger. For those of you that have noticed, dnSpy quit updating patched mono dll's. Here is a simple tutorial on patching it yourself. Note: this will use about 9GB once you get the repos downloaded. You can make your own changes to mono but be careful, know what your doing.

1. Pull in the latest Unity mono.dll source code (either git pull if you have it or git clone https://github.com/Unity-Technologies/mono.git )

2. Get this repo and make sure master and dnSpy branches are at the latest commit ( git pull in both branches)
(git clone https://github.com/0xd4d/dnSpy-Unity-mono.git )

3. Compile umpatcher in this repo (you need VS2019 or later and .NET Core SDK 3.0 or later installed)

4. Download and install the correct Unity editor version ( https://unity3d.com/get-unity/download/archive ) or grab the Mono DLL from the game folder
if you only want to patch a single version (better to grab the install).

5. Locate the compiled mono.dll or mono-2.0-bdwgc.dll files, eg.:
DEV DLL's:
C:\Program Files\Unity\Editor\Data\PlaybackEngines\windowsstandalonesupport\Variations\win32_development_mono\Data\Mono\EmbedRuntime\mono.dll
C:\Program Files\Unity\Editor\Data\PlaybackEngines\windowsstandalonesupport\Variations\win64_development_mono\MonoBleedingEdge\EmbedRuntime\mono-2.0-bdwgc.dll

RELEASE DLL's:
C:\Program Files\Unity\Editor\Data\PlaybackEngines\windowsstandalonesupport\Variations\win32_nondevelopment_mono\Data\Mono\EmbedRuntime\mono.dll
C:\Program Files\Unity\Editor\Data\PlaybackEngines\windowsstandalonesupport\Variations\win64_nondevelopment_mono\MonoBleedingEdge\EmbedRuntime\mono-2.0-bdwgc.dll

6. Get the timestamp stored in mono.dll or mono-2.0-bdwgc.dll's PE header

umpatcher --timestamp "C:\MonoDLL\Umpatcher\mono.dll" or umpatcher --timestamp "C:\MonoDLL\Umpatcher\mono-2.0-bdwgc.dll"

7. Check out the correct version branch in the Unity mono repo (eg. if it's v5.4.3, the branch is called unity5.4. Branches ending in -mbe use .NET 4.x assemblies.).
Do steps 7-10 for both mono.dll & mono-2.0-bdwgc.dll one at a time. (Use git branch -a to see all remote branches):

git checkout unity-2018.2 (or whatever version you need, after 2019.1 there is ONLY mbe branches but you can still build mono.dll)

8. (optional) git pull (make sure it has the latest stuff)

9. gitk to start a UI to find the merge hash (or your favorite git GUI)

Find the closest merge (Don't pick newer than date versions) by comparing the merge date with the timestamp reported by umpatcher above. (Use the UTC Date)
Remember the commit hash, you'll need it later, don't checkin branch yet until it's patched after #10! It's okay if the date doesn't match exactly, just not newer than your UTC date in timestamp.

10. Run umpatcher again to patch the code and commit it to the dnSpy-Unity-mono repo (omit the 'unity-' part. e.g. instead of unity-2018.4.11, use 2018.4.11 or 2018.4.11-mbe)

umpatcher 2018.4.15-mbe aa8a6e7afc2f4fe63921df4fe8a18cfd0a441d19 "C:\MonoDLL\mono" "C:\MonoDLL\dnSpy-Unity-mono"

** Note: This will create the patched project folder under "C:\path\to\dnSpy-Unity-mono" for specified unity version

11. Rebase the mono repo: git checkout master

12. using git or your favorite git GUI, discard anychanges in the Mono repo. IMPORTANT! (or the next time you build, you'll have issues)

13. Compile Patched DLL.
dnSpy-Unity-mono-vZZZZ.x.sln (Unity with .NET 2.0-3.5 assemblies), where ZZZZ is the major version number, eg. 4, 5, 2017, ...

Use configuration Release_eglib
Use platform x86 or x64

dnSpy-Unity-mono-vZZZZ.x-V40.sln (Unity with .NET 4.x assemblies), where ZZZZ is the major version number, eg. 2017, 2018, ...

Use configuration Release
Use platform x86 or x64

thank you :)

ErioirE commented 10 months ago

I would also like this exact version/instructions. Thanks!