mirror of
https://github.com/wiiu-env/RPXParserLib.git
synced 2024-11-16 22:29:21 +01:00
Fix section_size_inflated parsing.
This commit is contained in:
parent
b7fc04ce27
commit
65918d9174
4
pom.xml
4
pom.xml
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>de.orb</groupId>
|
||||
<artifactId>rpxparser</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<version>0.0.2-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>rpxparser</name>
|
||||
@ -19,7 +19,7 @@
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.4</version>
|
||||
<version>1.18.6</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
@ -79,7 +79,7 @@ public class ElfSection {
|
||||
}
|
||||
|
||||
public String name() {
|
||||
// we can be sure the strtab is NOT null.
|
||||
// we can be sure the strtab is NOT null.
|
||||
return reader.strtab.string(nameIndex);
|
||||
}
|
||||
|
||||
@ -140,8 +140,7 @@ public class ElfSection {
|
||||
buf.get(data, 0, (int) orgSize);
|
||||
|
||||
if ((flags & RPX_SHDR_ZLIB_FLAG) == RPX_SHDR_ZLIB_FLAG) {
|
||||
long section_size_inflated = buf.getInt(0) & 0xFFFFFFFF;
|
||||
|
||||
long section_size_inflated = buf.getInt((int) offset) & 0xFFFFFFFF;
|
||||
Inflater inflater = new Inflater();
|
||||
inflater.setInput(data, 4, (int) orgSize - 4); // the first byte is the size
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class RPXFile {
|
||||
.collect(Collectors.collectingAndThen( //
|
||||
Collectors.groupingBy(RPLImport::getRplName, Collectors.toList()), // Group by RPLName
|
||||
Collections::unmodifiableMap));
|
||||
}
|
||||
}
|
||||
|
||||
public Optional<byte[]> getFunctionData(ElfSymbol symbol) {
|
||||
return symbol.section().flatMap(section -> getFunctionData(section, symbol.value() - section.address(), (int) symbol.size()));
|
||||
|
Loading…
Reference in New Issue
Block a user