🧾 ASCII Numbers CTF Challenge Writeup
Convert the following string of ASCII numbers into a readable string: 0x70 0x69 0x63 0x6f 0x43 0x54 0x46 0x7b 0x34 0x35 0x63 0x31 0x31 0x5f 0x6e 0x30 0x5f 0x71 0x75 0x33 0x35 0x37 0x31 0x30 0x6e 0x35
Some time ago, I learned about ASCII values and how they represent characters using numbers. I also wrote a small program that converts hexadecimal values into strings. So when I saw this challenge, I knew exactly what to do.
The Code
I wrote a simple C program to convert the given hexadecimal values into characters:
// The Code
#include <stdio.h>
void main(){
int hex_nub[] = {0x70, 0x69, 0x63, 0x6f, 0x43, 0x54, 0x46, 0x7b, 0x34, 0x35, 0x63, 0x31, 0x31, 0x5f, 0x6e, 0x30, 0x5f, 0x71, 0x75, 0x33, 0x35, 0x37, 0x31, 0x30, 0x6e, 0x35, 0x5f, 0x31, 0x6c, 0x6c, 0x5f, 0x74, 0x33, 0x31, 0x31, 0x5f, 0x79, 0x33, 0x5f, 0x6e, 0x30, 0x5f, 0x6c, 0x31, 0x33, 0x35, 0x5f, 0x34, 0x34, 0x35, 0x64, 0x34, 0x31, 0x38, 0x30, 0x7d};
int i;
//printf("%s", hex_nub[1]);
for(i=0;i<=56;i++){
printf("%c", hex_nub[i]);
}
}
Explanation
C doesn't really care about how you store the data—whether it's in hex or decimal—as long as you print it as a character using %c
, it will convert it based on the ASCII table.
With this code, I got the flag printed directly to the screen.
Result
picoCTF{theflag ;3}
Last updated