Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 6th, 2012  |  syntax: None  |  size: 0.52 KB  |  hits: 198  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def DecodeString(a_string):
  2.     STR_CONST_0 = 0
  3.     ret_str = ""
  4.     for cnt in xrange(len(a_string)):
  5.         value_0 = 11 + cnt
  6.         value_1 = 11 + 12 + cnt
  7.         value_2 = STR_CONST_0 + value_0 * value_1
  8.         value_3 = ((value_2)&0xFF) ^  \
  9.                   ((value_2>>8)&0xFF) ^  \
  10.                   ((value_2>>16)&0xFF) ^ \
  11.                   ((value_2>>24)&0xFF)
  12.         a_byte_val = (ord(a_string[cnt]) - value_3) & 0xFF
  13.         new_byte = chr(a_byte_val & 0xFF)
  14.         ret_str += new_byte
  15.     return ret_str