三个参数为主,和其他混淆技巧 [英] Three arguments to main, and other obfuscating tricks

查看:142
本文介绍了三个参数为主,和其他混淆技巧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面混淆C $ C $ç打印的话来的圣诞节12天。

我试图解出它是如何工作。我基本上完全丧失。什么是三无类型参数主要在初始呼叫时,先回后一系列字符,负数值参数来调用主的意义何在?伊克!

我主要在做这一思想也许我将学习C语言的一些有趣的角落,所以在这个脉的答复是最欢迎的。

 的#include<&stdio.h中GT;
主(T,_,A)的char * A; {返回0℃; T!T<?3个主要(-79,-13,+一主(-87,1-_,
主(-86,0,A + 1)+ a)项):1,T< _主(T + 1,_,A):3,主(-94,-27 + T,A)及和放大器;?吨== 2 _&; 13?
主(2,_ + 1%s%D \\ n):9:16:??吨℃的T< -72主(_,T,
@n'+#/ * {} W + / W#cdnr / +,{} R / *德} + / * {* +,/ W {%+ / W#q构成#N + /# {1,+ / N {N + / +#N +,/#\\
;#q构成#N + / + K#* +,/'R:'D *'3} {W + K w'K:'+} e所#'; DQ#'L \\
q#+ D'K#/ + K#; q!#'R} EKK#}} w'r EKK {NL]'/#,#q构成#N'){)#} W'){){ NL]'/ +#N'; D} RW'我;#\\
!){NL] / N {N#';环R {#w'r NC {NL]'/#{1 +K {RWIK {[{NL]'/ W#q构成#n'wk NW'\\
IWK {{KK NL] / W {%'升## W#'我!; :;'!} {nlwb / *德}'{NL]/ * {Q#LD R C \\
;; {NL' - {} RW]'/ +,} ##'*}#NC,'#NW]'/ + KD'+ E} +;##RDQW¯¯! NR'/')} +} {RL#'{N'')#\\
}'+} ##(!! /)
:T< -50 _ == *一个的putchar(31 [A]):??主(-65,_,A + 1):主((*一个=='/')+ T,_,A + 1)
  :0℃; t主(2,2,%S):*一=='/'||主(0,主(-61,*一,?
!EK; DC I @ BK(Q) - [W] *%N + R3#L,{}:\\ nuwloca-O,M .vpbks,fxntdCeghiry),A + 1);}


解决方案

已经有人走了,扭转了这一:<一href=\"http://research.microsoft.com/en-us/um/people/tball/papers/xmasgift/\">http://research.microsoft.com/en-us/um/people/tball/papers/xmasgift/.刚刚经历了阅读。它会解释它是如何工作的。

The following obfuscated C code prints the words to the "12 days of Xmas".

I was trying to puzzle out how it works. I'm basically completely lost. What is the significance of the three untyped arguments to main in the initial call, the series of characters after the first return, the negative numeric arguments to the calls to main? Eek!

I'm mostly doing this thinking maybe I'll learn some interesting corners of the C language, so replies in that vein are the most welcome.

#include <stdio.h>
main(t,_,a)char *a;{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86,0,a+1)+a)):1,t<_?main(t+1,_,a):3,main(-94,-27+t,a)&&t==2?_<13?
main(2,_+1,"%s %d %d\n"):9:16:t<0?t<-72?main(_,t,
"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+,/+#n+,/#\
;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l \
q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# \
){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' \
iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# \
}'+}##(!!/")
:t<-50?_==*a?putchar(31[a]):main(-65,_,a+1):main((*a=='/')+t,_,a+1)
  :0<t?main(2,2,"%s"):*a=='/'||main(0,main(-61,*a,
"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}

解决方案

Someone's already gone and reversed this: http://research.microsoft.com/en-us/um/people/tball/papers/xmasgift/. Just read through that. It'll explain how it all works.

这篇关于三个参数为主,和其他混淆技巧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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