Skip to content

Commit eccf374

Browse files
committed
fix: wrong parsing the type list in dex module.
Items in the type list are 16-bits values but were being parsed as 32-bits.
1 parent 1b59fdb commit eccf374

4 files changed

Lines changed: 124 additions & 87 deletions

lib/src/modules/dex/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl Dex {
338338

339339
let (rem, size) = le_u32::<&[u8], Error>(remainder).ok()?;
340340

341-
let mut it = iterator(rem, le_u32::<&[u8], Error>);
341+
let mut it = iterator(rem, le_u16::<&[u8], Error>);
342342
let items = it
343343
.by_ref()
344344
.take(size as usize)

lib/src/modules/dex/tests/testdata/2c96859a5adbb5ab72ac279a57594b86cbcbbd277e9bafea672c51201737d6a3.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protos:
4343
parameters_count: 2
4444
parameters:
4545
- "Ljava/lang/String;"
46-
- "Landroid/app/Application;"
46+
- "I"
4747
- shorty: "L"
4848
return_type: "Ljava/lang/String;"
4949
parameters_count: 0
@@ -94,7 +94,7 @@ methods:
9494
parameters_count: 2
9595
parameters:
9696
- "Ljava/lang/String;"
97-
- "Landroid/app/Application;"
97+
- "I"
9898
name: "createPackageContext"
9999
- class: "Lezbkvojpi/keikfof;"
100100
proto:

0 commit comments

Comments
 (0)