1 2 3 4 5 6 7 8 9 10 | data = [0x8D, 0x8F, 0x93, 0xE6, 0xDD, 0xDD, 0xDA, 0xF0, 0x74, 0xF2, 0x03, 0x6D, 0xC0, 0xD3, 0x07, 0x29, 0x9A, 0x97, 0xB7, 0x3D, 0xD6, 0x0B, 0xBC, 0x53, 0xF4, 0x89, 0x8E, 0x08, 0x21, 0x52, 0xE9, 0x42, 0x35, 0x0D, 0x0B, 0x0C, 0x7D, 0x0E, 0x0F, 0x10, 0x69, 0x44, 0x27, 0x06, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x81, 0x18, 0x1F, 0x20, 0x3D, 0x22, 0x23, 0x24, 0x55, 0x26, 0x27, 0x28, 0x22, 0x2A, 0x2B, 0x2C, 0xCD, 0x2E, 0x2F, 0x30, 0x3B, 0x32, 0x33, 0x34, 0x39, 0x37, 0x37, 0x38, 0x3B, 0x3A, 0x3B, 0x3C, 0xB9, 0x3F, 0x3F, 0x40, 0x4D, 0x42, 0x43, 0x44, 0xD1, 0x47, 0x47, 0x48, 0x48, 0x4A, 0x4B, 0x4C, 0xB9, 0x4F, 0x4F, 0x50, 0x79, 0x57, 0x53, 0x54, 0x41, 0x54, 0x57, 0x58, 0x75, 0x5F, 0x5B, 0x5C, 0x6B, 0x5B, 0x5F, 0x60, 0x5F, 0x67, 0x63, 0x64, 0x24, 0x63, 0x67, 0x68, 0x24, 0x6F, 0x6B, 0x6C, 0x3D, 0x6B, 0x6F, 0x70, 0x25, 0x77, 0x73, 0x74, 0x22, 0x73, 0x77, 0x78, 0x22, 0x7F, 0x7B, 0x7C, 0x1D, 0x7B, 0x7F, 0x80, 0xE6, 0x87, 0x83, 0x84, 0xF3, 0x83, 0x87, 0x88, 0x03, 0x8F, 0x8B, 0x8C, 0x13, 0x8B, 0x8F, 0x90, 0x23, 0x97, 0x93, 0x94, 0x53, 0x93, 0x97, 0x98, 0x50, 0x9F, 0x9B, 0x9C, 0x4C, 0x9B, 0x9F, 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 0x02, 0x22, 0x03, 0x04, 0x0D, 0x06, 0x07, 0x08, 0x06, 0x0C, 0x0B, 0x0C, 0x0D, 0x2E, 0x0F, 0x10, 0x10, 0x12, 0x13, 0x14, 0x65, 0x10, 0x17, 0x18, 0x19, 0x0A, 0x1B, 0x1C, 0x1C, 0x1E, 0x1F, 0x20, 0xBD, 0x24, 0x23, 0x24] s = '' n = 233 for c in data: s += chr(c ^ (n & 0xff)) n += 1 with open('real_check.dex', 'wb') as f: f.write(s) | cs |
real_check source
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | package com.a; import java.util.Arrays; public class Check { private static int[] a = { -1414812757, -842150451, -269488145, 305419896 }; private static byte[] b = { 99, 124, 101, -23, -114, 81, -47, -39, -102, 79, 22, 52, -39, -94, -66, -72, 101, -18, 73, -27, 53, -5, 46, -20, 97, 11, -56, 36, -19, -49, -112, -75 }; private static int a(byte paramByte) { int i = paramByte; if (paramByte < 0) { i = paramByte + 256; } return i; } public static byte[] a(byte[] paramArrayOfByte) { int i = 8 - paramArrayOfByte.length % 8; byte[] arrayOfByte = new byte[paramArrayOfByte.length + i]; arrayOfByte[0] = ((byte)i); System.arraycopy(paramArrayOfByte, 0, arrayOfByte, i, paramArrayOfByte.length); paramArrayOfByte = new byte[arrayOfByte.length]; i = 0; while (i < paramArrayOfByte.length) { System.arraycopy(a(arrayOfByte, i, a, 32), 0, paramArrayOfByte, i, 8); i += 8; } return paramArrayOfByte; } static byte[] a(byte[] paramArrayOfByte, int paramInt1, int[] paramArrayOfInt, int paramInt2) { paramArrayOfByte = a(paramArrayOfByte, paramInt1); int i = paramArrayOfByte[0]; paramInt1 = paramArrayOfByte[1]; int k = 0; int m = paramArrayOfInt[0]; int n = paramArrayOfInt[1]; int i1 = paramArrayOfInt[2]; int i2 = paramArrayOfInt[3]; int j = 0; while (j < paramInt2) { k -= 1640531527; i += ((paramInt1 << 4) + m ^ paramInt1 + k ^ (paramInt1 >> 5) + n); paramInt1 += ((i << 4) + i1 ^ i + k ^ (i >> 5) + i2); j += 1; } paramArrayOfByte[0] = i; paramArrayOfByte[1] = paramInt1; return a(paramArrayOfByte, 0); } private static byte[] a(int[] paramArrayOfInt, int paramInt) { byte[] arrayOfByte = new byte[paramArrayOfInt.length << 2]; int i = 0; while (paramInt < arrayOfByte.length) { arrayOfByte[(paramInt + 3)] = ((byte)(paramArrayOfInt[i] & 0xFF)); arrayOfByte[(paramInt + 2)] = ((byte)(paramArrayOfInt[i] >> 8 & 0xFF)); arrayOfByte[(paramInt + 1)] = ((byte)(paramArrayOfInt[i] >> 16 & 0xFF)); arrayOfByte[paramInt] = ((byte)(paramArrayOfInt[i] >> 24 & 0xFF)); i += 1; paramInt += 4; } return arrayOfByte; } private static int[] a(byte[] paramArrayOfByte, int paramInt) { int[] arrayOfInt = new int[paramArrayOfByte.length >> 2]; int i = 0; while (paramInt < paramArrayOfByte.length) { arrayOfInt[i] = (a(paramArrayOfByte[(paramInt + 3)]) | a(paramArrayOfByte[(paramInt + 2)]) << 8 | a(paramArrayOfByte[(paramInt + 1)]) << 16 | paramArrayOfByte[paramInt] << 24); i += 1; paramInt += 4; } return arrayOfInt; } public static boolean check(String paramString) { return Arrays.equals(a(paramString.getBytes()), b); } } | cs |
Solve
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #include <stdio.h> #include <stdlib.h> void decrypt(int* enc, int n) { int table[] = { -1414812757, -842150451, -269488145, 305419896 }; int sum = -957401312; unsigned int key = 1640531527; for (int i = 0; i < 32; i++) { enc[n + 1] -= ((enc[n] << 4) + table[2]) ^ (enc[n] + sum) ^ ((enc[n] >> 5) + table[3]); enc[n] -= ((enc[n + 1] << 4) + table[0]) ^ (enc[n + 1] + sum) ^ ((enc[n + 1] >> 5) + table[1]); sum += key; } } int main() { int enc[] = { 99, 124, 101, -23, -114, 81, -47, -39, -102, 79, 22, 52, -39, -94, -66, -72, 101, -18, 73, -27, 53, -5, 46, -20, 97, 11, -56, 36, -19, -49, -112, -75 }; int shift[4] = { 24, 16, 8, 0 }; int byte[32 >> 2] = { 0, }; //byte_to_int int j = 0; for (int i = 0; i < 32; i += 4) { byte[j] = ((enc[i + 3] & 0xff) | ((enc[i + 2] & 0xff) << 8) | ((enc[i + 1] & 0xff) << 16) | ((enc[i] & 0xff) << 24)); j += 1; } for (int i = 0; i < 8; i += 2) decrypt(byte, i); for (int i = 1; i < 8; i++) { for (int j = 0; j < 4; j++) { printf("%c", (byte[i] >> shift[j]) & 0xff); } } printf("\n"); return 0; } | cs |
Flag = HITB{SEe!N9_IsN'T_bELIEV1Ng}
'CTF' 카테고리의 다른 글
[RCTF 2018] simple vm (4) | 2018.05.21 |
---|---|
[ASIS CTF 2018] Density (0) | 2018.05.18 |
CODEGATE 2018 본선 후기 (1) | 2018.04.06 |
[Codegate final 2018] Shall We Dance (0) | 2018.04.06 |
[Codegate final 2018] G0Crack (0) | 2018.04.06 |