SO逆向入门实战教程六(s)
package com.lession6;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
public class utils {
private static final char[] f14934c = "0123456789ABCDEF".toCharArray();
public static final String KEY_VALUE_DELIMITER = "=";
public static final String FIELD_DELIMITER = "&";
private static boolean a(char c2, String str) {
return (c2 >= 'A' && c2 <= 'Z') || (c2 >= 'a' && c2 <= 'z') || !((c2 < '0' || c2 > '9') && "-_.~".indexOf(c2) == -1 && (str == null || str.indexOf(c2) == -1));
}
static String r(Map map) {
String str;
if (!(map instanceof SortedMap)) {
map = new TreeMap(map);
}
StringBuilder sb = new StringBuilder(256);
for (Map.Entry entry : map.entrySet()) {
String key = entry.getKey();
if (!key.isEmpty()) {
sb.append(b(key));
sb.append(KEY_VALUE_DELIMITER);
String value = https://www.it610.com/article/entry.getValue();
if (value == null) {
str ="";
} else {
str = b(value);
}
sb.append(str);
sb.append(FIELD_DELIMITER);
}
}
int length = sb.length();
if (length > 0) {
sb.deleteCharAt(length - 1);
}
if (length == 0) {
return null;
}
return sb.toString();
}
static String b(String str) {
return c(str, null);
}
static String c(String str, String str2) {
StringBuilder sb = null;
if (str == null) {
return null;
}
int length = str.length();
int i2 = 0;
while (i2 < length) {
int i3 = i2;
while (i3 [期货](https://www.gendan5.com/futures.html)< length && a(str.charAt(i3), str2)) {
i3++;
}
if (i3 != length) {
if (sb == null) {
sb = new StringBuilder();
}
if (i3 > i2) {
sb.append((CharSequence) str, i2, i3);
}
i2 = i3 + 1;
while (i2 < length && !a(str.charAt(i2), str2)) {
i2++;
}
byte[] bytes = str.substring(i3, i2).getBytes(StandardCharsets.UTF_8);
int length2 = bytes.length;
for (int i4 = 0;
i4 < length2;
i4++) {
sb.append('%');
sb.append(f14934c[(bytes[i4] & 240) >> 4]);
sb.append(f14934c[bytes[i4] & 15]);
}
} else if (i2 == 0) {
return str;
} else {
sb.append((CharSequence) str, i2, length);
return sb.toString();
}
}
return sb == null ? str : sb.toString();
}
【SO逆向入门实战教程六(s)】}
补其实现
@Override
public DvmObject> callStaticObjectMethod(BaseVM vm, DvmClass dvmClass, String signature, VarArg varArg) {
switch (signature){
case "com/bilibili/nativelibrary/SignedQuery->r(Ljava/util/Map;
)Ljava/lang/String;
":{
DvmObject> mapObject = varArg.getObjectArg(0);
TreeMap mymap = (TreeMap) mapObject.getValue();
String result = utils.r(mymap);
return new StringObject(vm, result);
}
}
return super.callStaticObjectMethod(vm, dvmClass, signature, varArg);
}
推荐阅读
- 《机器学习实战》高清中文版PDF英文版PDF+源代码下载
- --木木--|--木木-- 第二课作业#翼丰会(每日一淘6+1实战裂变被动引流# 6+1模式)
- 《将来的你,一定会感谢现在战胜烦恼的自己-------第四章/第十一节/用逆向思维解除烦恼》
- typeScript入门基础介绍
- 2020-07-29《吴军·阅读与写作50讲》24实战才能转化效能
- Android|Android sqlite3数据库入门系列
- Python实战计划学习笔记(9)为大规模爬取准备
- Android下的IO库-Okio源码解析(一)|Android下的IO库-Okio源码解析(一) 入门
- 韵达基于云原生的业务中台建设 | 实战派
- 【V课会】第3季-30天小学思维导图实战营