#include <stdio.h>
void
alg2(
char
* rawdata,
int
input_len){
int
v4,v10;
char
v12 ;
char
* key =
"80306f4370b39fd5630ad0529f77adb6"
;
unsigned
char
table[0x10] = {0x37, 0x92, 0x44, 0x68, 0xA5, 0x3D, 0xCC, 0x7F, 0xBB,0xF, 0xD9, 0x88, 0xEE, 0x9A, 0xE9, 0x5A};
for
(
int
i = 0; i != input_len; ++i) {
v4 = i&7;
v10 = table[i& 0xF];
v12 = ((v10 ^ *(unsigned
char
*)(rawdata + i) ^ *(unsigned
char
*)(key + (i & 7))) + v10) ^ v10;
*(unsigned
char
*)(rawdata + i) = v12;
*(unsigned
char
*)(rawdata + i) = v12 ^ *(unsigned
char
*)(key + (i & 7));
}
}
int
main(
int
argc,
char
const
*argv[])
{
char
input [] =
"functionId=search&body={\"addrFilter\":\"1\",\"addressId\":\"0\",\"articleEssay\":\"1\",\"attrRet\":\"0\",\"buriedExpLabel\":\"\",\"deviceidTail\":\"38\",\"exposedCount\":\"0\",\"filterServiceIds\":\"1468131091\",\"first_search\":\"1\",\"frontExpids\":\"F_001\",\"gcAreaId\":\"1,72,55674,0\",\"gcLat\":\"39.944093\",\"gcLng\":\"116.482276\",\"imagesize\":{\"gridImg\":\"531x531\",\"listImg\":\"358x358\",\"longImg\":\"531x708\"},\"insertArticle\":\"1\",\"insertScene\":\"1\",\"insertedCount\":\"0\",\"isCorrect\":\"1\",\"jdv\":\"0|kong|t_2018512525_cpv_nopay|tuiguang|17303608941925019140008|1730360893\",\"keyword\":\"空æ°å 湿å¨\",\"localNum\":\"2\",\"newMiddleTag\":\"1\",\"newVersion\":\"3\",\"oneBoxMod\":\"1\",\"orignalSearch\":\"1\",\"orignalSelect\":\"1\",\"page\":\"1\",\"pageEntrance\":\"1\",\"pagesize\":\"10\",\"populationType\":\"232\",\"pvid\":\"\",\"searchVersionCode\":\"10110\",\"secondInsedCount\":\"0\",\"showShopTab\":\"yes\",\"showStoreTab\":\"1\",\"show_posnum\":\"0\",\"sourceRef\":[{\"action\":\"\",\"eventId\":\"MyJD_WordSizeResult\",\"isDirectSearch\":\"0\",\"logid\":\"\",\"pageId\":\"Home_Main\",\"pvId\":\"\"},{\"action\":\"\",\"eventId\":\"Search_History\",\"isDirectSearch\":\"0\",\"logid\":\"\",\"pageId\":\"Search_Activity\",\"pvId\":\"632ba208e4854bb1839e6e32a5e6b841\"}],\"stock\":\"1\",\"ver\":\"142\"}&uuid=bd132c578e85c7cd&client=android&clientVersion=13.1.0&st=1731550738362&sv=102\""
;
alg2(input,
sizeof
(input)-1);
for
(
int
i = 0; i <
sizeof
(input)-1; i++){
printf
(
"%02x"
,(unsigned
char
)input[i]);
}
return
0;
}