Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a bug in ReadAnnotationSetRefList #10

Closed
LoyieKing opened this issue Jul 7, 2019 · 1 comment
Closed

Find a bug in ReadAnnotationSetRefList #10

LoyieKing opened this issue Jul 7, 2019 · 1 comment
Assignees

Comments

@LoyieKing
Copy link

annotation_set_ref_item format says

offset from the start of the file to the referenced annotation set or 0 if there are no annotations for this element.

https://github.com/sailro/Dexer/blob/master/Dexer/IO/DexReader.cs#L285-L286

    var size = reader.ReadUInt32();
    for (uint i = 0; i < size; i++)
    {
        var offset = reader.ReadUInt32();
        result.Add(ReadAnnotationSet(reader, offset));
    }

there should be

    for (uint i = 0; i < size; i++)
    {
        var offset = reader.ReadUInt();
        if (offset == 0)
            result.Add(new List<Annotation>(0));
        else
            result.Add(ReadAnnotationSet(offset));
    }
@sailro sailro closed this as completed in 307c511 Jul 8, 2019
@sailro sailro self-assigned this Jul 8, 2019
@sailro
Copy link
Owner

sailro commented Jul 8, 2019

Good catch! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants