bool main(void) { timet tVar1; sizet sVar2; bool bVar3; char local_21 [9]; void…
- User
bool main(void)
{ time_t tVar1; size_t sVar2; bool bVar3; char local_21 [9]; void *local_18; int local_c;
builtin_strncpy(local_21,"REDACTED",9); tVar1 = time((time_t *)0x0); srand((uint)tVar1); local_c = rand(); xor_encrypt(local_21,local_c); printf("Encrypted Message (raw): %s\n",local_21); sVar2 = strlen(local_21); local_18 = (void *)hex_encode(local_21,sVar2); bVar3 = local_18 != (void *)0x0; if (bVar3) { printf("Encrypted Message (Hex): %s\n",local_18); free(local_18); } else { fwrite("Hex encoding failed\n",1,0x14,stderr); } return !bVar3; }
void xor_encrypt(char *param_1,byte param_2)
{ size_t sVar1; int local_1c;
local_1c = 0; while( true ) { sVar1 = strlen(param_1); if (sVar1 <= (ulong)(long)local_1c) break; param_1[local_1c] = param_1[local_1c] ^ param_2; local_1c = local_1c + 1; } return; }
void * hex_encode(long param_1,ulong param_2)
{ void *pvVar1; ulong local_10;
pvVar1 = malloc(param_2 * 2 + 1); if (pvVar1 == (void *)0x0) { pvVar1 = (void *)0x0; } else { for (local_10 = 0; local_10 < param_2; local_10 = local_10 + 1) { sprintf((char )(local_10 * 2 + (long)pvVar1),"%02x",(ulong)(byte *)(local_10 + param_1)); } *(undefined *)((long)pvVar1 + param_2 * 2) = 0; } return pvVar1; }
whats going on here this is some main parts of decompiled program and i got this challnege in ctf.. it was this executable which i decompile and send right now and also a txt file with beaabcacac848bce92ce9198a0cb8dcca091cf8ba08ccfa08ccb99cccccccc82 inside it named encrypted.txt
find me flag
- Assistant