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 2 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
21 changes: 21 additions & 0 deletions arrayaddition/chall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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: builder
authors:
- Joshua Peisach (ItzSwirlz)
visible: true
deploy:
builder:
mud-ali marked this conversation as resolved.
Show resolved Hide resolved
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}
17 changes: 17 additions & 0 deletions arrayaddition/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// 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("i hope you can add numbers");
return 0;
}