不混淆 - >成为一个IOCCC混淆程序的pascal [英] un-obsfuscating -> into pascal an IOCCC obsfuscated program

查看:55
本文介绍了不混淆 - >成为一个IOCCC混淆程序的pascal的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我试图反向混淆IOCCC条目,我的最终目标是将代码转换为Delphi(OO) Pascal)。


我不明白问号(?)运算符和

%(%)运算符的作用。 />

如何将这一行(显然是声明一些整数)翻译成

pascal ???


int c = 0,* n = v + 100,j = d <0。你 - 1? a: - 9000,w,z,i,g,q

= 3-f;


如何将这些行翻译成pascal? ?


for(w = i = 0; i< 4; i ++)

w + =(m = v [h [i]])= = f? 300:米== q? - 300:(t = v [ih [i]])

== f? - 50:t == q? 50:0;


如何将这些行转换为pascal ???


for(; t <1600; t + (m = 0; m <100; m ++)

V [t + m] = m < 11 || m> 88 ||(m + 1)%10< 2? 3:0;


什么是<<"做什么?例如如何翻译下一行???


返回d> = u - 1? j +(c << 3):j;


任何帮助将不胜感激。


问候,

Peter W. :-)))

Sandy Bay,Hobart,Tas,AU。

混淆代码(lievaart2.c)

-----

#define D define

#DY返回

#DR

#D e while

#DI printf

#D l int

#DW如果

#DC y = v + 111; H(x,v)* y ++ = * x

#DH(a,b)R(a = b + 11; a< b + 89; a ++)
#D s(a)t = scanf("%d"& a)

#DUZI

#DZI(" 123 \\ \\ b
45678 \ n"); H(x,V){putchar(" .XO" [* x]); W((xV)%10 == 8){x + = 2;我(%d \ n,(xV)/ 1

0-1);}}

l

V [1600],U,R [] = { - 1,-11,-10,-9,1,11,10,9},H [] = {11,18,81,88},1H [] = {22,27,72

,77},

bz,lv = 60,* x,* y,m,t; S(d,v,f, _,a,b)l * v; {l

c = 0,* n = v + 100,j = d< u-1?a:-9000,w,z,i,g ,q =

3-f; W(d> u){R(w = i = 0; i <4; i ++)w + =(m = v [h [i]])= = F 300:M = = q?-300:(t = v [ih [i]])=

= f?-50:

t == q?50:0; Y w ;} H(z,0){W(E(v,z,f,100)){c ++; w =

-S(d + 1,n,q,0,-b) ,-j); W(w> j){g = bz = z;

j = w; W(w> = b || w> = 8003)Y w;}}} W( !c){g = 0; W(_){H(x,v)c + =

* x == f?1:* x == 3-f?-1:0; Y c> 0?

8000 + c:c-8000;} C; j = -S(d + 1,n,q,1,-b,-j);} bz = g ; Y

d> = u-1?j +(c << 3):j;} main(){R(; t<

1600; t + = 100)R(M = 0; M< 100; M +)V [T + M] = M< 11 || M> 88 ||(M + 1)%10 2 3:0; I("等级:

); V [44]

= V [55] = 1; V [45] = V [54] = 2; s(u); e(lv> 0){Z

do {I(" You:"); s(m);} e(!E(V,m,2,0)&& ; m!= 99);

W(m!= 99)lv - ; W(lv <15& u< 10)u + = 2; U(Wait\\\
;);我(价值:%d \ n,S(0,V,1,0,-90
$ b $ 00 00,9000

));我(移动:

%d \ n,(lv- = E(V,bz,1,0),bz));}} E(v,z,f, o)l * v; {l * j,q = 3-f,g = 0,i,w,* k = v

+ z; W(* k == 0)R( I = 7; I> = 0; I - ){J = K +(W = R [1]); E(*Ĵ== q)的J + = W; W(*Ĵ== F&安培;&安培; JW! = k){W(

!g){g = 1
; C;} e(j!= k)*((j- = w)+ o)= f;}} Y g;}

---- -


无混淆代码:

-----

/ *此来源已由未注册的SourceFormatX格式化* /

/ *如果您想删除此信息,请注册此共享软件* /

/ *请访问 http://www.textrush.com 获取更多信息* /


H(x,V )

{

putchar(" .XO" [* x]);

if((xV)%10 == 8)

{

x + = 2;

printf("%d \ n",(xV)/ 10-1); < br $>
}

}


int V [1600],你,r [] =

{

- 1, - 11, - 10, - 9,1,11,10,9

}


,h [] =

{

11,18,81,88

}


,ih [] =

{

22,27,72,77

}


,bz ,lv = 60,* x,* y,m,t;

S(d,v,f,_,a,b)int * v ;

{

int c = 0,* n = v + 100,j = d<你 - 1? a: - 9000,w,z,i,g,q

= 3-f;

if(d> u)

{

for(w = i = 0; i< 4; i ++)

w + =(m = v [h [i]])== f? 300:米== q? - 300:(t = v [ih [i]])

== f? - 50:t == q? 50:0;

返回w;

}

H(z,0)

{

if(E(v,z,f,100))

{

c ++;

w = - S(d + 1,n,q,0,-b,-j);

if(w> j)

{

g = bz = z;

j = w;

if(w> = b || w> = 8003)返回w;

}

}

}

if(!c)

{

g = 0;

if(_)

{

H(x,v)c + = * x == f? 1:* x == 3-f? - 1:0;

返回c> 0? 8000 + c:c - 8000;

}

y = v + 111;

H(x,v)* y ++ = * x;

j = - S(d + 1,n,q,1, - b, - j);

}

bz = g;

返回d> = u - 1? j +(c << 3):j;

}


main()

{

for(; t <1600; t + = 100)

for(m = 0; m <100; m ++)

V [t + m] = m< 11 || m> 88 ||(m + 1)%10< 2? 3:0;

printf(" Level:");

V [44] = V [55] = 1;

V [45] = V [54] = 2;

s(u);

而(lv> 0)

{

printf(" 123'\\'\\ t'45678 \ n");

do

{

printf("你:);

s(m);

}

while(!E(V,m,2,0)& & m!= 99);

if(m!= 99)lv--;

if(lv< 15&& u< 10) u + = 2;

printf(" 123\45678 \ n");

printf(" Wait\\\
);

printf(" Value:%d \ n",S(0,V,1,0,-9000,9000));

printf(" move:%d \ n",(lv - = E(V,bz,1,0),bz));

}

}


E(v,z,f,o)int * v;

{

int * j,q = 3-f,g = 0,i ,w,* k = v + z;

if(* k == 0)

for(i = 7; i> = 0; i--)

{

j = k +(w = r [i]);

while(* j == q)j + = w;

if(* j == f&& ; j - w!= k)

{

if(!g)

{

g = 1;

y = v + 111;

H(x,v)* y ++ = * x;

}

while(j!= k)*((j - = w)+ o)= f;

}

}

返回g;

}

-----


lievaart.hint

-----

大奖:


Roemer B. Lievaart

VU Informatica

Churchilllaan 173-IV

荷兰阿姆斯特丹


我们相信你也会惊讶于先生

Lievaart装入1024的电量字节!


玩这个逆转游戏(奥赛罗)!编译并运行。然后

要求播放等级。输入0-10(easy-hard)。然后它要求你的行动
。移动是一个11-88之内的数字,或99通过。非法

移动(非法传球除外)被拒绝。然后计算机

移动(或通过0),直到电路板满了。对于这么小的节目,它可以很好地播放
! Lievaart不得不省去

板的印刷程序,所以你必须拿一个真正的游戏板才能玩b
。 ......同样由于空间限制(1987年的规则有限制为1024个byes),Lievaart取出了传递处理程序,

结束 - 比较差。但进一步它知道所有

规则,使用alpha-beta修剪,并播放f.i.关于移动性(!)。

最重要的是:它可以玩一个非常好的黑白棋游戏!


作者非常友好地提供全功能版本

计划。文件lievaart2.c包含程序将具有的内容没有大小限制的
。这个版本有完整的游戏结果

逻辑并在每次移动后显示板!


版权所有(c)1987,Landon Curt Noll& Larry Bassel。

保留所有权利。允许个人,教育或

非营利性使用,前提是此版权和通知全部包含在内,并且保持不变。所有其他用途必须

获得Landon Curt Noll和

Larry Bassel的书面许可。

-----

解决方案

On Sun,2005年3月6日07:12:35 GMT,comp.lang.c,Peter Williams

< pe*@bigpond.net.au>写道:

大家好,

我试图反向混淆IOCCC条目,我的最终目标是将代码转换为德尔福(OO Pascal)。

我不明白问号(?)运算符,


?...:更多或者不等于if .. else ...

和百分比(%)运算符。


剩余运营商。 6%4 = 2

我如何将这一行(显然是声明一些整数)翻译成
pascal ???

int c = 0,* n = v + 100,j = d<你 - 1? a: - 9000,w,z,i,g,q = 3-f;


这声明了一堆int和一个指向int的指针。

什么是"<<""做什么?例如如何翻译下一行???




位左移运算符。 0x01<< 4 = 0x10

-

Mark McIntyre

CLC FAQ< http://www.eskimo.com/~scs/C- faq / top.html>

CLC自述文件:< http://www.ungerhu.com/jxh/clc.welcome.txt>


< blockquote> Peter Williams写道:


我试图反向混淆IOCCC条目,我的最终目标是将代码转换为Delphi(OO Pascal)。 br />
我不明白问号(?)运算符和
百分比(%)运算符是什么。

我如何翻译这一行(显然声明一些整数)
进入pascal ???

int c = 0,* n = v + 100,j = d<你 - 1? a: - 9000,w,z,
i,g,q = 3-f;




VAR

c,j ,w,z,i,q:整数;

n:^整数;


c:= 0;

n:= v + 100; (*非常有问题的操作,

Pascal没有关于*的强烈指针。)

如果d< ul那么j:= a

ELSE j:= -9000;

q:= 3 - f;


-

"如果你想通过groups.google.com发布一个后续内容,请不要使用

破损的回复链接在文章的底部。点击

" show options"在文章的顶部,然后点击

回复在文章标题的底部。 - Keith Thompson


Peter Williams写道:

大家好,

我试图反向混淆IOCCC输入,我的
最终目标是将代码转换为Delphi(OO Pascal)。




那是什么''Delphi(OO Pascal) ''?

P.Krumins


Hi All,

I am attempting to reverse-obsfuscate an IOCCC entry, and my ultimate
goal is to convert the code into Delphi (OO Pascal).

I don''t understand what the question-mark (?) operator, and the
percent (%) operator does.

How do I translate this line (obviously declaring some integers) into
pascal ???

int c = 0, *n = v + 100, j = d < u - 1 ? a : - 9000, w, z, i, g, q
= 3-f;

And how do I translate these lines to pascal ???

for(w = i = 0; i < 4; i++)
w += (m = v[h[i]]) == f ? 300 : m == q ? - 300: (t = v[ih[i]])
== f ? - 50: t == q ? 50 : 0;

And how do I translate these lines to pascal ???

for(; t < 1600; t += 100)
for(m = 0; m < 100; m++)
V[t + m] = m < 11 || m > 88 ||(m + 1) % 10 < 2 ? 3 : 0;

What does "<<" do ? e.g. how do I translate the next line???

return d >= u - 1 ? j + (c << 3): j;

Any help will be appreciated.

Regards,
Peter W. :-)))
Sandy Bay, Hobart, Tas, AU.
obsfuscated code ("lievaart2.c")
-----
#define D define
#D Y return
#D R for
#D e while
#D I printf
#D l int
#D W if
#D C y=v+111;H(x,v)*y++= *x
#D H(a,b)R(a=b+11;a<b+89;a++)
#D s(a)t=scanf("%d",&a)
#D U Z I
#D Z I("123\
45678\n");H(x,V){putchar(".XO"[*x]);W((x-V)%10==8){x+=2;I("%d\n",(x-V)/1
0-1);}}
l
V[1600],u,r[]={-1,-11,-10,-9,1,11,10,9},h[]={11,18,81,88},ih[]={22,27,72
,77},
bz,lv=60,*x,*y,m,t;S(d,v,f,_,a,b)l*v;{l
c=0,*n=v+100,j=d<u-1?a:-9000,w,z,i,g,q=
3-f;W(d>u){R(w=i=0;i<4;i++)w+=(m=v[h[i]])==f?300:m==q?-300:(t=v[ih[i]])=
=f?-50:
t==q?50:0;Y w;}H(z,0){W(E(v,z,f,100)){c++;w=
-S(d+1,n,q,0,-b,-j);W(w>j){g=bz=z;
j=w;W(w>=b||w>=8003)Y w;}}}W(!c){g=0;W(_){H(x,v)c+=
*x==f?1:*x==3-f?-1:0;Y c>0?
8000+c:c-8000;}C;j= -S(d+1,n,q,1,-b,-j);}bz=g;Y
d>=u-1?j+(c<<3):j;}main(){R(;t<
1600;t+=100)R(m=0;m<100;m++)V[t+m]=m<11||m>88||(m+1)%10<2?3:0;I("Level:"
);V[44]
=V[55]=1;V[45]=V[54]=2;s(u);e(lv>0){Z
do{I("You:");s(m);}e(!E(V,m,2,0)&&m!=99);
W(m!=99)lv--;W(lv<15&&u<10)u+=2;U("Wait\n");I("Value:%d\n",S(0 ,V,1,0,-90
00,9000
));I("move:
%d\n",(lv-=E(V,bz,1,0),bz));}}E(v,z,f,o)l*v;{l*j,q=3-f,g=0,i,w,*k=v
+z;W(*k==0)R(i=7;i>=0;i--){j=k+(w=r[i]);e(*j==q)j+=w;W(*j==f&&j-w!=k){W(
!g){g=1
;C;}e(j!=k)*((j-=w)+o)=f;}}Y g;}
-----

un-obsfuscated code:
-----
/* This source has been formatted by an unregistered SourceFormatX */
/* If you want to remove this info, please register this shareware */
/* Please visit http://www.textrush.com to get more information */

H(x,V)
{
putchar(".XO"[*x]);
if((x-V)%10==8)
{
x+=2;
printf("%d\n",(x-V)/10-1);
}
}

int V[1600], u, r[] =
{
- 1, - 11, - 10, - 9, 1, 11, 10, 9
}

, h[] =
{
11, 18, 81, 88
}

, ih[] =
{
22, 27, 72, 77
}

, bz, lv = 60, *x, *y, m, t;
S(d, v, f, _, a, b)int *v;
{
int c = 0, *n = v + 100, j = d < u - 1 ? a : - 9000, w, z, i, g, q
= 3-f;
if(d > u)
{
for(w = i = 0; i < 4; i++)
w += (m = v[h[i]]) == f ? 300 : m == q ? - 300: (t = v[ih[i]])
== f ? - 50: t == q ? 50 : 0;
return w;
}
H(z, 0)
{
if(E(v, z, f, 100))
{
c++;
w = - S(d + 1, n, q, 0, - b, - j);
if(w > j)
{
g = bz = z;
j = w;
if(w >= b || w >= 8003)return w;
}
}
}
if(!c)
{
g = 0;
if(_)
{
H(x, v)c += *x == f ? 1 : *x == 3-f ? - 1: 0;
return c > 0 ? 8000+c: c - 8000;
}
y=v+111;
H(x,v)*y++= *x;
j = - S(d + 1, n, q, 1, - b, - j);
}
bz = g;
return d >= u - 1 ? j + (c << 3): j;
}

main()
{
for(; t < 1600; t += 100)
for(m = 0; m < 100; m++)
V[t + m] = m < 11 || m > 88 ||(m + 1) % 10 < 2 ? 3 : 0;
printf("Level:");
V[44] = V[55] = 1;
V[45] = V[54] = 2;
s(u);
while(lv > 0)
{
printf("123\45678\n");
do
{
printf("You:");
s(m);
}
while(!E(V, m, 2, 0) && m != 99);
if(m != 99)lv--;
if(lv < 15 && u < 10)u += 2;
printf("123\45678\n");
printf("Wait\n");
printf("Value:%d\n", S(0, V, 1, 0, - 9000, 9000));
printf("move: %d\n", (lv -= E(V, bz, 1, 0), bz));
}
}

E(v, z, f, o)int *v;
{
int *j, q = 3-f, g = 0, i, w, *k = v + z;
if(*k == 0)
for(i = 7; i >= 0; i--)
{
j = k + (w = r[i]);
while(*j == q)j += w;
if(*j == f && j - w != k)
{
if(!g)
{
g = 1;
y=v+111;
H(x,v)*y++= *x;
}
while(j != k)*((j -= w) + o) = f;
}
}
return g;
}
-----

lievaart.hint
-----
Grand Prize:

Roemer B. Lievaart
VU Informatica
Churchilllaan 173-IV
Amsterdam, The Netherlands

We believe that you too will be amazed at just how much power Mr.
Lievaart packed into 1024 bytes!

This Plays the game of reversi (Othello)! Compile and run. It then
asks for a playing level. Enter 0-10 (easy-hard). It then asks for
your move. A move is a number within 11-88, or a 99 to pass. Illegal
moves (except for an illegal pass) are rejected. Then the computer
does its move (or a 0 to pass), until the board is full. It plays
rather well, for such a small program! Lievaart had to leave out the
board printing routine, so you''ll have to take a real game board to
play it. ... Also due to space-limitations (the rules for 1987 had a
limit of 1024 byes), Lievaart took out the passing-handler, which
makes its ending-game rather poor. But further it knows all the
rules, uses alpha-beta pruning, and it plays f.i. on mobility(!).
Most important: it can play a pretty good game of Reversi!

The Author was kind enough to supply the fully functional version of the
program. The file lievaart2.c contains what the program would have
been without the size restriction. This version has the full end game
logic and displays the board after each move!

Copyright (c) 1987, Landon Curt Noll & Larry Bassel.
All Rights Reserved. Permission for personal, educational or
non-profit use is granted provided this this copyright and notice are
included in its entirety and remains unaltered. All other uses must
receive prior permission in writing from both Landon Curt Noll and
Larry Bassel.
-----

解决方案

On Sun, 06 Mar 2005 07:12:35 GMT, in comp.lang.c , "Peter Williams"
<pe*@bigpond.net.au> wrote:

Hi All,

I am attempting to reverse-obsfuscate an IOCCC entry, and my ultimate
goal is to convert the code into Delphi (OO Pascal).

I don''t understand what the question-mark (?) operator,
?...: is more or less equivalent to if.. else...
and the percent (%) operator does.
remainder operator. 6%4 = 2
How do I translate this line (obviously declaring some integers) into
pascal ???

int c = 0, *n = v + 100, j = d < u - 1 ? a : - 9000, w, z, i, g, q = 3-f;
this declares a bunch of ints and one pointer to an int.
What does "<<" do ? e.g. how do I translate the next line???



bit left-shift operator. 0x01 << 4 = 0x10
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>


Peter Williams wrote:


I am attempting to reverse-obsfuscate an IOCCC entry, and my
ultimate goal is to convert the code into Delphi (OO Pascal).

I don''t understand what the question-mark (?) operator, and the
percent (%) operator does.

How do I translate this line (obviously declaring some integers)
into pascal ???

int c = 0, *n = v + 100, j = d < u - 1 ? a : - 9000, w, z,
i, g, q = 3-f;



VAR
c, j, w, z, i, q : integer;
n : ^integer;

c := 0;
n := v + 100; (* Very questionable operation,
Pascal doesn''t bandy pointers about *)
IF d < u-l THEN j := a
ELSE j := -9000;
q := 3 - f;

--
"If you want to post a followup via groups.google.com, don''t use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson


Peter Williams wrote:

Hi All,

I am attempting to reverse-obsfuscate an IOCCC entry, and my ultimate goal is to convert the code into Delphi (OO Pascal).



What''s that ''Delphi (OO Pascal)''?
P.Krumins


这篇关于不混淆 - &gt;成为一个IOCCC混淆程序的pascal的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆