Comments (9)
+1
from r2dec-js.
why closed? It's not fixed
from r2dec-js.
it is on x86
from r2dec-js.
https://github.com/wargio/r2dec-js/blob/master/libdec/arch/x86.js#L441
from r2dec-js.
I tried on master:
aaa ; pdd @ sub.SADFHUHF_10
Lab01-01.zip
(password is "infected")
label_0:
edi = "hello";
ecx |= 0xffffffff;
eax = 0;
__asm ("repne scasb al, byte es:[edi]");
ecx = ~ecx;
ecx--;
eax = WS2_32_dll_send ();
if (eax != 0xffffffffffffffff) {
goto label_3;
}
eax = WS2_32_dll_shutdown ();
if (eax != 0xffffffffffffffff) {
goto label_3;
}
...
from r2dec-js.
TL;DR: this is an r2 bug, rather than r2dec's
For the first occurrence, a bit-wise operation, I would like to see the actual bit-mask rather than a magic value. As for the two comparisons, r2dec recognizes the magical -1
value according to the underlying architecture, so I looked in the attached binary and noticed that the whole binary is in fact in 32 bits. That made me think -- what an immediate value of 0xffffffffffffffff
is doing there in the first place ?
r2 interprets 83 78 ff
as cmp eax, 0xffffffffffffffff
although the 83
opcode is there to compare registers with an 8-bit immediate value. It is easy to see that this bug came out as a result of sign extension: try to replace the last byte of this sequence with 70h (MSB is clear), and then back to 80h to see the problem.
from r2dec-js.
The bottom line is, that r2 should have generated cmp eax, 0xffffffff
. In that case, the disassembled output would show -1
.
from r2dec-js.
I'll open a ticket for r2
from r2dec-js.
from r2dec-js.
Related Issues (20)
- w32 binaries HOT 1
- GetSystemTimePreciseAsFileTime undefined reference on Windows 7 HOT 6
- [arm64] HOT 6
- Stand-alone use? HOT 1
- Wrong order of arguments of C function HOT 5
- M1 Macbook(2020) r2pm install r2dec can't run HOT 3
- pdd crash on ARM HOT 1
- pddl do not analyse all func HOT 1
- Missing instructions on x64
- README.md RISC-V
- pdd command crashes (always)
- Cut a new release HOT 4
- radare2: symbol lookup error: /root/.local/share/radare2/plugins/core_pdd.so: undefined symbol: r_cons_strcat HOT 9
- esm and qjs rewrite HOT 6
- r2dec seems broken as of 9646f560d169ab684ff67f2fbf6f8b3c61588bb4 HOT 14
- Missing instructions for ARM64 HOT 2
- CC warning in pddi
- Include r2 and r2dec version information inside the pddi output HOT 1
- Remove duktape references in the DEVELOPERS doc HOT 2
- Debian package HOT 1
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 r2dec-js.