You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Subsequently, when DexReader:PrefetchTypeReferences is called, the function TypeDescriptor.Allocate is used to consume this null string, which in turn returns a null type descriptor, which is then added to the TypeReferences list.
To combat this, we can improve checking on null values within DexReader (line 201), this way we maintain the requirement of keeping indexing into TypeReferences viable:
if (reference == null)
{
ClassDefinition cdef = new ClassDefinition();
var reference2 = Dex.TypeReferences[classIndex] as ClassReference;
// use empty object
if (reference2 == null)
cdef = null;
else
cdef = new ClassDefinition(reference2);
Dex.TypeReferences[classIndex] = cdef;
Dex.Classes.Add(cdef);
}
Unfortunately this wreaks havoc later on when TypeDescriptor.Fill (
It appears possible to have null strings in the dex format, unsure if this is the result of a malformed dex or not.
note '00 00' at offset 32.
Subsequently, when
DexReader:PrefetchTypeReferences
is called, the functionTypeDescriptor.Allocate
is used to consume this null string, which in turn returns a null type descriptor, which is then added to the TypeReferences list.This becomes problematic later on, when https://github.com/sailro/Dexer/blob/master/Dexer/IO/DexReader.cs#L201 is called, as it means
Dex.TypeReferences[classIndex]
can actually be null.To combat this, we can improve checking on null values within DexReader (line 201), this way we maintain the requirement of keeping indexing into TypeReferences viable:
Unfortunately this wreaks havoc later on when TypeDescriptor.Fill (
Dexer/Dexer/Metadata/TypeDescriptor.cs
Line 64 in 5dc2f99
context.Import
as TypeReference (item) can be null.I am not 100% sure how to progress this one, but will keep this issue to track the problem.
The text was updated successfully, but these errors were encountered: