mirror of
https://github.com/Perfare/Il2CppDumper.git
synced 2025-01-09 11:17:35 -03:00
Fixed #605
This commit is contained in:
parent
aa1be209f5
commit
bf36e1d5cc
3 changed files with 11 additions and 6 deletions
|
@ -46,13 +46,15 @@ namespace Il2CppDumper
|
|||
|
||||
public WebAssemblyMemory CreateMemory()
|
||||
{
|
||||
var last = dataSections[dataSections.Length - 1];
|
||||
var bssStart = last.Offset + (uint)last.Data.Length;
|
||||
var stream = new MemoryStream(new byte[Length]);
|
||||
foreach (var dataSection in dataSections)
|
||||
{
|
||||
stream.Position = dataSection.Offset;
|
||||
stream.Write(dataSection.Data, 0, dataSection.Data.Length);
|
||||
}
|
||||
return new WebAssemblyMemory(stream, Is32Bit);
|
||||
return new WebAssemblyMemory(stream, bssStart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,9 +4,12 @@ namespace Il2CppDumper
|
|||
{
|
||||
public sealed class WebAssemblyMemory : Il2Cpp
|
||||
{
|
||||
public WebAssemblyMemory(Stream stream, bool is32Bit) : base(stream)
|
||||
private uint bssStart;
|
||||
|
||||
public WebAssemblyMemory(Stream stream, uint bssStart) : base(stream)
|
||||
{
|
||||
Is32Bit = is32Bit;
|
||||
Is32Bit = true;
|
||||
this.bssStart = bssStart;
|
||||
}
|
||||
|
||||
public override ulong MapVATR(ulong addr)
|
||||
|
@ -55,9 +58,9 @@ namespace Il2CppDumper
|
|||
};
|
||||
var bss = new SearchSection
|
||||
{
|
||||
offset = Length,
|
||||
offset = bssStart,
|
||||
offsetEnd = long.MaxValue, //hack
|
||||
address = Length,
|
||||
address = bssStart,
|
||||
addressEnd = long.MaxValue //hack
|
||||
};
|
||||
var sectionHelper = new SectionHelper(this, methodCount, typeDefinitionsCount, metadataUsagesCount, imageCount);
|
||||
|
|
|
@ -220,7 +220,7 @@ namespace Il2CppDumper
|
|||
foreach (var section in data)
|
||||
{
|
||||
il2Cpp.Position = section.offset;
|
||||
while (il2Cpp.Position < section.offsetEnd)
|
||||
while (il2Cpp.Position < section.offsetEnd - il2Cpp.PointerSize)
|
||||
{
|
||||
var addr = il2Cpp.Position;
|
||||
if (il2Cpp.ReadIntPtr() == typeDefinitionsCount)
|
||||
|
|
Loading…
Reference in a new issue