-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve op_str connect address parsing of pe #6
Improve op_str connect address parsing of pe #6
Conversation
- insn_to_opu64함수에 대해 Result로 타입 변경 - 구현되지 않은 데이터에 대해 Err로 출력되게 변경 - 메세지가 있는 에러타입 생성
- x86_64 아키텍처에 대한 모듈 작성 - x86_64 op_str에 대한 정규식 작성 - 정규식 라이브러리 Cargo.toml에 추가
- Address가 Option형태의 섹션을 가질 수 있도록 조정 - Address의 파일 오프셋이 없는 경우에 대한 처리 작성
commit 1a657e7 Author: Eveheeero <[email protected]> Date: Wed Dec 7 17:23:00 2022 0900 Overall documentation improvements (#5) - Rust Clippy Update - Rust Workflow add flows - Update Readme - Generate Pull Request template
let target = insn_to_opu64(now_address.clone(), &inst, history); | ||
let target_address = | ||
Address::from_virtual_address(&self.sections, target).unwrap(); | ||
let target = insn_to_opu64(now_address.clone(), &inst, history)?; |
Check warning
Code scanning / clippy
this expression creates a reference which is immediately dereferenced by the compiler
let target_address = | ||
Address::from_virtual_address(&self.sections, target).unwrap(); | ||
"jmp" => { | ||
let target = insn_to_opu64(now_address.clone(), &inst, history)?; |
Check warning
Code scanning / clippy
this expression creates a reference which is immediately dereferenced by the compiler
| "jl" | "jna" | "jb" | "jne" | "jle" | "jrcxz" | "jns" | "jc" | "jo" | "jnge" | ||
| "jnbe" | "jecxz" | "jpo" | "jz" | "jae" | "jpe" | "jnl" | "jp" | "jge" | ||
| "jbe" | "jcxz" | "jno" | "jnp" | "jng" => { | ||
let target = insn_to_opu64(now_address.clone(), &inst, history)?; |
Check warning
Code scanning / clippy
this expression creates a reference which is immediately dereferenced by the compiler
pub const FUNCTIONS: &[&dyn Fn( | ||
Address, | ||
&capstone::Insn, | ||
&mut InstructionHistory, | ||
Captures, | ||
) -> Result<u64, &'static str>] = &[&function0, &function1, &function2]; |
Check warning
Code scanning / clippy
very complex type used. Consider factoring parts into `type` definitions
_history: &mut InstructionHistory, | ||
captures: Captures, | ||
) -> Result<u64, &'static str> { | ||
let virtual_address; |
Check warning
Code scanning / clippy
unneeded late initialization
Squashed commit of the following: commit e9cf426
commit c30638f
commit cd36195
commit 120e661
commit 8644586
commit 4fa7ae3
commit c7d8e4a
commit f41ae3d
|
Summary
Result
Details
now, this program can parse connected address via instruction history with some pattern (in x86_64::parse_block.rs)
Result
op_str could not parse target address cause of 'out-of-section' or 'dynamic generated',
Add regex library to Cargo.toml
Add handling about out-of-section address, and this address will return None at file_offset address and get_section
There are no information about linked section, so program should handle that situation.
Now, next instruction of jmp won't parsed
Need more things to do