ctf-wiki / ctf-wiki

Come and join us, we need you!
https://ctf-wiki.org
Other
8.21k stars 1.38k forks source link

Android Dex结构体定义不准确 #861

Open hzshang opened 1 year ago

hzshang commented 1 year ago

https://ctf-wiki.org/android/basic_operating_mechanism/java_layer/dex/dex/#class-def wiki上展示的DexClassDataHeader结构体是下面的定义

struct DexClassDataHeader {
    u4 staticFieldsSize;  /* 静态字段个数 */
    u4 instanceFieldsSize; /* 实例字段个数 */
    u4 directMethodsSize;  /* 直接方法个数 */
    u4 virtualMethodsSize; /* 虚方法个数 */
};

不过根据Android文档 https://source.android.com/docs/core/runtime/dex-format?hl=zh-cn#class-data-item 这里的header定义类型应该为ueb128

名称 格式 说明
static_fields_size uleb128 此项中定义的静态字段的数量
instance_fields_size uleb128 此项中定义的实例字段的数量
direct_methods_size uleb128 此项中定义的直接方法的数量
virtual_methods_size uleb128 此项中定义的虚拟方法的数量
arttnba3 commented 1 month ago

Hi hzshang,

Thanks for your work! Currently we are taking actions to make the CTF-wki better, and your thoughts will be taken into our consideration and might be adopted in coming days. However, it might take a while for us to handle and take actions on all such errors. If you're eager to commit this change to CTF-wiki more quickly, please feel free to create a pull request to make it happen at your earliest convenience. We are warmly welcome to your contributions to CTF-wiki!

If you have any further concerns, or if you have some new ideas, please feel free to contact us.

Best regards, arttnba3 CTF-wiki team 30/09/2024