【APP逆向22】实用小脚本

  • 1.python处理Treemap排序问题
data_dict = {
        "_appid": "atc.android",
        "appversion": "3.4.0",
        "channelid": "csy",
        "pwd": 'dasdasdas',
        "udid": "sadasd",
        "username": "xwl"
    }

result = "".join(["{}={}&".format(key, data_dict[key]) for key in sorted(data_dict.keys())])
print(result)
  • 2.参数提取
data_string = "app_name=achievo_ad&app_version=7.83.3&device_token=d94f99c7-6640-3321-8c1b-80f94d04c6cb&status=1&warehouse=null&manufacturer=Google&device=Pixel%203&os_version=31&channel=oziq7dxw%3A%3A%3A&vipruid=&regPlat=0&regid=null&rom=Dalvik%2F2.1.0%20%28Linux%3B%20U%3B%20Android%2012%3B%20Pixel%203%20Build%2FSP1A.210812.015%29&skey=6692c461c3810ab150c9a980d0c275ec"

import json

data_dict = {item.split("=")[0]:item.split("=")[1] for item in data_string.split("&")}

data_string = json.dumps(data_dict,indent=4)
print(data_string)
  • 3.转义
import json

dinfo = "%7B%22ah1%22%3A%22%22%2C%22ah2%22%3A%22%22%2C%22ah3%22%3A%22%22%2C%22ah4%22%3A%22wifi%22%2C%22ah5%22%3A%221080_2236%22%2C%22ah6%22%3A1785600%2C%22ah7%22%3A8%2C%22ah8%22%3A5732413440%2C%22ah9%22%3A%22Pixel+4%22%2C%22ah10%22%3A%22%22%2C%22ah11%22%3A%22%22%2C%22ah12%22%3A%22%22%2C%22ah13%22%3A%22%22%2C%22as1%22%3A%2210%22%2C%22as2%22%3A%22%22%2C%22as3%22%3A%22%22%2C%22as4%22%3A%22b9ab99eb4438fddd%22%2C%22as5%22%3A%22%22%2C%22as6%22%3A%22%22%2C%22as7%22%3A%2229%22%2C%22ac1%22%3A%22ac791f31-66b8-301e-837d-539d4c0c39c8%22%7D"

from urllib.parse import quote_plus, unquote_plus

result = unquote_plus(dinfo)
print(result)
data_dict = json.loads(result)

print(json.dumps(data_dict, indent=2))

4.java的字节数组转换成16进制

byte_list = [119,-92,-51,77,6,-9,-34,-47,-101,124,-8,-61,-118,124,100,110,3,5,80,-77]

num_list = []
for item in byte_list:
    if item < 0:
        item = item + 256
    num_list.append(item)

print([hex(ele)[2:].rjust(2,"0") for ele in num_list])
posted @   Tony_xiao  阅读(19)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
点击右上角即可分享
微信分享提示