본문 바로가기
CTF

[shell ctf 2022] warmup

by skyepodium 2022. 8. 16.

1. 개요

bitwise 문제

 

2. 분석

기드라로 열고, 수행되는 코드를 C++로 옮겨서 출력했습니다.

#include <iostream>

using namespace std;

bool bVar1;
size_t sVar2;
long in_FS_OFFSET;
int local_ac;
int local_a8 [28];
char local_38 [40];
long local_10;

int main() {
    local_a8[0] = 0x1cc;
    local_a8[1] = 0x1a0;
    local_a8[2] = 0x194;
    local_a8[3] = 0x1b0;
    local_a8[4] = 0x1b0;
    local_a8[5] = 0x18c;
    local_a8[6] = 0x1d0;
    local_a8[7] = 0x198;
    local_a8[8] = 0x1ec;
    local_a8[9] = 0x188;
    local_a8[10] = 0xc4;
    local_a8[11] = 0x1d0;
    local_a8[12] = 0x15c;
    local_a8[13] = 0x1a4;
    local_a8[14] = 0xd4;
    local_a8[15] = 0x194;
    local_a8[16] = 0x17c;
    local_a8[17] = 0xc0;
    local_a8[18] = 0x1c0;
    local_a8[19] = 0xcc;
    local_a8[20] = 0x1c8;
    local_a8[21] = 0x104;
    local_a8[22] = 0x1d0;
    local_a8[23] = 0xc0;
    local_a8[24] = 0x1c8;
    local_a8[25] = 0x14c;
    local_a8[26] = 500;
    bVar1 = true;
    local_ac = 0;
    
    while (local_ac < 0x1b) {
        bVar1 = (bool)(bVar1 & local_a8[local_ac] >> 2 == (int)local_38[local_ac]);
    
        int res = local_a8[local_ac] >> 2;
        cout << (char)res << "";
        local_ac = local_ac + 1;
    }
    cout << endl;
}

'CTF' 카테고리의 다른 글

[CryptoBurst CTF] postman  (0) 2022.08.20
[CryptoBurst CTF] ook what am i looking at  (0) 2022.08.20
[shell ctf 2022] Keygen  (0) 2022.08.16
[shell ctf 2022] Pulling the strings  (0) 2022.08.16
[shell ctf 2022] Heaven  (0) 2022.08.15