Created
April 27, 2022 17:18
-
-
Save eybisi/363d137d91e95c337ddb221e3ae7372f to your computer and use it in GitHub Desktop.
dex pattern file for imhex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma pattern_limit 0x20000 | |
struct StringDataItem { | |
u8 size[[hidden]]; | |
char string[size]; | |
}[[inline]]; | |
struct StringIdItem { | |
StringDataItem *stringData : u32; | |
}[[inline]]; | |
struct MethodIdItem { | |
u16 classIdx; | |
u16 protoIdx; | |
u32 nameIdx; | |
char className[] @ addressof(parent.Types[classIdx].typeName); | |
char protoDesc[] @ addressof(parent.Protos[protoIdx].shortyDec); | |
char methodName[] @ addressof(parent.Strings[nameIdx].stringData.string); | |
}; | |
struct ClassDefItem { | |
u32 classIdx; | |
u32 accessFlags; | |
u32 superClassIdx; | |
u32 interfacesOffset; | |
u32 sourceFileIdx; | |
u32 annotationsOffset; | |
u32 classDataOffset; | |
u32 staticValuesOffset; | |
char typeName[] @ addressof(parent.Types[classIdx].typeName); | |
}; | |
struct ClassDataItem { | |
}; | |
struct TypeIdItem { | |
u32 descriptorIdx; | |
char typeName[parent.Strings[descriptorIdx].stringData.size] @ addressof(parent.Strings[descriptorIdx].stringData.string); | |
}; | |
struct ProtoIdItem { | |
u32 shortyIdx; | |
u32 returnTypeIdx; | |
u32 parametersOffset; | |
char shortyDec[parent.Strings[shortyIdx].stringData.size] @ addressof(parent.Strings[shortyIdx].stringData.string); | |
char returnType[] @ addressof(parent.Types[returnTypeIdx].typeName); | |
}; | |
struct FieldIdItem { | |
u16 classIdx; | |
u16 typeIdx; | |
u32 nameIdx; | |
char className[] @ addressof(parent.Types[classIdx].typeName); | |
char typeName[] @ addressof(parent.Types[typeIdx].typeName); | |
char fieldName[] @ addressof(parent.Strings[nameIdx].stringData.string); | |
}; | |
struct MapList { | |
u32 size; | |
}; | |
struct Header { | |
char magic[4]; | |
char version[4]; | |
u32 checksum; | |
char signature[20]; | |
u32 fileSize; | |
u32 headerSize; | |
u32 endianTag; | |
u32 linkSize; | |
u32 linkOff; | |
u32 mapOff; | |
u32 stringIdsSize; | |
u32 stringIdsOffset; | |
u32 typeIdsSize; | |
u32 typeIdsOffset; | |
u32 protoIdsSize; | |
u32 protoIdsOffset; | |
u32 fieldIdsSize; | |
u32 fieldIdsOffset; | |
u32 methodIdsSize; | |
u32 methodIdsOffset; | |
u32 classDefSize; | |
u32 classDefOffset; | |
u32 dataSize; | |
u32 dataOffset; | |
}; | |
struct dex { | |
Header header; | |
StringIdItem Strings[header.stringIdsSize] @ header.stringIdsOffset; | |
TypeIdItem Types[header.typeIdsSize] @ header.typeIdsOffset; | |
ProtoIdItem Protos[header.protoIdsSize] @ header.protoIdsOffset; | |
FieldIdItem Fields[header.fieldIdsSize] @ header.fieldIdsOffset; | |
ClassDefItem ClassDefs[header.classDefSize] @ header.classDefOffset; | |
MethodIdItem Methods[header.methodIdsSize] @ header.methodIdsOffset; | |
}; | |
dex Dex @ 0x0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment