bool
isMyDexSignaures(){
char path[
1024
];
sprintf(path,
"/proc/%d/maps"
,getpid());
FILE
*
f
=
fopen(path,
"r"
);
if
(f
=
=
NULL){
log(
"error fopen!"
);
};
char
buffer
[
4096
];
string sig
=
"";
while
(fgets(
buffer
,sizeof (
buffer
),f)){
if
(strstr(
buffer
,
"classes"
)&& strstr(
buffer
,
"base.apk"
)){
log(
"%s"
,
buffer
);
char
*
temp
=
strtok(
buffer
,
"-"
);
long
addr
=
strtoul(temp,NULL,
16
);
log(
"dex 头部magic: %s"
,(char
*
)addr);
log(
"dex特征打印:%s"
,getsignature((char
*
)addr).c_str());
sig.append(getsignature((char
*
)addr));
}
}
log(
"signature: %s"
,sig.c_str());
return
strcmp(
"5ebbcf832fb69feb3703021e2989839c7b3fffafa7f7e55c6f0204d50e7fb7988a9d2efcc1064122bcb722c16c9987a8e3a09a1048a6303a0db1a76568511675af3d5bc146ea17dfeaa9c545369ad757"
,sig.c_str())
=
=
0
;
}