Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process GameAssembly.dll and global.metadata.dll from runtime #861

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

krulci
Copy link

@krulci krulci commented May 4, 2024

Description

This is an enhancement on top of #611 as the previous pull request added submodules.

Motivation and Context

  • Il2CppInterop.Runtime+RuntimeModuleDump will retrieve GameAssembly.dll from current process handle after temporarily setting memory protection to execute_read_write. Memory protection will be restore to its original state after module memory is read.
  • Il2CppInterop.Runtime+RuntimeModuleDump will fix all sections so it can be processed by Il2CppDumper.
  • Il2CppInterop.Runtime+RuntimeModuleDump will also extract global-metadata.dat from current process handle.
    This feature is for games with global-metadata.dat embedded in GameAssembly.dll.
  • Uses Il2CppDumper to process List<Mono.Cecil.AssemblyDefinition> since Cpp2IL is incompetent with memory dumped file.
  • ApplicationData was added to reduce the need of initialization toolchain rerun for environment where BepInEx is removed upon exit.
  • MetadataSignatureToScan and ObfuscatedMetadataHeaderOffset are a config entry that is supplied to Il2CppInterop.Runtime+RuntimeModuleDump for pattern matching. Default value is a relative consistent value starts from offset 252 of multiple global-metadata.dat investigated.
  • MagicToFix is a config entry that is supplied to Il2CppInterop.Runtime+RuntimeModuleDump when the first 8 bytes of global-metadata.dat is obfuscated to determine global-metadata.dat's version.

How Has This Been Tested?

Tested with PrincessConnectReDive (JP)
Chainloader startup complete
Tested with Umamusume (JP)
Chainloader startup complete

Screenshots (if appropriate):

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant