Skip to content

Instantly share code, notes, and snippets.

@WickedSs
Created August 24, 2018 14:07
Show Gist options
  • Save WickedSs/4fd4c26645697e565d759fa924e9668c to your computer and use it in GitHub Desktop.
Save WickedSs/4fd4c26645697e565d759fa924e9668c to your computer and use it in GitHub Desktop.
Pixel-Madness solution ( RootMe )
from PIL import Image
print('''
[ Solved by Souleymane Guerida AKA ( Th3_w1ck3d ) ]
RootMe-challenges ==> Name : [ Pixel Madness]
''')
ImageP = ['0x3+1x1+0x1+0x1+0x7+1x2+0x15+1x1+0x8+1x1+0x8+1x1+0x1+1x1+0x1+1x1+0x1+1x1+0x1+1x1+0x3+1x1+0x1+1x1+0x3+1x1+0x1+1x4+0x2+1x1+0x25',
'0x2+1x1+0x4+1x1+0x4+1x3+0x1+1x2+0x2+1x8+0x11+1x4+0x1+1x3+0x6+1x2+0x4+1x1+0x4+1x2+0x7+1x4+0x4+1x2+0x7+1x2+0x3+1x2+0x3',
'0x3+1x1+0x2+1x1+0x2+1x1+0x11+1x2+0x2+1x3+0x7+1x1+0x4+1x2+0x2+1x2+0x7+1x1+0x6+1x1+0x2+1x1+0x4+1x3+0x1+1x1+0x4+1x1+0x2+1x1+0x2+1x1+0x3+1x1+0x2+1x3+0x2+1x2+0x3',
'1x1+0x2+1x1+0x4+1x1+0x2+1x1+0x1+1x1+0x2+1x1+0x2+1x1+0x1+1x2+0x2+1x2+0x1+1x2+0x3+1x1+0x3+1x1+0x2+1x2+0x1+1x3+0x3+1x1+0x2+1x1+0x4+1x2+0x1+1x1+0x4+1x1+0x3+1x2+0x12+1x2+0x1+1x1+0x3+1x7+0x3',
'0x3+1x1+0x7+1x1+0x1+1x1+0x4+1x1+0x2+1x2+0x2+1x2+0x4+1x1+0x2+1x1+0x1+1x2+0x1+1x8+0x1+1x1+0x4+1x1+0x5+1x1+0x3+1x2+0x2+1x1+0x1+1x2+0x2+1x1+0x3+1x2+0x9+1x1+0x1+1x2+0x2+1x3+0x2+1x1',
'0x7+1x1+0x4+1x1+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1x2+0x7+1x2']
pixels = []
for row in ImageP:
row = row.split('+')
step = 0
for colum in row:
colum = colum.split('x')
# Drawing White color
if colum[0] == '0':
for i in range(int(colum[1])):
step += 1
pixels.append((255,255,255))
if step == 100:
break
#Drawing Black color
else:
for i in range(int(colum[1])):
step += 1
pixels.append((0,0,0))
image_out = Image.new("RGB", (100, len(ImageP)), "white")
image_out.putdata(pixels)
image_out.save('Solve.png')
image_out.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment