ELF: Fix incorrect DT_SYMTAB read offset (part of #15)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2017 Perfare - https://github.com/Perfare/Il2CppDumper
|
Copyright 2017 Perfare - https://github.com/Perfare/Il2CppDumper
|
||||||
Copyright 2017-2019 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
|
Copyright 2017-2020 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
*/
|
*/
|
||||||
@@ -266,7 +266,11 @@ namespace Il2CppInspector
|
|||||||
var end = (from x in dynamic_table where conv.Gt(x.d_un, DT_SYMTAB.d_un) orderby x.d_un select x).First().d_un;
|
var end = (from x in dynamic_table where conv.Gt(x.d_un, DT_SYMTAB.d_un) orderby x.d_un select x).First().d_un;
|
||||||
|
|
||||||
// Dynamic symbol table
|
// Dynamic symbol table
|
||||||
pTables.Add((DT_SYMTAB.d_un, conv.Div(conv.Sub(end, DT_SYMTAB.d_un), Sizeof(typeof(TSym))), DT_STRTAB.d_un));
|
pTables.Add((
|
||||||
|
conv.FromUInt(MapVATR(conv.ULong(DT_SYMTAB.d_un))),
|
||||||
|
conv.Div(conv.Sub(end, DT_SYMTAB.d_un), Sizeof(typeof(TSym))),
|
||||||
|
DT_STRTAB.d_un
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2019 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
|
Copyright 2019-2020 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
*/
|
*/
|
||||||
@@ -16,6 +16,7 @@ namespace Il2CppInspector
|
|||||||
TWord Sub(TWord a, TWord b);
|
TWord Sub(TWord a, TWord b);
|
||||||
TWord Div(TWord a, TWord b);
|
TWord Div(TWord a, TWord b);
|
||||||
TWord Div(TWord a, int b);
|
TWord Div(TWord a, int b);
|
||||||
|
TWord FromUInt(uint a);
|
||||||
int Int(TWord a);
|
int Int(TWord a);
|
||||||
long Long(TWord a);
|
long Long(TWord a);
|
||||||
ulong ULong(TWord a);
|
ulong ULong(TWord a);
|
||||||
@@ -29,18 +30,21 @@ namespace Il2CppInspector
|
|||||||
public uint Sub(uint a, uint b) => a - b;
|
public uint Sub(uint a, uint b) => a - b;
|
||||||
public uint Div(uint a, uint b) => a / b;
|
public uint Div(uint a, uint b) => a / b;
|
||||||
public uint Div(uint a, int b) => a / (uint)b;
|
public uint Div(uint a, int b) => a / (uint)b;
|
||||||
|
public uint FromUInt(uint a) => a;
|
||||||
public int Int(uint a) => (int)a;
|
public int Int(uint a) => (int)a;
|
||||||
public long Long(uint a) => a;
|
public long Long(uint a) => a;
|
||||||
public ulong ULong(uint a) => a;
|
public ulong ULong(uint a) => a;
|
||||||
public bool Gt(uint a, uint b) => a > b;
|
public bool Gt(uint a, uint b) => a > b;
|
||||||
public uint[] UIntArray(uint[] a) => a;
|
public uint[] UIntArray(uint[] a) => a;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class Convert64 : IWordConverter<ulong>
|
internal class Convert64 : IWordConverter<ulong>
|
||||||
{
|
{
|
||||||
public ulong Add(ulong a, ulong b) => a + b;
|
public ulong Add(ulong a, ulong b) => a + b;
|
||||||
public ulong Sub(ulong a, ulong b) => a - b;
|
public ulong Sub(ulong a, ulong b) => a - b;
|
||||||
public ulong Div(ulong a, ulong b) => a / b;
|
public ulong Div(ulong a, ulong b) => a / b;
|
||||||
public ulong Div(ulong a, int b) => a / (uint)b;
|
public ulong Div(ulong a, int b) => a / (uint)b;
|
||||||
|
public ulong FromUInt(uint a) => a;
|
||||||
public int Int(ulong a) => (int)a;
|
public int Int(ulong a) => (int)a;
|
||||||
public long Long(ulong a) => (long)a;
|
public long Long(ulong a) => (long)a;
|
||||||
public ulong ULong(ulong a) => a;
|
public ulong ULong(ulong a) => a;
|
||||||
|
|||||||
Reference in New Issue
Block a user