[dasctf]easyre

核心代码

int __cdecl sub_401000(char *Str, char a2)
{
  _BYTE v3[5]; // [esp+4Fh] [ebp-5h]

  __CheckForDebuggerJustMyCode(&unk_405015);
  v3[4] = 0;
  *v3 = *Str >> 5;
  do
  {
    Str[*&v3[1]] = (Str[*&v3[1] + 1] >> 5) | (Str[*&v3[1]] << a2);
    ++*&v3[1];
  }
  while ( *&v3[1] < strlen(Str) - 1 );
  Str[*&v3[1]] = v3[0] | (Str[*&v3[1]] << a2);
  return 0;
}

Str2 =\
[
  0x22, 0x0A, 0x9A, 0x1A, 0xA2, 0x33, 0xDB, 0x9B, 0x83, 0x4B, 
  0x73, 0x73, 0x4B, 0x73, 0x3A, 0xFB, 0x6A, 0x2B, 0x93, 0x93, 
  0x4B, 0x63, 0xCA, 0xFB, 0x91, 0x83, 0xAB, 0x73, 0x23, 0xEA, 
]
for index in range(1,len(Str2)):
  tmp=((Str2[index]>>3)|((Str2[index-1]&0b00000111)<<5))&0xff
  print(chr(tmp),end='')
#ASCTF{spinning_mErrily_r0und}

你可能感兴趣的:(python,ctf,re)