Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 14-04-2006, 10:42 PM   #1 (permalink)
Right Off the Assembly Line
 
Join Date: Mar 2005
Posts: 42
Default Can anyone figure out this C Code?

Does anybody have any idea how this works???

#include<stdio.h>
main()
{
int a,b,c;
int count = 1;
for (b=c=10;a=
"- LLLLLL?, LMKC,XYZHELLO FOLKS,\
TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\
NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\
HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\
T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\
Hq!WFs XDt!" [b+++21]; )

for(; a-- > 64 ; )
putchar ( ++c=='Z' ? c = c/ 9:33^b&1);

}

It somehow manages to print map of India

i feel a prog has be used to generate this code ...can nybody tell does such program exists for converting a simple logic into a cryptic form
purifier is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 14-04-2006, 10:59 PM   #2 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,657
Default

I saw this here I guess... Pointers I think...
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 14-04-2006, 11:01 PM   #3 (permalink)
Right Off the Assembly Line
 
Join Date: Mar 2005
Posts: 42
Default

Oh...yeah after posting...i'm searching too.. but not able to see a complete valid explanation anywhere...well pointers could be the thing...but i wonder how everything works out...
purifier is offline  
Old 03-01-2007, 05:28 PM   #4 (permalink)
s,b+..u cn..
 
nikhil ramteke's Avatar
 
Join Date: Dec 2006
Posts: 76
Default Re: Can anyone figure out this C Code?

u may get answer 4m www.programmersheaven.com .....i dnt know certainly u wil b getting it or not but try.....i wil also look 4 it.....
nikhil ramteke is offline  
Old 03-01-2007, 06:22 PM   #5 (permalink)
Human Spambot
 
tuxfan's Avatar
 
Join Date: Feb 2004
Location: Mumbai
Posts: 2,653
Default Re: Can anyone figure out this C Code?

Quote:
Originally Posted by QwertyManiac
I saw this here I guess... Pointers I think...
This is not pointers.

But a is declared as an int. So it can store 2 bytes of data. Instead of that, it is stuffed with so many characters.

Additionally, the second part in the for() loop is the condition. So there should "a==..." instead of that there is a single =. So it is an assignement and not a condition.

b and c are declared immediately after a. So most likely they will occupy next 4 bytes after a. But a is stuffed with these characters. First 2 characters are accessible with a, next two with b and next 2 with c. Even count will have characters from the same string.

This is cryptic programming. My (rusted) knowledge of C isn't so good that I would understand this. But these are just a few observations. I have heard that there used to be competitions held for cryptic C programming. C is endless.
__________________
:: Free hosting and free domain names available in special cases. Conditions apply ::
tuxfan is offline  
Old 03-01-2007, 09:40 PM   #6 (permalink)
In The Zone
 
jal_desai's Avatar
 
Join Date: May 2006
Posts: 426
Default Re: Can anyone figure out this C Code?

ya such programs can create graphical outputs... but i think u may need to include graphics.h header file
__________________
TechExplorer.in
jal_desai is offline  
Old 26-10-2007, 10:54 AM   #7 (permalink)
Alpha Geek
 
sachin_kothari's Avatar
 
Join Date: Dec 2004
Location: Pune
Posts: 566
Default Re: Can anyone figure out this C Code?

Quote:
Originally Posted by purifier

#include<stdio.h>
main()
{
int a,b,c;
int count = 1;
for (b=c=10;a=
"- LLLLLL?, LMKC,XYZHELLO FOLKS,\
TFy!QJu ROo TNn(ROo)SLq SLq ULo+\
UHs UJq TNn*RPn/QPbEWS_JSWQAIJO^\
NBELPeHBFHT}TnALVlBLOFAkHFOuFETp\
HCStHAUFAgcEAelclcn^r^r\\tZvYxXy\
T|S~Pn SPm SOn TNn ULo0ULo#ULo-W\
Hq!WFs XDt!" [b+++21]; )

for(; a-- > 64 ; )
putchar ( ++c=='Z' ? c = c/ 9:33^b&1);

}

It somehow manages to print map of India
This code is an obfuscated code.
They are generally unreadable but executable.
Wiki details out Obfuscated Code.
There are software available that can obfuscate any c code. Just google it and you will find lots of obfuscator tools for C, Java, etc.
sachin_kothari is offline  
Old 26-10-2007, 11:49 AM   #8 (permalink)
D i s t i n c t l y Ahead
 
saurabh kakkar's Avatar
 
Join Date: Sep 2006
Location: New delhi
Posts: 494
Smile Re: Can anyone figure out this C Code?

Quote:
Originally Posted by sachin_kothari
This code is an obfuscated code.
They are generally unreadable but executable.
Wiki details out Obfuscated Code.
There are software available that can obfuscate any c code. Just google it and you will find lots of obfuscator tools for C, Java, etc.
Thanks for the info .I had never come through such a program
saurabh kakkar is offline  
Old 26-10-2007, 12:31 PM   #9 (permalink)
Alpha Geek
 
adi007's Avatar
 
Join Date: Sep 2007
Location: hassan
Posts: 714
Default Re: Can anyone figure out this C Code?

me too
__________________
☼ onlyfreewares.info ► Onlyfreewares...Nothing Else !!
☼ regtweak.info ► Windows Registry hacks and tricks
☼ blog.aditech.info ► There is something for everyone
adi007 is offline  
Old 26-10-2007, 12:55 PM   #10 (permalink)
Console Freak
 
aditya.shevade's Avatar
 
Join Date: Jun 2006
Location: Sangli-Maharashtra
Posts: 991
Default Re: Can anyone figure out this C Code?

Search for obfuscated c code in google. Even looking at the winning programs gives you a headache.
__________________
I have launched my blog and I am looking forward to link exchange. If you can then please add my blog link your blogroll and let me know then I can do the same.

http://blog.adityashevade.com
aditya.shevade is offline  
Old 27-10-2007, 02:02 AM   #11 (permalink)
Pawned!... Beyond GODLIKE
 
fun2sh's Avatar
 
Join Date: May 2006
Location: World Of Warcraft -DOTA
Posts: 1,003
Default Re: Can anyone figure out this C Code?

how do get such ideas

cant any1 explain that india map program. also first [B]for[\B] loop in that prog contains only two expression instead of for(exp1;exp2;exp3)
__________________
If God has indeed created Himself in His own image, then I submit to you that God is a cockroach !!!!!!!!
fun2sh is offline  
Old 27-10-2007, 07:39 AM   #12 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,657
Default Re: Can anyone figure out this C Code?

^^
For can be used without initialization and counter expressions

for( ; condition ; ) is valid as you can place the initialization outside and counter inside the loop if you have to. Removing the condition makes it infinite loop until break.
QwertyManiac is offline  
Old 27-10-2007, 09:49 AM   #13 (permalink)
Alpha Geek
 
sachin_kothari's Avatar
 
Join Date: Dec 2004
Location: Pune
Posts: 566
Default Re: Can anyone figure out this C Code?

@fun2sh
The code is obfuscated so that it remains unexplainable.
Its like you can look at the code, but cant make out the flow of the code.
sachin_kothari is offline  
Old 27-10-2007, 04:40 PM   #14 (permalink)
Pawned!... Beyond GODLIKE
 
fun2sh's Avatar
 
Join Date: May 2006
Location: World Of Warcraft -DOTA
Posts: 1,003
Default Re: Can anyone figure out this C Code?

yeah i know that.we can even use like for(; but first [B]for[\B] loop contains only one [B];[\b] there.
__________________
If God has indeed created Himself in His own image, then I submit to you that God is a cockroach !!!!!!!!
fun2sh is offline  
Old 27-10-2007, 05:20 PM   #15 (permalink)
In The Zone
 
deepak.krishnan's Avatar
 
Join Date: Jan 2005
Location: Palakkad/Bangalore
Posts: 423
Default Re: Can anyone figure out this C Code?

OMG how can one think of such a code???
__________________
.dk
deepak.krishnan is offline  
Old 27-10-2007, 07:24 PM   #16 (permalink)
In The Zone
 
ayush_chh's Avatar
 
Join Date: Nov 2005
Location: Bangalore
Posts: 486
Default Re: Can anyone figure out this C Code?

Quote:
Originally Posted by sachin_kothari
This code is an obfuscated code.
They are generally unreadable but executable.
Wiki details out Obfuscated Code.
There are software available that can obfuscate any c code. Just google it and you will find lots of obfuscator tools for C, Java, etc.
man u did a great job...never knew this........

@purifirer

where did u get tis from man????
__________________
eXPerience is what a MAN learn's fROM.....

Last edited by ayush_chh; 27-10-2007 at 07:24 PM. Reason: Automerged Doublepost
ayush_chh is offline  
Old 27-10-2007, 08:47 PM   #17 (permalink)
Alpha Geek
 
sachin_kothari's Avatar
 
Join Date: Dec 2004
Location: Pune
Posts: 566
Default Re: Can anyone figure out this C Code?

^^ Check this link for more obfuscated codes.
This link is of International Obfuscated C code contest.
Enjoy

Quote:
Originally Posted by deepak.krishnan
OMG how can one think of such a code???
You cannot write such codes directly.
There are obfuscated code generators which take your normal programs as input and produce obfuscated code.

Last edited by sachin_kothari; 27-10-2007 at 08:47 PM. Reason: Automerged Doublepost
sachin_kothari is offline  
Old 27-10-2007, 08:56 PM   #18 (permalink)
Google Bot
 
Pathik's Avatar
 
Join Date: Aug 2005
Posts: 9,751
Default Re: Can anyone figure out this C Code?

Yup... and i think coes are also obfuscated to make it difficult to reverse engineer it..
Pathik is offline  
Old 27-10-2007, 09:02 PM   #19 (permalink)
Alpha Geek
 
sachin_kothari's Avatar
 
Join Date: Dec 2004
Location: Pune
Posts: 566
Default Re: Can anyone figure out this C Code?

These codes can be reversed engineered only if the technique used by the obfuscator is known.

There are some well know obfuscation techniques like
> Layout obfuscations - modify the layout structure of the program by two basic methods: renaming identifiers and removing debugging information. They make the program code less informative to a reverse engineer. Most layout obfuscations cannot be undone because they use one-way functions such as changing identifiers by random symbols and removing comments, unused methods, and debugging information. Though layout obfuscations cannot prevent reverse engineers to understand the program by observing the obfuscated code, they at least consume the cost of reverse engineering. Layout obfuscations are the most well studied and widely used in code obfuscation. Almost all Java obfuscators contain this technique.

|> Control obfuscations - change the control flow of the program. The trick is simple: For a routine A() obfuscator creates an additional routine A_bug and an "if" selector, if (PREDICATE) then A_bug(); else A();. The PREDICATE is designed on-the-fly in that way so it is always false (but it's made so it's hard to conclude that fact), and the A() routine is always selected instead of a buggy copy A_bug().

|> Data obfuscations - break the data structures used in the program and encrypt literals. This method includes modifying inheritance relations, restructuring arrays, etc. Data obfuscations thoroughly change the data structure of a program. They make the obfuscated codes so complicated that it is impossible to recreate the original source code.

Source
sachin_kothari is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +5.5. The time now is 02:25 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2