Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ManlyMarco authored May 16, 2024
1 parent 1eac9bc commit faa0726
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Il2CppInterop.Runtime/MemoryUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static unsafe nint FindSignatureInBlock(nint block, long blockSize, char[

public static void GetModuleRegions(ProcessModule module, out List<MEMORY_BASIC_INFORMATION> protectedRegions)
{
protectedRegions = [];
protectedRegions = new List<MEMORY_BASIC_INFORMATION>();
IntPtr moduleEndAddress = (IntPtr)((long)module.BaseAddress + module.ModuleMemorySize);
var currentAddress = module.BaseAddress;
while (currentAddress.ToInt64() < moduleEndAddress.ToInt64())
Expand Down Expand Up @@ -105,8 +105,8 @@ public static void RuntimeModuleDump(ILogger logger, out byte[] il2cppBytes, out
if (module.ModuleName == null)
{
logger.LogError("GameAssembly.dll or GameAssembly.so or UserAssembly.dll not found");
il2cppBytes = [];
metadataBytes = [];
il2cppBytes = new byte[0];
metadataBytes = new byte[0];
return;
}
var moduleBytes = new byte[module.ModuleMemorySize];
Expand All @@ -115,8 +115,8 @@ public static void RuntimeModuleDump(ILogger logger, out byte[] il2cppBytes, out
if (!ReadProcessMemory(process.Handle, module.BaseAddress, moduleBytes, module.ModuleMemorySize, out _))
{
logger.LogError("Failed to read process memory");
il2cppBytes = [];
metadataBytes = [];
il2cppBytes = new byte[0];
metadataBytes = new byte[0];
return;
}
SetModuleRegions(protectedRegions);
Expand Down

0 comments on commit faa0726

Please sign in to comment.