Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

rev/arrayaddition #40

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions arrayaddition/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM --platform=linux/amd64 ubuntu:latest

RUN apt-get update -y && apt-get install -y gcc && rm -rf /var/lib/apt/lists/*

COPY main.c .
RUN gcc -o arrayaddition main.c
20 changes: 20 additions & 0 deletions arrayaddition/chall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Array Addition
categories:
- rev
value: 25
flag: bcactf{w0W_cHa4aCt3R_aDD}
description: |-
Someone asked how well I could add ASCII characters. Please help.
hints:
- What values are ASCII characters stored in?
- Is it possible there's a relation between the character and its position?
files:
- src: ./arrayaddition
container: static
authors:
- Joshua Peisach (ItzSwirlz)
visible: true
deploy:
static:
build: .
# TODO: deployment
1 change: 1 addition & 0 deletions arrayaddition/flag.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bcactf{w0W_cHa4aCt3R_aDD}
20 changes: 20 additions & 0 deletions arrayaddition/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// flag is this
// bcactf{w0W_cHa4aCt3R_aDD}
#include <stdio.h>

char arr[30] = {'b', 'b', '_', '`', 'p', 'a', 'u', 'p', '(', 'N', 'U', 'X', '<', 'T', '&', 'R', '3', 'c', '!', '?', 'K', 'L', '.', '-', 'e'};
int main() {
// this will show how the text was generated which you can find w/ strings
mud-ali marked this conversation as resolved.
Show resolved Hide resolved
// for(int i = 0; i < 25; i++) {
// printf("%c", arr[i] + i);
// }

// solution:
// the same as above but subtract i instead of add

printf("Alright, here's the deal:\n");
printf("There is an array hiding somewhere in this program..\n");
printf("But it is a little bit odd.\n");
printf("I think there's a correlation between the individual data in the array's placement and what the data actually means.");
return 0;
}