如何对其进行反混淆[按位异或的条件语句]
这相当于什么
if(~(i3 + -1) < -1) { ... }
如果没有 ixor ~
,
?会是这个吗?
if((i3 + 1) > 0) { ... }
或(怀疑这一点?)
if((i3 + 0) > 0) { ... }
或(怀疑这一点?)
if(i3 < -1) { ... }
谢谢,我自己无法真正测试它,我可以..但我正在编写一个反混淆器,我想百分百确定。
Whats the equivalent of this without ixor ~
if(~(i3 + -1) < -1) { ... }
.
would it be this?
if((i3 + 1) > 0) { ... }
or (doubt this?)
if((i3 + 0) > 0) { ... }
or (doubt this?)
if(i3 < -1) { ... }
Thanks I cannot really test it out myself well I can.. but I'm writing a deobfuscator and I want to be 100% sure.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
~x
实际上是-x - 1
因此,
-(i3 - 1)
等价于-(i3 - 1) - 1
,而 cih 等于-i3
所以,
等价于:
~x
is actually-x - 1
Hence,
-(i3 - 1)
is equivalent to-(i3 - 1) - 1
whcih is equal to-i3
So,
is equivalent to:
首先,我假设这是 Java,并且
i3
是一个int
(与byte
、short 的工作方式相同)
,或长
)。i3 + -1
是i3-1
,它只是某个整数。~
是按位非。所以我们减一并否定所有位。这与二进制补码数字相反。 (对二进制补码取反通常是通过加 1 然后求补来完成)。幸运的是,这个运算是它自己的逆运算,所以做相反的操作也是对数字的 2 补码求反的一种方法。所以我们最终得到了-i3
。你只剩下
-i3 < -1
与i3 > 相同1
这是尽可能清晰的。First of all, I'm assuming this is Java and that
i3
is anint
(would work the same withbyte
,short
, orlong
).i3 + -1
isi3-1
which is just going to be some integer.~
is bitwise not. So we've subtracted one and negated all the bits. This is the exact opposite of negating a two's complement number. (Negating a two's complement is usually done by adding 1 then complementing). Fortunately this operation is its own inverse, so doing the opposite is also a way to negate a 2's complement of a number. So we've ended up with just-i3
.You're left with
-i3 < -1
which is the same asi3 > 1
which is as unobfuscated as it can get.~x
是x
的按位(非逻辑)反转。在二进制补码中,它等于-1 - x
。尝试一下。现在,将其应用到您的条件中:
注意,这仅适用于数字是二进制补码的情况 - 但现在几乎所有 CPU(以及大多数编程语言)都以这种方式运行。
~x
is the bitwise (not logical) inversion ofx
. In two's complement, it is equal to-1 - x
. Try it.Now, to apply this to your condition:
Note, this only applies if the numbers are two's complement -- but almost all CPUs (and most programming languages) behave that way these days.