[Thread game] L1TOCC - The Level1Techs Obfuscated Code Contest

Rules:

  • No esoteric languages.

  • You must have written the program yourself.

  • Your entry must be a complete and functioning program.

  • You must provide what language the program is written in in your post.

  • You have to figure out what the program does with yer own hed thunker. Someone posting some C and then you compiling and running it would be CHEATING!

  • You may not post your own program until you guess the current standing obfuscated code.

    • If no one has guessed the current standing obfuscated program after 2 days someone may post a new obfuscated program.

    • The poster of the current standing obfuscated program can supply up to 5 guesses.

4 Likes

I'll start. This should be ez. Python 3.

a=lambda b,c,d,e={}:[e.__setitem__("a", __import__("PIL",globals(),locals(),["Image"],0))or e.__setitem__("b",e["a"].Image.new("RGB",(b,c)))or e.__setitem__("c",e["b"].load())or[e.__setitem__("d",((x*4)/b)-2)or[e.__setitem__("e",((y*4)/c)-2)or e.__setitem__("f",e["d"]+e["e"]*1j)or e.__setitem__("g",0)or e.__setitem__("h",0)or[abs(e["g"])>2 or e.__setitem__("g",(e["g"]**2)+e["f"])or e.__setitem__("h",e["h"]+1)for it in range(d)][0]or e["c"].__setitem__((x,y),(int((e["h"]*255)/d),int((e["h"]*255)/d),int((e["h"]*255)/d)))for y in range(c)]for x in range(b)],e["b"].show()]
a(100, 100, 10)

Clue #1

a=lambda b,c,d,e={}:[e.__setitem__("a", __import__("PIL",globals(),locals(),["Image"],0))or
                     e.__setitem__("b",e["a"].Image.new("RGB",(b,c)))or
                     e.__setitem__("c",e["b"].load())or
                         [e.__setitem__("d",((x*4)/b)-2)or
                             [e.__setitem__("e",((y*4)/c)-2)or
                             e.__setitem__("f",e["d"]+e["e"]*1j)or
                             e.__setitem__("g",0)or e.__setitem__("h",0)or

                             [abs(e["g"])>2 or
                                      e.__setitem__("g",(e["g"]**2)+e["f"])or
                                      e.__setitem__("h",e["h"]+1)
                             for it in range(d)][0]or
                              
                             e["c"].__setitem__((x,y),(int((e["h"]*255)/d),int((e["h"]*255)/d),int((e["h"]*255)/d)))
                              
                             for y in range(c)]
                         for x in range(b)],
                     e["b"].show()]
a(100, 100, 10)

I didn't put in my 100% effort but i guess it makes an image with 256 colors.
put how that image will look i will have to breakdown every part of it.....

It's a little more complex than that.

seeing it but really trying to prevent me from just running it trough python.
Maybe tomorrow or after Christmas when am free i will break it down if nobody answered it yet.

After christmas it'll have been more than two days so you could post your own ;p

Well nobody got it, that was disappointing.

Complete giveaway

mandel=lambda width,height,iterationCap,var={}:[var.__setitem__("PIL", __import__("PIL",globals(),locals(),["Image"],0))or
                     var.__setitem__("image",var["PIL"].Image.new("RGB",(width,height)))or
                     var.__setitem__("canvas",var["image"].load())or
                         [var.__setitem__("xcoord",((x*4)/width)-2)or
                             [var.__setitem__("ycoord",((y*4)/height)-2)or
                             var.__setitem__("c",var["xcoord"]+var["ycoord"]*1j)or
                             var.__setitem__("z",0)or var.__setitem__("iterations",0)or

                             [abs(var["z"])>2 or
                                      var.__setitem__("z",(var["z"]**2)+var["c"])or
                                      var.__setitem__("iterations",var["iterations"]+1)
                             for it in range(iterationCap)][0]or
                              
                             var["canvas"].__setitem__((x,y),(int((var["iterations"]*255)/iterationCap),int((var["iterations"]*255)/iterationCap),int((var["iterations"]*255)/iterationCap)))
                              
                             for y in range(height)]
                         for x in range(width)],
                     var["image"].show()]
mandel(1000, 1000, 64)

3 Likes

Wanted to give this a shot today because am currently home, but right now in problem i still can figure out a good obfuscated code only can think of bad written down code....mostly what i saw from websites that did it on purpose..

I was guessing (late) a 100x100 greyscale square, but was surprised to see the Mandelbrot set!
Are you going again?

It's up for anyone to have a go. I'll do another if nobody else does within the next 12 hoursish

Well seeing as nobody else has done anything here's something that's both written terribly (horrifically inefficient) and pretty confusing, albeit mildly inventive. Inspired by @anon43112114.

Python, again. Next one will be golang if I have to do a third.

a=lambda b,c={"a":{0:1,1:1}}:[c["a"].__setitem__(b,c["a"].get(b,0)+1),b>1 and(c.__setitem__("a",a(b-1,c))or c.__setitem__("a",a(b-2,c))),max(c["a"])!=b and c["a"]or list(map(lambda i:c["a"][i],sorted(c["a"],reverse=True)))[:b]][2]
print(a(20))

Thats just nasty, I'm not fluent enough in python to make heads or tails of it. Much time would be required to re-write it to figure out how it does what it does. I know what it does because I inadvertently cheated! I already know I am a terrible person.

Well quit whining and write a better one for next time!

triggered

I could just do ASM lel,
but I doubt many of you plebs could
figure it out lel
/s don't lynch me boiz :3

1 Like

go ahead

i suck as ASM but would be willing to give it a try

1 Like

@SpaceCat noice Fibonacci sequence you got there m8, really confusing kek.

I could post my last project from my college ASM course.
Actually yeah, why not (it's not like I agreed not to lol).
though it might be a little easy because it uses a pre-compiled library. All the information concerning the external library will be below the code block.
Also it isn't really, well obfuscated, any ASM coders would easily be able to pick it apart lol.

I left all the comments in because i can't be bothered to remove them. and due to the size of the code I decided to leave in any and all flavor text so you aren't completely lost (though at least try to make an effort to not use the comments as hinting to the algorithms at play kek.

Oh lastly, spoiler alert, it's a game, called Gunchy Dice... have fun trying to explain to me what it does lol (I honestly don't remember so i'll take your word for it)

Difficulty: it all depends on you bud.

I apologize for the cheesy jokes, and or references, and or puns contained in this mess...

.data

WelcomeQ:

	.ascii "Welcome to the Daystar Casino,\nthe planet Ahakista's number one casino"
	.ascii "\nwill you become ultimate champion of [current year]!?!\n"
	.ascii "You'll never know if you don't try!\n\n"
	.ascii "But first... How much cash you got in your wallet?! (bills only please):\n\0"

NoMonyz:

	#How about you try coming in with a balance of $0, only to be rejected, what a shame.
	.ascii "Get out... you're poor!\n\0"

Bal:

	.ascii "\nYou have $\0 (in the pot, on the chopping block :)\n\0" #12

EnterBet:

	.ascii "Enter your bet: $\0"

Dreamer:

	.ascii "You.. haven't been paying much attention, or you're just really dumb.\n"
	.ascii "Try again, and pay attention this time!\n\0"

You:

	.ascii "You \0"

House:

	.ascii "House \0"

Rolled:

	.ascii "rolled both a \0"

RolledC:

	.ascii " and a \0"

RolledF:

	.ascii ", amassing a total of \0"

YouWin1:

	.ascii "YOU WIN!\n\0"

YouWin2:

	.ascii "I TOTALLY KNEW YOU COULD DO IT!\n\0"

YouWin3:

	.ascii "WOOT! HOUSE SUCKS!\n\0"

HouseWin1:

	.ascii "YOU LOSE!\n\0"

HouseWin2:

	.ascii "YOU ARE REALLY UNFORTUNATE!\n\0"

HouseWin3:

	.ascii "YOU SUCK!\n\0"

Broke:

	.ascii "\nWell, You're Broke Sooo....\n\0"

Done1:

	.ascii "\nYou're Done, Wasn't That Fun!?!\n\n\0"

Done2:

	.ascii "\nYou're Finnish-- Uhh, I Mean Finished!\n\n\0"

Done3:

	.ascii "\nYou've Been Fired From Your Old Job For Frivilous Spending Of Company Money!\n"
	.ascii "Though If You Want... YOUR HIRED!\n\n\0"

NL:

	.ascii "\n\0"

Dlr:

	.ascii "$\0"
	
.text
.global _start

_start:
	
	#Welcome and set balance
	mov  $WelcomeQ, %eax
	call PrintStringC

	mov  $2, %ebx
        call C

	mov  $Dlr, %eax
	call PrintStringC

	call ScanInt

	call FC

	cmp  $0, %eax
	jle   NM	#poor people check

	mov  %eax, %edx #EDX set to be running balance

Play:

	mov  $2, %ebx
	call C

	mov  $Bal, %eax
	call PrintStringC

	mov  %edx, %eax
	call PrintInt

	call FC

	mov  $12, %ebx
	lea  Bal(%ebx), %eax # Yeah, it's not recommended, but lea is so cool!
	call PrintStringC

Redo:	#Enter a possible bet, or face being berated by the game haha! :D

	mov  $2, %ebx
	call C

	mov  $EnterBet, %eax
	call PrintStringC

	call ScanInt

	cmp  $0, %eax 
	jl   DREM
	cmp  %eax, %edx
	jge  Correct	
DREM:
	call FC
	mov  $Dreamer, %eax
	call PrintStringC
	jmp  Redo

Correct:

	call FC

	push %eax	#store Bet
	mov  $NL, %eax
	call PrintStringC

	movl  $0, %esi

	#2 random rolls, player

Recycle:#recycled, 2 random rolls, house

	inc  %esi	#1, then 2 and done.

	mov  $6, %eax
	call Random
	inc  %eax
	mov  %eax, %ebx

	mov  $6, %eax
	call Random
 	inc  %eax
	mov  %eax, %ecx

	#EBX = first roll, ECX = second roll.

	cmp  $2, %esi
	je   Second

	mov  $You, %eax

	jmp  First

Second:

	mov  $House, %eax

First:

	call PrintStringC

	mov  $Rolled, %eax
	call PrintStringC

	call CC 

	mov  %ebx, %eax
	call PrintInt

	call FC

	mov  $RolledC, %eax
        call PrintStringC

	call CC

	mov  %ecx, %eax
	call PrintInt

	call FC

	mov  $RolledF, %eax
	call PrintStringC

	call CC

	add  %ebx, %ecx
	mov  %ecx, %eax
	
	call PrintInt
	
	call FC

	#EDI = Your total, eax = House total

	cmp  $2, %esi
	je   SV
	mov  %eax, %edi
	jmp  FV

SV:

	push %eax	#store House Total

FV:

	mov  $NL, %eax
	call PrintStringC

	cmp  $1, %esi
	je   Recycle	#No way am i writing this wall of text a second time!

	#Now for the comparisons
	pop  %eax	#pop house total
	mov  %edi, %ebx
	cmp  %ebx, %eax
	jge  HWin

	pop  %eax					#pop bet
	add  %eax, %edx		#add victory moneyz
	
# Winning

        mov  $3, %eax
        call Random

        cmp  $1, %eax
        jl   Fw
        jg   Tw

        #Second
        mov  $YouWin2, %eax
        jmp  SW

Fw:#first

        mov  $YouWin1, %eax
        jmp  SW

Tw:#third

        mov  $YouWin3, %eax

	jmp  SW

HWin:

	pop  %eax
	sub  %eax, %edx		#sub victory moneyz
	
# Random Loser MSGS!
 
        mov  $3, %eax
        call Random

        cmp  $1, %eax
        jl   F
        jg   T

        #Second
        mov  $HouseWin2, %eax
        jmp  SW

F:#first

        mov  $HouseWin1, %eax
        jmp  SW

T:#third

        mov  $HouseWin3, %eax


SW:	#skip to end of win block

	call PrintStringC

	cmp  $0, %edx
	jg   Play

	jmp  End

NM:     #Dialog for the true total losers...

	mov  $NoMonyz, %eax
	jmp  EP

End:

	mov  $Broke, %eax
	call PrintStringC

	mov  $3, %eax
	call Random

	cmp  $1, %eax
	jl   Frst
	jg   Thrd
	
	#Second
	mov  $Done2, %eax
	jmp  EP

Frst:

	mov  $Done1, %eax
        jmp  EP

Thrd:

	mov  $Done3, %eax

EP:

	call PrintStringC

	call EndProgram



	#Conditional Color
CC:

	push %eax
	
        cmp  $1, %esi
        je   Y
        mov  $1, %eax
        jmp  H

Y:

        mov  $4, %eax

H:
        call VTSetForeColor

	pop  %eax

	RET

	#Colors, Uses ECX
C:
	push %eax
	mov  %ebx, %eax
	call VTSetForeColor
	pop  %eax

	RET

	#Fix Colors
FC:
	push %eax
	mov  $7, %eax
        call VTSetForeColor
	pop  %eax
	RET

Here's all that gud external library info that you may or may not need




1 Like

Well it is commented :)

But it seems you enter the amount of cash you have, both you and the house roll two dice, the highest total wins the bet amount. This continues until you either give up or run out of money. House has unlimited funds?
Choice of 3x winning and losing messages, text colouring etc.

Unless I missed something.

1 Like

yis you are correct, there is a poor person check and i remember getting pissy with some of the logic at one point, not sure how much of it suvived lol. a fairly easy one and it was quite enjoyable to make.

Extra points if you can generate the output of the game :3

Here is an easy one. It is psuedo ASM, pretty easy to understand. Yeah the cores all run in parallel. Threads block when moving data up, down, left or right.
Only two registers per core, ACC and BAK.
Most operations work on ACC by default.
SWP swaps ACC and BAK.
SAV copies ACC to BAK. The stacks aren't used, but operate like a stack.
From the game TIS-100 which you should all play!

A pair of numbers are in into IN.A and IN.B, and the program produces two outputs, OUT.Q and OUT.R

@SEP I don't have the libs and don't know what you used to compile it. It needs re-working to compile in MASM32. Id probably just rewrite it in another language, in which case i could just write the output here in a box :)

2 Likes