逻辑或混淆 [英] logical OR obfuscation
问题描述
可以在标准C中模拟逻辑OR以模糊其使用吗?因此,我不必使用if(a || b),而是在没有使用的情况下进行混淆,但是测试相同的条件
Can emulation of the logical OR be done in standard C to obfuscate its
use? So I don''t have to use if(a||b) but instead make that even more
obfuscated without its use but testing the same condition
推荐答案
Mantorok Redgormor写道:
Mantorok Redgormor wrote:
可以在标准C中进行逻辑OR的仿真来模糊其使用吗?所以我不必使用if(a || b),而是在不使用它的情况下进行混淆,但测试相同的条件
Can emulation of the logical OR be done in standard C to obfuscate its
use? So I don''t have to use if(a||b) but instead make that even more
obfuscated without its use but testing the same condition
如果(!(!a&&!b))
-
pete
if (!(!a && !b))
--
pete
问候。
文章< 41 ************************** @发布.google.com>,Mantorok
Redgormor写道:
Greetings.
In article <41**************************@posting.google.com >, Mantorok
Redgormor wrote:
可以在标准C中模拟逻辑OR以模糊其使用吗?所以我不必使用if(a || b),而是在不使用它的情况下进行混淆,但测试相同的条件
Can emulation of the logical OR be done in standard C to obfuscate its
use? So I don''t have to use if(a||b) but instead make that even more
obfuscated without its use but testing the same condition
如果(a)
do_something();
if(b&&!a)
do_something();
或
if(a || b ||!(really_complicated_expression))
其中really_complicated_expression是一个重言式(即,必然是真的)。
有无数的变化。
-
_
_V.-o Tristan Miller [en,(fr,de,ia)]><空间有限
/ |` - '' - = - = - = - = - = - = - = - = - = - = - = - = - = - = - =<> ;在ha句中,所以很难
(7_ \\ http://www.nothingisreal.com/ ><完成你的工作
if (a)
do_something();
if (b && !a)
do_something();
or
if (a||b||!(really_complicated_expression))
where really_complicated_expression is a tautology (i.e., necessarily true).
There are an infinite number of variations.
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-'' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it''s hard
(7_\\ http://www.nothingisreal.com/ >< To finish what you
" Mantorok Redgormor" ;< ne ***** @ tokyo.com> schrieb im Newsbeitrag
新闻:41 ********************** ****@posting.google.c om ...
"Mantorok Redgormor" <ne*****@tokyo.com> schrieb im Newsbeitrag
news:41**************************@posting.google.c om...
可以在标准C中模拟逻辑OR以模糊其使用吗?所以我没有必要使用if(a || b)但是使其更加混乱而不使用它但测试相同的条件
Can emulation of the logical OR be done in standard C to obfuscate its
use? So I don''t have to use if(a||b) but instead make that even more
obfuscated without its use but testing the same condition
#include< stdlib.h> ;
#include< stdio.h>
int hide_or(int a,int b)
{
int c = 0;
if(a)
{
c = 1;
}
if(b)
{
c = 1;
}
返回c;
}
int hide_and(int a,in tb)
{
int c = 0;
if(a)
{
如果(b)
{
c = 1;
}
}
返回c;
}
int main(无效)
{
int a = 0;
int b = 0;
int c;
c = hide_or(a,b);
printf("%d%d%d",a,b,c);
c = hide_and(a,b);
printf(" %d%d%d \ n",a,b,c);
a = 1;
c = hide_or(a,b);
printf("%d%d%d",a,b,c);
c = hide_and(a,b);
printf(" ;%d%d%d \ n",a,b,c);
a = 0;
b = 1;
c = hide_or(a,b);
printf("%d%d%d",a,b,c);
c = hide_and(a,b) ;
printf("%d%d%d \ n",a,b,c);
a = 1;
c = hide_or(a,b);
printf("%d%d%d",a,b,c);
c = hide_and(a,b );
printf("%d%d%d \ n",a,b,c);
返回EXIT_SUCCESS;
}
Robert
#include <stdlib.h>
#include <stdio.h>
int hide_or(int a, int b)
{
int c = 0;
if(a)
{
c = 1;
}
if(b)
{
c = 1;
}
return c;
}
int hide_and(int a, int b)
{
int c = 0;
if(a)
{
if(b)
{
c = 1;
}
}
return c;
}
int main(void)
{
int a = 0;
int b = 0;
int c;
c = hide_or(a, b);
printf("%d %d %d ", a, b, c);
c = hide_and(a, b);
printf("%d %d %d\n", a, b, c);
a = 1;
c = hide_or(a, b);
printf("%d %d %d ", a, b, c);
c = hide_and(a, b);
printf("%d %d %d\n", a, b, c);
a = 0;
b = 1;
c = hide_or(a, b);
printf("%d %d %d ", a, b, c);
c = hide_and(a, b);
printf("%d %d %d\n", a, b, c);
a = 1;
c = hide_or(a, b);
printf("%d %d %d ", a, b, c);
c = hide_and(a, b);
printf("%d %d %d\n", a, b, c);
return EXIT_SUCCESS;
}
Robert
这篇关于逻辑或混淆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!