Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行报错:thread 'main' panicked at src/main.rs:302:54: read phone type string failed: invalid utf8 string #31

Closed
zhangshengpu opened this issue Nov 20, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@zhangshengpu
Copy link

大佬,运行后报错:

thread 'main' panicked at src/main.rs:302:54:
read phone type string failed: invalid utf8 string

@zhangshengpu
Copy link
Author

let phone_type_string =
    read_string(pid, phone_type_string_addr, 20).expect("read phone type string failed");

302行是不是查找手机号,手机号需要20个字符?为什么是20呢?

@zhangshengpu
Copy link
Author

[+] wechat version is 3.9.12.17

@0xlane
Copy link
Owner

0xlane commented Nov 20, 2024

微信3.x先用109版本,工具新版本更新了些依赖,可能是这个原因,我看看

@0xlane
Copy link
Owner

0xlane commented Nov 20, 2024

let phone_type_string =
    read_string(pid, phone_type_string_addr, 20).expect("read phone type string failed");

302行是不是查找手机号,手机号需要20个字符?为什么是20呢?

这个是找登录手机类型,20是随便写的,转换字符串会到\x00自动终止所以写20也行,实际转换出来的字符串只有android和iphone两个值

@0xlane 0xlane added the bug Something isn't working label Nov 20, 2024
@0xlane
Copy link
Owner

0xlane commented Nov 20, 2024

知道原因了,昨天对微信4.0提交的优化代码里

wechat-dump-rs/src/main.rs

Lines 193 to 195 in 6934f9d

if buf_str.len() != size {
Err(anyhow::anyhow!("invalid utf8 string"))
} else {
这个地方限制了参数指定的大小必须和解析出来的大小一致,否则判定读取失败。我修复一下,用之前的版本应该没问题

@0xlane 0xlane closed this as completed in dc96cf2 Nov 20, 2024
0xlane added a commit that referenced this issue Nov 20, 2024
- Replace the account name with wxid if it is empty. (wechat 4.0)
- Fix #31. (wechat 3.9)
@0xlane
Copy link
Owner

0xlane commented Nov 20, 2024

已在1019版本修复,等自动构建完毕后可以下载试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants