Skip to content

Instantly share code, notes, and snippets.

@levisre
Created May 8, 2015 02:00
Show Gist options
  • Save levisre/06ed8f62b4e6d48c18f6 to your computer and use it in GitHub Desktop.
Save levisre/06ed8f62b4e6d48c18f6 to your computer and use it in GitHub Desktop.
WhiteHat Contest 9 RE100
def Calculate(iSum, lValue):
lTmp=range(0,len(lValue)+1)
for i in range(0x20,0x7F):
lTmp[0]=i
cSum=0
cSum+=lTmp[0]
for j in range(0,len(lValue)):
lTmp[j+1]=lTmp[j]+lValue[j]
cSum+=lTmp[j+1]
if cSum==iSum:
return "".join(chr(n) for n in lTmp)
print Calculate(0x295,[0x11,-71,0x33,0x11,-29,-8,0x34]) +"." + Calculate(438,[0x26,-11,6,-43])+Calculate(0x825,[0x11,-21,0x14,-13,1,-3,0x0C,-11,0x0C,-9,0x09,0,0,-1,2,-14,2,0x10,0x11,-36,0x17,-10,3,6,5,-23,0x21,-33,0x15,1,-2]) + ">"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment