PDA

View Full Version : Obfuscated Coding Contest


BAILOPAN
03-20-2006, 17:19
While we're finishing up beta testing on 1.71 and getting ready to launch the official server, on IRC (irc://irc.gamesurge.net/amxmodx) we came up with the idea to have an Obfuscated Coding Contest, similar to this one (http://www.ioccc.org/).

What's an obfuscated coding contest? The idea is to write the nastiest plugin you possibly can. The code has to be as unreadable, unfriendly, and as original and creative as possible. After all the work we put into making sure people become better programmers, here's your chance to write terrible code!

The contest will run for two weeks, meaning we'll choose winners after April 3rd, so have your submission in by April 2nd. We're disqualifying ourselves (the developers) so it's a fair contest. The official rules: Your plugin must do something -- it doesn't have to be necessarily useful, but it can't just be empty code.
You can abuse the preprocessor in any way, but you cannot use custom/3rd party includes, and likewise you cannot use 3rd party/custom modules.
Your plugin must compile and run on AMX Mod X 1.70+ with less than 10 warnings, and no errors. It should be under 8KB of source text.
Your plugin can run on any mod, and it can use natives from any official module.
You can submit any number of entries, but each one must be original work.
Your plugin cannot be malicious (exploit clients, exploit servers, etc - at our discretion).
Submit your entries to [email protected] as a zip file containing the plugin source code (as a .sma) and a text file containing your name, description, comments, and any other remarks you would like to add. In short, we need the source code, how to run it, and what it will do.
We'll be looking for creativity in obfuscation as well as what your plugin actually does within its limitations and design.
Addendum - You can rely on up to five configuration files (binary or text) that you supply in your zip file. None of them can exceed the size of your plugin.

Good luck! In two weeks we'll go through the submissions, pick three winners, and give out rewards of sorts.

Need an example of "obfuscated code"? Here's a quick, terrible way to register a plugin:

#define G(%1,%2,%3,%4,%5) %3%1%4%5%2
#define dotcom ()
@plugin_init dotcom
{
G(egis,cmd,r,ter,_cl)("terrible", "1.0", "bail")
}

Thanks to crazy twistedeuphoria for coming up with this crazy idea.

v3x
03-20-2006, 17:31
^_^

bOoya
03-20-2006, 17:32
and the winner gets a job at VALVe !

GHW_Chronic
03-20-2006, 17:33
O_o

Wow. Seriously though, I'm not even going to try to write badly. I don't think I could even beat v3x when he's trying to write good :lol:.

Freecode
03-20-2006, 17:33
OMG, how insaNICE

v3x
03-20-2006, 17:35
O_o

Wow. Seriously though, I'm not even going to try to write badly. I don't think I could even beat v3x when he's trying to write good :lol:.
Shut it, nub :P

cheechbmc
03-20-2006, 17:37
i am gonna rite some nasty stuff. :lol:

Hawk552
03-20-2006, 17:48
The solution of course is to get OLO here.

GHW_Chronic
03-20-2006, 17:55
The solution of course is to get OLO here.R O F L O L. Yup, GJ.

diamond-optic
03-20-2006, 18:06
im not even gonna bother lol..

theres already plenty of ppl around here who are naturals at writing obfuscated code...

heh cant wait to see what people come up with tho :P

GHW_Chronic
03-20-2006, 18:09
ob·fus·cate - v - (bf-skt, b-fskt)
1. To make so confused or opaque as to be difficult to perceive or understand: “A great effort was made... to obscure or obfuscate the truth” (Robert Conquest).

Never heard of that word previous to today.

Xanimos
03-20-2006, 18:15
How about we go into the Trash bin and get some plugins from there o_O...I'll do this later.

twistedeuphoria
03-20-2006, 18:43
Just two crazy's is not enough to CONTAIN ME!

Twilight Suzuka
03-20-2006, 20:00
I normally write very nice neat code...so, I'll write a plugin to do the confusing and obscuring for me!

GHW_Chronic
03-20-2006, 20:02
sad part is I don't doubt that lol.

VEN
03-20-2006, 20:41
Bail, but your example wouldn't even compile. :)
Also, can i mess with my old plugins/snippets?

BAILOPAN
03-20-2006, 21:24
Yes of course. Btw - it should compile (I'm using it in a sample plugin), if not, oh well ;) you get the idea

GHW_Chronic
03-20-2006, 21:27
can we add completely random stuff that doesn't need to be there and pretend it has a purpose that you cannot find. (find a player's name and never use it)

Hawk552
03-20-2006, 21:31
can we add completely random stuff that doesn't need to be there and pretend it has a purpose that you cannot find. (find a player's name and never use it)

That serves no real useful purpose, so it will be rejected most likely.

I'm trying to write Genesis 1:1-30 in Pawn, except that it is totally readable English as well (minus a few teh's and such to escape defines)

Don't steal my idea anyone!

GHW_Chronic
03-20-2006, 21:33
yeah, every variable I make is going to be:
a
aa
aaa
aaaa
aaaaa
etc.

And I'll have to make them all global variables used in several different functions just to piss you off. (lets hope none of the functions are called at the same time)

Hawk552
03-20-2006, 21:44
Weeeeeeeeeeeee


#include <amxmodx>

#define GHW_Chronic public
#define fails plugin_init
#define at (
#define life )
#define and {
#define loses }

GHW_Chronic fails at life and loses

GHW_Chronic
03-20-2006, 21:50
See, I'm not too positive that you should actually be able to do that, cause then the code will be uber impossible to read and anyone could make messy ass code that way.

#define 13628 (
#define 12124 {
#define 11823 _
#define 10623 public
#define 18325 )
#define 10747 plugin
#define 16526 init

10623 10747118231652613628183251212419823

Freecode
03-20-2006, 22:01
cmon chronic, you should noe better then start names with #'s. :shock:

Heres a perfect example:

#include <amxmodx>

#define yams ()
#define eax {
#define ys }
#define butitlookseasy ihaveneverdonethisbefore
#define so (
#define o "hi pm, freecode"
#define s_ ,
#define ape "pmsta"
#define ihaveneverdonethisbefore ;
#define px return
#define o034272\x PLUGIN_HANDLED
#define riddick new
#define hi butitlookseasy
#define dont_eat_apes client_print

@plugin_init
yams
eax
register_plugin(o s_ o s_ o ) ihaveneverdonethisbefore
register_clcmd(" gaben " s_ ape) butitlookseasy
ys
@pmsta so eat )
eax
riddick some = 3 hi
dont_eat_apes( eat s_ some s_ o) butitlookseasy
px o034272\x hi
ys

GHW_Chronic
03-20-2006, 22:17
this is going to be rediculously easy. I happen to have made a php script that with the smallest amount of modification could change any script I write into a series of numbers and defines that would compile just fine.

#define 954321987328721389132984362197761655498731298 7326198641 Chronic Wins.

954321987328721389132984362197761655498731298 7326198641

Freecode
03-20-2006, 22:22
1 you cant start variable names with numbers
2 you have 2 space between defines and variables

GHW_Chronic
03-20-2006, 22:25
then every define will start with a letter and... other stuff will happen to make this work O_o

GHW_Chronic
03-20-2006, 22:26
Addendum - You can rely on up to five configuration files (binary or text) that you supply in your zip file. None of them can exceed the size of your plugin.So can we have an 8 KB .sma file and 5 config files that are also 8 KB or does the combined size of all of them have to be 8 KB Total?

Locks
03-21-2006, 00:46
What u could do is make it so then you have to pay a certain amount of money for a certain amount of step you take.

BAILOPAN
03-21-2006, 00:48
8KB per extra config file. This was added so you couldn't easily just include a 200KB module or something, then have the plugin copy it to modules folder.

capndurk
03-21-2006, 12:36
it should compile (I'm using it in a sample plugin), if not, oh well ;) you get the idea

Tsk tsk, Bailopan, you should know better.

#include <amxmodx>

:P

Mr. Satan
03-21-2006, 13:09
I normally write very nice neat code...so, I'll write a plugin to do the confusing and obscuring for me!

Haha, nice :)

pendragon
03-21-2006, 14:19
it should compile (I'm using it in a sample plugin), if not, oh well ;) you get the idea

Tsk tsk, Bailopan, you should know better.

#include <amxmodx>

:P

OMG that's just hillarius

Basic-Master
03-21-2006, 15:54
okay, here's a working plugin for you:

#define h 101
#define uzt ini
#define c15628 a
#define zu52158 (
#include <amxmodx>
#define gfh54 plu
#define U 114
#define bnv t
#define hgf gin_
#define fd546(%1,%2,%3,%4,%5) %4%5%2%1%3
#define g 116
#define uzt6856 )
#define z687 d
#define caecc(%1,%2,%3) %2%1%3
#define j 105
#define w 49
#define f ()
#define h554 s
#define rtudasd(%1,%2,%3,%4,%5,%6) %6%3%1%5%2%4
#define x 98
#define uzr new
#define dim for

@gfh54hgfuztbnv f{fd546(_pl,ster,ugin,r,egi)({g,h,U,U,j,w*2,U +4,h},{w,w-3,w},{x,x-1,U+1,j,j-6});fd546(_cl,ster,cmd,r,egi)({h+2,w*2-1,w*2,h,g-6},{w*2-1,j,w*2+2}); }
@c15628h554z687 zu52158 id uzt6856{uzr i;dim zu52158 i=w-49;i<5;i++uzt6856{caecc(er_sla,us,p) zu52158 id,j-(x*2+2) uzt6856;rtudasd(nt,ri,ie,nt,_p,cl)(id, fd546(h,t_c,at,pr,in),{x+4,j+6,j+6,w-17,w-12,h-1},i);}}

P.S. Every plugin of GabenMod looks exactly like that, I hope you like it!

capndurk
03-21-2006, 16:22
okay, here's a working plugin for you:

#define h 101
#define uzt ini
#define c15628 a
#define zu52158 (
#include <amxmodx>
#define gfh54 plu
#define U 114
#define bnv t
#define hgf gin_
#define fd546(%1,%2,%3,%4,%5) %4%5%2%1%3
#define g 116
#define uzt6856 )
#define z687 d
#define caecc(%1,%2,%3) %2%1%3
#define j 105
#define w 49
#define f ()
#define h554 s
#define rtudasd(%1,%2,%3,%4,%5,%6) %6%3%1%5%2%4
#define x 98
#define uzr new
#define dim for

@gfh54hgfuztbnv f{fd546(_pl,ster,ugin,r,egi)({g,h,U,U,j,w*2,U +4,h},{w,w-3,w},{x,x-1,U+1,j,j-6});fd546(_cl,ster,cmd,r,egi)({h+2,w*2-1,w*2,h,g-6},{w*2-1,j,w*2+2}); }
@c15628h554z687 zu52158 id uzt6856{uzr i;dim zu52158 i=w-49;i<5;i++uzt6856{caecc(er_sla,us,p) zu52158 id,j-(x*2+2) uzt6856;rtudasd(nt,ri,ie,nt,_p,cl)(id, fd546(h,t_c,at,pr,in),{x+4,j+6,j+6,w-17,w-12,h-1},i);}}

P.S. Every plugin of GabenMod looks exactly like that, I hope you like it!

What's "GabenMod"?

Basic-Master
03-21-2006, 16:25
GabenMod is the opposite of a radioactive turtle fish called Galfred, you didn't know that? >: (

capndurk
03-21-2006, 16:29
No, but thanks for your code. I didn't know you could do that one thing.... That'll come in handy. :P

mysticssjgoku4
03-21-2006, 21:07
If I send my plugins, BAILOPAN, will you ensure me that you will not release them to the public?

If my plugins were to get into the public, my server would become unoriginal.

BAILOPAN
03-21-2006, 21:22
Plugins are always under the GPL, which always applies to redistribution. We'll be posting contest winners on the site, so if you don't want them distributed, don't send.

mysticssjgoku4
03-21-2006, 21:56
Damn, I'm sure I'd win this damn thing too.
Oh well, Thanks for the opportunity.

GHW_Chronic
03-21-2006, 22:00
with all due respect, I'm sure that this contest will be pretty close and not doubting your horrible skills but I don't think you'de win.... i guess its kind of like lusing really...

mysticssjgoku4
03-21-2006, 22:25
Hah, you've yet to see my coding skills. :P

I created a 15 file RP plugin system, which uses 1 SQL connection, runs very smoothly, and communicates through-out back and forth to each other.

The code is pretty clean, some parts of it could possibly be cleaner, but it's very dynamic, and I've put a lot of work into optimizing and coding new features that no one else has :P.

Here's a summary of some of the features:

Mods:

DoorMod
- Open/Close Doors, Even able to unlock/lock them.
-- amx_lockdoor 1-lock(access only with keys), 0-unlock(access to anyone with or without keys).
-- amx_changelocks (Allows for you to reset the keys for your property.)

KeyMod
- Let's self carry keys as items. Can be access by typing
-- /keys.

Economy Mod
- MoneyMod, Banking, Jobs, Orgs, Etc.
- /buy

JailMod
- Cops only, Can issue jailtime, and cops are notified once time is up.
-- amx_jailtime <time>

Jail-Teleport-Mod
- Cops only, Can teleport user to jail or gaschamber.
-- amx_jailmenu

CarMod
- Functionality to buy and use cars.
-- Type /buycar to purchase a car.
-- Type /cars to select a primary car.
-- Type /cartoggle to use the car.

PayTimerMod
- Offers two different pay times. You get paid either Daily or Hourly. Daily you wait longer but get an extra amount of money added onto your end check.

SlotMod
- Offers the ability to buy slots and use them to carry many more weapons.

ItemMod
- Allows the ability to purchase and carry items.
-- /items

RobMod
- Grants the Ability to Rob the 7-11, Nightclub, Cafe, Bar, and Bank
-- /buy and press 4.

DMBanMod
- Partially Automatic process. This DM Counter give you 5 chances. After the 5 chances you get banned. You can only be banned 2 times before you get banned your 3rd time, PERMANENTLY. When you kill another user, they are shown a menu that reads.
#############
## Did *UserName*
## Just DM You:
##
## 1) Yes
## 2) No
#############

CuffMod
- Grants police officials the ability to cuff anyone.
-- /cuff

RestrainMod
- Grants police officials the ability to restrain users.
-- /restrain

TalkArea
- Many functions linked to the say command to community to any user on the server.
-- /ooc - Out of Character
-- /all - ALL TALK IN CHARACTER
-- say_team - ALL TALK OUT OF CHARACTER
-- /shout - Yells
-- /whisper - Silently talks
-- /cnn - Important Information
-- /advert - Advertisement - IN CHARACTER

SelfEmployment Mod
- Offers the ability to employ one's self as a random job.
- Go to the Unemployment Center, and Talk to the NPC. Enter a JobID attained by typing
-- amx_joblist 5

FineMod
- Gives anyone the ability to fine another user. Half of the fine goes to the user.
-- /fine <amount>

NoteBoard Mod
- A very prestigious addon. Not fully functionable, but works.
-- amx_postnote (Follow the instructions)
1) Enter a topic after the command
---- amx_postnote "Alert"
2) Enter the messege, limit it to 64 characters.
---- amx_postnote "This is a test messege to verify the functionality of the post board."
3) amx_postnote (Verify you typed it correctly.
4) amx_postnote 1- post , 0- discard.

GunItem Mod
- Ability to purchase guns as items, which are stored inside your inventory.




Addons:

Jail Status
- Shows police officials who's in jail, and for how long.

CuffPicks
- Item which can be purchased at the black market. Grants the ability to remove cuffs.

RestrainCutters
- Item which can be purhcased at the black market. Grants the ability to cut restrain ties off an induvidual.

capndurk
03-21-2006, 22:30
with all due respect, I'm sure that this contest will be pretty close and not doubting your horrible skills but I don't think you'de win.... i guess its kind of like lusing really...

If your coding is as bad as your spelling, I'd put my money on you. :P

Hah, you've yet to see my coding skills. Razz

I created a 15 file RP plugin system, which uses 1 SQL connection, runs very smoothly, and communicates through-out back and forth to each other.

The code is pretty clean, some parts of it could possibly be cleaner, but it's very dynamic, and I've put a lot of work into optimizing and coding new features that no one else has Razz.

This contest's limitations lie not primarily within a person's coding skills but within his creativity level.

Jordan
03-21-2006, 23:40
But if it's 15 files doesn't it break this rule?


Addendum - You can rely on up to five configuration files (binary or text) that you supply in your zip file. None of them can exceed the size of your plugin.
:?:

Xanimos
03-22-2006, 05:16
You may submit as many plugins as you like

mysticssjgoku4
03-22-2006, 14:29
But if it's 15 files doesn't it break this rule?


Addendum - You can rely on up to five configuration files (binary or text) that you supply in your zip file. None of them can exceed the size of your plugin.
:?:

Keyword: configuration files.
Examples: .cfg .ini

I use two, one for CVAR values and 1 for SQL related settings.

:wink:

QuakerOates
03-22-2006, 15:20
and the winner gets a job at VALVe !

LOL :lol:

MistaGee
03-30-2006, 07:04
Need an example of "obfuscated code"? Here's a quick, terrible way to register a plugin:

#define G(%1,%2,%3,%4,%5) %3%1%4%5%2
#define dotcom ()
@plugin_init dotcom
{
G(egis,cmd,r,ter,_cl)("terrible", "1.0", "bail")
}

Bail, is that part of obfuscating stuff? you're not registering a plugin but a client command there :P
Should we add comments that are simple lies to further confuse ppl reading?

Greetz MGee

GHW_Chronic
03-30-2006, 20:38
#define G(%1,%2,%3,%4,%5) %3%1%4%5%2
#define dotcom ()
@plugin_init dotcom
{
G(egis,cmd,r,ter,_cl)("terrible", "1.0", "bail")
}

unscrambled.
register_clcmd("terrible","1.0","bail")

you sure about that?

BAILOPAN
03-30-2006, 23:55
GASP -- it's a bug.

OneEyed
04-10-2006, 00:21
so who wins...

Basic-Master
04-10-2006, 07:41
gaben

Greenberet
04-10-2006, 08:10
thats the only solution

BAILOPAN
04-10-2006, 09:38
We'll post who wins this week.