THCTT24_clickclick: init

This commit is contained in:
minoplhy 2025-05-16 23:14:40 +07:00
parent 180549d844
commit 867eacaeb2
Signed by: minoplhy
GPG Key ID: 41D406044E2434BF
4 changed files with 58 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,26 @@
#include <stdint.h>
#include <stdio.h>
#include <string.h>
char secret[] = "29648872964875296486429648872964887296497729649832964920296497929649762964903296497829649772964983296489829649832964903296498729649822964986296498229649862964983296497629649792964987296498029649872964982296498029649822964979296498229649832964979296497929649782964983296489629649812964926";
int32_t key = 2964931; // 7
char key_string[0x20]; // assigned a sustainable amount of space lmao
char flag[0x99]; // assigned a sustainable amount of space lmao
int flag_index = 0;
int main() {
int32_t chunk_size;
sprintf(key_string, "%d", key); // convert int->char[0x20] to get a chunk_size
chunk_size = strlen(key_string);
char chunk[chunk_size];
for (int i=0; i < strlen(secret); i += chunk_size) {
strncpy(chunk, secret + i, chunk_size);
int encoded;
sscanf(chunk, "%d", &encoded);
char decoded = (char)(encoded ^ key);
flag[flag_index++] += decoded; // char index in SEE lang regards
}
printf("%s\n", flag);
}

View File

@ -0,0 +1,19 @@
#include <cstdint>
#include <cstdio>
#include <string>
std::string secret = "29648872964875296486429648872964887296497729649832964920296497929649762964903296497829649772964983296489829649832964903296498729649822964986296498229649862964983296497629649792964987296498029649872964982296498029649822964979296498229649832964979296497929649782964983296489629649812964926";
int32_t key = 2964931;
int32_t chunk_size = std::to_string(key).length();
std::string flag_chars = {};
int main() {
for (int i=0; i < secret.length(); i += chunk_size) {
std::string chunk = secret.substr(i, chunk_size);
int encoded = std::stoi(chunk);
char decoded_char = static_cast<char>(encoded ^ key);
flag_chars += decoded_char;
}
printf("%s\n", flag_chars.c_str());
}

View File

@ -0,0 +1,13 @@
secret = "29648872964875296486429648872964887296497729649832964920296497929649762964903296497829649772964983296489829649832964903296498729649822964986296498229649862964983296497629649792964987296498029649872964982296498029649822964979296498229649832964979296497929649782964983296489629649812964926"
key = 2964931
chunk_size = len(str(key)) # Big guess by my guy at GPT originally at -> 7
flag_chars = []
for i in range(0, len(secret), chunk_size):
num_str = secret[i:i+chunk_size]
encoded = int(num_str)
ch = chr(encoded ^ key)
flag_chars.append(ch)
flag = "".join(flag_chars)
print(flag)