Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
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
15d56abe
Commit
15d56abe
authored
Jul 15, 2019
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: read correct buffer size for string pool parsing (#712)
parent
d89ec678
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
CommonBinaryParser.java
...re/src/main/java/jadx/core/xmlgen/CommonBinaryParser.java
+4
-12
No files found.
jadx-core/src/main/java/jadx/core/xmlgen/CommonBinaryParser.java
View file @
15d56abe
...
...
@@ -27,30 +27,22 @@ 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
];
byte
[]
str
Array
=
is
.
readInt8Array
((
int
)
(
strings
End
-
is
.
getPos
()));
byte
[]
str
Data
=
is
.
readInt8Array
((
int
)
(
chunk
End
-
is
.
getPos
()));
if
((
flags
&
UTF8_FLAG
)
!=
0
)
{
// UTF-8
for
(
int
i
=
0
;
i
<
stringCount
;
i
++)
{
strings
[
i
]
=
extractString8
(
str
Array
,
stringsOffset
[
i
]);
strings
[
i
]
=
extractString8
(
str
Data
,
stringsOffset
[
i
]);
}
}
else
{
// UTF-16
for
(
int
i
=
0
;
i
<
stringCount
;
i
++)
{
// don't trust specified string length, read until \0
// stringsOffset can be same for different indexes
strings
[
i
]
=
extractString16
(
str
Array
,
stringsOffset
[
i
]);
strings
[
i
]
=
extractString16
(
str
Data
,
stringsOffset
[
i
]);
}
}
if
(
stylesStart
!=
0
)
{
is
.
checkPos
(
start
+
stylesStart
,
"Expected styles start"
);
if
(
styleCount
!=
0
)
{
// TODO: implement styles parsing
}
}
// skip padding zeroes
is
.
skipToPos
(
chunkEnd
,
"Skip string pool padding"
);
is
.
checkPos
(
chunkEnd
,
"Expected strings pool end"
);
return
strings
;
}
...
...
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