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>
|
<groupId>de.orb</groupId>
|
||||||
<artifactId>rpxparser</artifactId>
|
<artifactId>rpxparser</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>0.0.2-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>rpxparser</name>
|
<name>rpxparser</name>
|
||||||
@ -19,7 +19,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>1.18.4</version>
|
<version>1.18.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -140,8 +140,7 @@ public class ElfSection {
|
|||||||
buf.get(data, 0, (int) orgSize);
|
buf.get(data, 0, (int) orgSize);
|
||||||
|
|
||||||
if ((flags & RPX_SHDR_ZLIB_FLAG) == RPX_SHDR_ZLIB_FLAG) {
|
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 inflater = new Inflater();
|
||||||
inflater.setInput(data, 4, (int) orgSize - 4); // the first byte is the size
|
inflater.setInput(data, 4, (int) orgSize - 4); // the first byte is the size
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class RPXFile {
|
|||||||
.collect(Collectors.collectingAndThen( //
|
.collect(Collectors.collectingAndThen( //
|
||||||
Collectors.groupingBy(RPLImport::getRplName, Collectors.toList()), // Group by RPLName
|
Collectors.groupingBy(RPLImport::getRplName, Collectors.toList()), // Group by RPLName
|
||||||
Collections::unmodifiableMap));
|
Collections::unmodifiableMap));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<byte[]> getFunctionData(ElfSymbol symbol) {
|
public Optional<byte[]> getFunctionData(ElfSymbol symbol) {
|
||||||
return symbol.section().flatMap(section -> getFunctionData(section, symbol.value() - section.address(), (int) symbol.size()));
|
return symbol.section().flatMap(section -> getFunctionData(section, symbol.value() - section.address(), (int) symbol.size()));
|
||||||
|
Loading…
Reference in New Issue
Block a user