小弟正在分析一个so文件,不过里面有STL编程,奈何学习STL的周期太长了,时间有点紧,望各位大牛帮忙看下这些汇编,还原成C++代码,要是能有讲解的话就更加感激不敬了!分析完了我会公布整个分析结果的,算是回报大家啊~
汇编代码如下:
.text:00017C40 msgIsNull ; CODE XREF: CCodecWarpper::encodeRequest(_JNIEnv *,int,_jstring *,_jstring *,int,int,_jstring *,signed char,signed char,_jbyteArray *)+114j
.text:00017C40 LDR R2, [SP,#0x318+env]
.text:00017C42 LDR R3, [SP,#0x318+local_Imei(String)]
.text:00017C44 MOVS R0, R2
.text:00017C46 MOVS R1, R3
.text:00017C48 MOVS R2, #0
.text:00017C4A BL _ZN7_JNIEnv17GetStringUTFCharsEP8_jstringPh ; _JNIEnv::GetStringUTFChars(_jstring *,uchar *)
.text:00017C4E MOVS R3, R0 ; r3 = (char*)imei = local_imei_ptr
.text:00017C50 STR R3, [SP,#0x318+local_imei_charPtr]
.text:00017C52 ADD R3, SP, #0x318+var_2A0
.text:00017C54 MOVS R0, R3
.text:00017C56 BL _ZNSaIcEC1Ev ; std::allocator<char>::allocator(void)
.text:00017C5A ADD R2, SP, #0x318+var_3C
.text:00017C5C ADD R3, SP, #0x318+var_2A0
.text:00017C5E MOVS R0, R2
.text:00017C60 MOVS R1, R3
.text:00017C62 BL _ZNSsC1ERKSaIcE ; std::string::string(std::allocator<char> const&)
.text:00017C66 ADD R3, SP, #0x318+var_2A0
.text:00017C68 MOVS R0, R3
.text:00017C6A BL _ZNSaIcED1Ev ; std::allocator<char>::~allocator()
.text:00017C6E LDR R3, [SP,#0x318+Class_sign]
.text:00017C70 LDR R3, [R3,#0x20]
.text:00017C72 CMP R3, #0
.text:00017C74 BEQ signStateIs0
signStateIs0
ADD R3, SP, #0x318+var_2A4
MOVS R0, R3
BL _ZNSaISsEC1Ev ; std::allocator<std::string>::allocator(void)
ADD R2, SP, #0x318+var_2D8
ADD R3, SP, #0x318+var_2A4
MOVS R0, R2
MOVS R1, R3
BL _ZNSt6vectorISsSaISsEEC1ERKS0_ ; std::vector<std::string,std::allocator<std::string>>::vector(std::allocator<std::string> const&)
ADD R3, SP, #0x318+var_2A4
MOVS R0, R3
BL _ZNSaISsED1Ev ; std::allocator<std::string>::~allocator()
LDR R3, [SP,#0x318+Class_sign]
LDR R2, [R3,#0x2C]
LDR R1, [SP,#0x318+env]
ADD R3, SP, #0x318+var_2D8
MOVS R0, R1
MOVS R1, R2
MOVS R2, R3
BL _Z12GetSignatureP7_JNIEnvP8_jobjectRSt6vectorISsSaISsEE ; GetSignature(_JNIEnv *,_jobject *,std::vector<std::string,std::allocator<std::string>> &)
ADD R3, SP, #0x318+var_2A8
MOVS R0, R3
BL _ZNSaIcEC1Ev ; std::allocator<char>::allocator(void)
ADD R2, SP, #0x318+var_54
ADD R3, SP, #0x318+var_2A8
MOVS R0, R2
MOVS R1, R3
BL _ZNSsC1ERKSaIcE ; std::string::string(std::allocator<char> const&)
ADD R3, SP, #0x318+var_2A8
MOVS R0, R3
BL _ZNSaIcED1Ev ; std::allocator<char>::~allocator()
LDR R0, [SP,#0x318+Class_sign]
ADD R1, SP, #0x318+var_54
LDR R2, [SP,#0x318+appid(int)]
ADD R3, SP, #0x318+var_2D8
LDR R5, [SP,#0x318+local_uin(char[])]
STR R5, [SP,#0x318+var_318]
BL _ZN13CCodecWarpper26CreatePhSigLcIdCheckPacketERSsiRSt6vectorISsSaISsEEPKc ; CCodecWarpper::CreatePhSigLcIdCheckPacket(std::string &,int,std::vector<std::string,std::allocator<std::string>> &,char const*)
ADD R3, SP, #0x318+var_190
MOVS R0, R3
BL _ZN8CSSODataC1Ev ; CSSOData::CSSOData(void)
ADD R3, SP, #0x318+NetType(int)
LDRB R5, [R3]
LDR R3, [SP,#0x318+Class_sign]
LDR R3, [R3,#4]
MOV R9, R3
ADDS R2, R3, #1
LDR R3, [SP,#0x318+Class_sign]
STR R2, [R3,#4]
LDR R3, [SP,#0x318+Class_sign]
MOVS R1, #0x44
ADDS R1, R1, R3
MOV R8, R1
LDR R3, =(unk_2CBF0 - 0x17CF8)
ADD R3, PC
MOVS R0, R3
BL _ZNKSs5c_strEv ; std::string::c_str(void)
MOVS R7, R0
ADD R3, SP, #0x318+var_54
MOVS R0, R3
BL _ZNKSs5c_strEv ; std::string::c_str(void)
MOVS R6, R0
ADD R3, SP, #0x318+var_54
MOVS R0, R3
BL _ZNKSs4sizeEv ; std::string::size(void)
MOVS R3, R0
MOVS R1, R3
ADD R2, SP, #0x318+var_190
LDR R3, =(a0 - 0x17D1C)
ADD R3, PC ; "0"
MOV R0, R9
STR R0, [SP,#0x318+var_318]
LDR R0, [SP,#0x318+appid(int)]
STR R0, [SP,#0x318+var_314]
LDR R0, [SP,#0x318+appid2(int)]
STR R0, [SP,#0x318+var_310]
LDR R0, [SP,#0x318+local_imei_charPtr]
STR R0, [SP,#0x318+var_30C]
MOV R0, R8
STR R0, [SP,#0x318+var_308]
STR R7, [SP,#0x318+var_304]
STR R6, [SP,#0x318+var_300]
STR R1, [SP,#0x318+var_2FC]
MOVS R0, R2
MOVS R1, #0
MOVS R2, R3
MOVS R3, R5
BL _ZN8CSSOData4initEiPKcciiiS1_RSsS1_S1_i ; CSSOData::init(int,char const*,char,int,int,int,char const*,std::string &,char const*,char const*,int)
ADD R2, SP, #0x318+var_190
ADD R3, SP, #0x318+var_3C
MOVS R0, R2
MOVS R1, R3
BL _ZN8CSSOData9serializeERSs ; CSSOData::serialize(std::string &)
LDR R3, [SP,#0x318+Class_sign]
MOVS R2, R3
ADDS R2, #0x34
LDR R3, [SP,#0x318+Class_sign]
LDR R3, [R3,#4]
SUBS R3, #1
STR R3, [SP,#0x318+var_2CC]
ADD R3, SP, #0x318+var_2CC
MOVS R0, R2
MOVS R1, R3
BL _ZNSt6vectorIiSaIiEE9push_backERKi ; std::vector<int,std::allocator<int>>::push_back(int const&)
ADD R3, SP, #0x318+var_190
MOVS R0, R3
BL _ZN8CSSODataD1Ev ; CSSOData::~CSSOData()
ADD R3, SP, #0x318+var_54
MOVS R0, R3
BL _ZNSsD1Ev ; std::string::~string()
ADD R3, SP, #0x318+var_2D8
MOVS R0, R3
BL _ZNSt6vectorISsSaISsEED1Ev ; std::vector<std::string,std::allocator<std::string>>::~vector()
大牛只需要帮我分析下STL相关部分汇编即可。先谢谢了!
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课