shogo82148 / androidbinary

Android binary file parser written in golang
MIT License
240 stars 79 forks source link

Got panic while parse pkg if it's AndroidManifest.xml has some problem. #73

Closed Laitr0n closed 9 months ago

Laitr0n commented 10 months ago

ldfroezja.apk

panic: runtime error: index out of range [4294967167] with length 565

goroutine 22 [running]:
github.com/shogo82148/androidbinary.(*ResStringPool).GetString(...)
    /go/pkg/mod/github.com/shogo82148/androidbinary@v1.0.3/common.go:119
github.com/shogo82148/androidbinary.(*XMLFile).GetString(...)
    /go/pkg/mod/github.com/shogo82148/androidbinary@v1.0.3/xml.go:168
github.com/shogo82148/androidbinary.(*XMLFile).addNamespacePrefix(0x881b40?, 0x46ec90?, 0xc0?)
    /go/pkg/mod/github.com/shogo82148/androidbinary@v1.0.3/xml.go:215 +0x5e
github.com/shogo82148/androidbinary.(*XMLFile).readEndElement(0xc00013fe30, 0xc00046ec90)
    /go/pkg/mod/github.com/shogo82148/androidbinary@v1.0.3/xml.go:299 +0x10a
github.com/shogo82148/androidbinary.(*XMLFile).readChunk(0xc00013fe30, {0x8816c0?, 0xc0001b91a0}, 0x133e0)
    /go/pkg/mod/github.com/shogo82148/androidbinary@v1.0.3/xml.go:157 +0x167
github.com/shogo82148/androidbinary.NewXMLFile({0x8816c0?, 0xc0001b91a0})
    /go/pkg/mod/github.com/shogo82148/androidbinary@v1.0.3/xml.go:108 +0x14c
github.com/shogo82148/androidbinary/apk.(*Apk).parseManifest(0xc0001e4000)
    /go/pkg/mod/github.com/shogo82148/androidbinary@v1.0.3/apk/apk.go:162 +0x125
github.com/shogo82148/androidbinary/apk.OpenZipReader({0x882000?, 0xc000012a68?}, 0x0?)
    /go/pkg/mod/github.com/shogo82148/androidbinary@v1.0.3/apk/apk.go:61 +0x85

I am not familiar with the Android package. I just stumbled upon this panic, but there is no additional information on what happened. If I find more information, I will keep you updated.

shogo82148 commented 9 months ago

I can't access to ldfroezja.apk...

Laitr0n commented 9 months ago

I can't access to ldfroezja.apk...

ldfroezja.apk I upload it to onedrive again.