Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
7fb39881
Commit
7fb39881
authored
Jan 09, 2015
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resources: skip padding zeroes for UTF-8 string pool
parent
a5035278
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
CommonBinaryParser.java
...re/src/main/java/jadx/core/xmlgen/CommonBinaryParser.java
+4
-3
ParserStream.java
jadx-core/src/main/java/jadx/core/xmlgen/ParserStream.java
+1
-5
No files found.
jadx-core/src/main/java/jadx/core/xmlgen/CommonBinaryParser.java
View file @
7fb39881
...
...
@@ -27,6 +27,7 @@ public class CommonBinaryParser extends ParserConstants {
int
[]
stylesOffset
=
is
.
readInt32Array
(
styleCount
);
is
.
checkPos
(
start
+
stringsStart
,
"Expected strings start"
);
long
stringsEnd
=
stylesStart
==
0
?
chunkEnd
:
start
+
stylesStart
;
String
[]
strings
=
new
String
[
stringCount
];
if
((
flags
&
UTF8_FLAG
)
!=
0
)
{
// UTF-8
...
...
@@ -34,10 +35,10 @@ public class CommonBinaryParser extends ParserConstants {
// is.checkPos(start + stringsStart + stringsOffset[i], "Expected string start");
strings
[
i
]
=
is
.
readString8
();
}
is
.
skipToPos
(
stringsEnd
,
"Skip string8 padding"
);
}
else
{
// UTF-16
long
end
=
stylesStart
==
0
?
chunkEnd
:
start
+
stylesStart
;
byte
[]
strArray
=
is
.
readInt8Array
((
int
)
(
end
-
is
.
getPos
()));
byte
[]
strArray
=
is
.
readInt8Array
((
int
)
(
stringsEnd
-
is
.
getPos
()));
for
(
int
i
=
0
;
i
<
stringCount
;
i
++)
{
// don't trust specified string length, read until \0
// stringsOffset can be same for different indexes
...
...
@@ -51,7 +52,7 @@ public class CommonBinaryParser extends ParserConstants {
}
}
// skip padding zeroes
is
.
skip
(
chunkEnd
-
is
.
getPos
()
);
is
.
skip
ToPos
(
chunkEnd
,
"Skip string pool padding"
);
return
strings
;
}
...
...
jadx-core/src/main/java/jadx/core/xmlgen/ParserStream.java
View file @
7fb39881
...
...
@@ -143,12 +143,8 @@ public class ParserStream {
long
pos
=
getPos
();
if
(
pos
<
expectedOffset
)
{
skip
(
expectedOffset
-
pos
);
pos
=
getPos
();
}
if
(
pos
!=
expectedOffset
)
{
throw
new
IOException
(
error
+
", expected offset: 0x"
+
Long
.
toHexString
(
expectedOffset
)
+
", actual: 0x"
+
Long
.
toHexString
(
pos
));
}
checkPos
(
expectedOffset
,
error
);
}
public
int
decodeLength8
()
throws
IOException
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment