BDSec CTF 2025

revME – Reverse Engineering Challenge Writeup | BDSec CTF 2025

1)Check the code with ghidra

2)Notice enc_hint and above it enc_flag ,

                             enc_flag                                        XREF[2]:     004000c0(*), 
                                                                                          _elfSectionHeaders::00000090(*)  
        00402000 e8              ??         E8h
        00402001 ee              ??         EEh
        00402002 f9              ??         F9h
        00402003 ef              ??         EFh
        00402004 e9              ??         E9h
        00402005 d1              ??         D1h
        00402006 d8              ??         D8h
        00402007 99              ??         99h
        00402008 fc              ??         FCh
        00402009 f5              ??         F5h
        0040200a c7              ??         C7h
        0040200b 99              ??         99h
        0040200c f5              ??         F5h
        0040200d eb              ??         EBh
        0040200e d9              ??         D9h
        0040200f e7              ??         E7h
        00402010 f5              ??         F5h
        00402011 e8              ??         E8h
        00402012 ee              ??         EEh
        00402013 d7              ??         D7h
                             enc_hint                                        XREF[2]:     entry:00401000(*), 
                                                                                          entry:00401013(R)  
        00402014 e8              undefined1 E8h

3)Copy special from enc_flag

4)Decrypt with given key within the code : as it is a simple xor problem

  do {
    *pbVar3 = *pbVar2 ^ key;
    pbVar2 = pbVar2 + 1;
    pbVar3 = pbVar3 + 1;
    lVar1 = lVar1 + -1;
  } while (lVar1 != 0);

0 people love this