https://api.steampowered.com/IAuthenticationService/GetPasswordRSAPublicKey/v1
搜索 input_protobuf_encoded定位
input_protobuf_encoded的值就是 o
s = r.SerializeBody()
o = i.iI(s)
精准定位
打上条件断点:t == ‘Authentication.GetPasswordRSAPublicKey#1’
r是对象o里面包含了账号
经过序列化方法之后得到
Uint8Array [10, 11, 119, 101, 105, 119, 117, 120, 105, 97, 110, 52, 55]
进入r.SerializeBody
新建account.proto文件
定义proto结构
syntax = "proto3";
package account;
message Account {
string account_name = 1;
}
然后执行命令:
protoc --python_betterproto_out=. account.proto
import base64
from account import Account
# 创建并序列化 Account 对象
account1 = Account(account_name='weiwuxian47')
print(f"原始对象: {account1}")
# 序列化为二进制数据
data = account1.SerializeToString()
print(f"序列化后数据: {data}")
# 将二进制数据进行 Base64 编码
encoded_data = base64.b64encode(data).decode('utf-8')
print(f"Base64 编码后数据: {encoded_data}")
JS代码实现
// 导入编译文件
const proto = require('./account_pb');
// 实例化 Account 类并填充基本信息
const account = new proto.Account();
account.setAccountName("weiwuxian47");
// 打印原始对象
console.log("原始对象:", account);
// 序列化为二进制数据
const data = account.serializeBinary();
console.log('==================================================');
console.log("序列化后数据:", data);
var o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split('');
function M(e, t, n) {
for (var r, a, p = [], i = t; i < n; i += 3)
r = (e[i] << 16 & 16711680) + (e[i + 1] << 8 & 65280) + (255 & e[i + 2]),
p.push(o[(a = r) >> 18 & 63] + o[a >> 12 & 63] + o[a >> 6 & 63] + o[63 & a]);
return p.join("")
}
function iI(e) {
for (var t, n = e.length, r = n % 3, a = [], p = 16383, i = 0, b = n - r; i < b; i += p)
a.push(M(e, i, i + p > b ? b : i + p));
1 === r ? (t = e[n - 1],
a.push(o[t >> 2] + o[t << 4 & 63] + "==")) : 2 === r && (t = (e[n - 2] << 8) + e[n - 1],
a.push(o[t >> 10] + o[t >> 4 & 63] + o[t << 2 & 63] + "="));
return a.join("")
}
// data = new Uint8Array([10, 11, 119, 101, 105, 119, 117, 120, 105, 97, 110, 52, 55])
console.log(iI(data)); // 得到结果 Cgt3ZWl3dXhpYW40Nw==
和js代码对比一下