Comments (1)
In Miasm2, the delay-slot is handled during the creation of IR Blocks, by separating the update of the IRDst
variable and its use. This variable indicates where is the next block to execute (in contrary of PC
, which can't have labelled values like generated labels).
For instance, if I asm the mips32.S
sample:
python asm/shellcode.py mips32b samples/mips32.S babar.bin
And then I gen the associated IR:
python -i disasm/full.py mips32b babar.bin 0
The block named loc_0000000000000008:0x00000008
has the following list of affectation block
A1 = (A1+0x1)
PC = ((A0+(- ZERO))?loc_0000000000000008:0x00000008,loc_0000000000000014:0x00000014))
IRDst = ((A0+(- ZERO))?loc_0000000000000008:0x00000008,loc_0000000000000014:0x00000014))
A0 = (A0+0xFFFFFFFF)
We can observe the block relative to offset 0x10 does not set IRDst, which is evaluated in the context of the offset 0xC.
Now, the way the step work in the debugging feature is implemented in miasm2/analysis/debugging.py
, method step
:
# Force the jit of one line, and remove the old one
self.myjit.jit.set_options(jit_maxline=1)
self.myjit.jit.updt_automod_code(self.myjit.vm, self.myjit.pc, 8)
# Launch the run (just one line will be jitted and execute)
res = self.myjit.continue_run(step=True)
# Handle the result (exceptions, breakpoints, ...)
self.handle_exception(res)
...
So, currently, lines are considered separately. That's why in run
mode, the debugging will work with delay slot, and in the step
mode it will not.
I'll get back to you if I found a clean way to handle delay-slot in this case.
Hope I've help you to understand the code you've nightly watched.
from miasm.
Related Issues (20)
- Miasm mn_x86.fromstring does not recognize JE/JNE instructions HOT 1
- CMP and CMOV? analysis HOT 2
- [ARM-semantic] Implement carry flag for basic shifters HOT 2
- Convert miasm IR to llvm IR: AttributeError: 'LLVMContext_IRCompilation' object has no attribute 'vmcpu' HOT 2
- Rebasing program in graph HOT 2
- Error when using iterator from DependencyGraph object HOT 2
- Unrolling of loop in SSA through symbolic execution HOT 10
- Exporting `AsmCFG` to `dot` format might generate `dot` code that fails to parse if the `HTML` node label if it contains `>]<`
- miasm in Rust #2 HOT 2
- confusing doc on how to compile on windows. doc added on readme
- FreeBSD Build Error HOT 3
- ImportError: cannot import name 'JitCore_x86' from 'miasm.jitter.arch' HOT 2
- Early stop of IR CFG's Symbolic Execution (stops at SHR instruction) HOT 12
- Apply repo-review suggestions?
- Make disassembly output AT&T syntax? HOT 1
- Getting access to miasm-rs
- jit error HOT 3
- [ARCH64] Jit/sem instruction SUBS (extended register) :-( HOT 3
- RIP relative instruction assembly fails with 4 bytes values on x86 HOT 1
- [Question] MAX_MEMORY_SIZE limitation HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from miasm.