Skip to content

Commit 9c0f6ab

Browse files
authored
(feat): added flags for rookie code rumble (#762)
* change flag format to RCR * main visualiser flag * debugger flag done * add comments
1 parent fa3a143 commit 9c0f6ab

File tree

3 files changed

+76
-2
lines changed

3 files changed

+76
-2
lines changed

client/src/visualiser-debugger/Component/FileTree/FS/IFileSystem.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,80 @@ void print_list(struct node *list) {
688688
type: 'file',
689689
parentPath: 'root/LinkedListWorkspace',
690690
},
691+
'ctf_linked_list.c': {
692+
name: 'ctf_linked_list.c',
693+
path: 'root/LinkedListWorkspace/ctf_linked_list.c',
694+
data: `/**
695+
* Welcome to Rookie Code Rumble!
696+
* In this challenge, you will extract the flag with our linked list visualiser.
697+
*/
698+
#include <stdio.h>
699+
#include <fcntl.h>
700+
#include <unistd.h>
701+
#include <stdlib.h>
702+
703+
struct node
704+
{
705+
int data;
706+
struct node *next;
707+
};
708+
709+
struct list
710+
{
711+
struct node *head;
712+
int size;
713+
};
714+
715+
struct node *create_new_node(int data)
716+
{
717+
struct node *new = malloc(sizeof(struct node));
718+
new->data = data;
719+
new->next = NULL;
720+
return new;
721+
}
722+
723+
void append(int value, struct list *list)
724+
{
725+
struct node *new_tail = create_new_node(value);
726+
if (list->head == NULL)
727+
{
728+
list->head = new_tail;
729+
return;
730+
}
731+
732+
struct node *curr = list->head;
733+
while (curr->next != NULL)
734+
{
735+
curr = curr->next;
736+
}
737+
738+
curr->next = new_tail;
739+
};
740+
741+
int main(int argc, char *argv[])
742+
{
743+
struct list *list = malloc(sizeof(struct list));
744+
list->head = NULL;
745+
746+
int fd = open("flag", O_RDONLY);
747+
char ch;
748+
/**
749+
* Write your code BELOW
750+
* ---------------------
751+
*/
752+
753+
/**
754+
* ---------------------
755+
* Write your code ABOVE
756+
*/
757+
while (!0)
758+
;
759+
close(fd);
760+
}
761+
`,
762+
type: 'file',
763+
parentPath: 'root/LinkedListWorkspace',
764+
},
691765
},
692766
},
693767
},

client/src/visualiser-src/binary-search-tree-visualiser/util/codeSnippets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const insertCodeSnippet = `struct node *insert(struct node *node, int val
1212
export const deleteCodeSnippet = `struct node *delete(struct node *node, int value) {
1313
if (node == NULL)
1414
return node;
15-
15+
// DOD{u_xahq_mxsaduftye!!}
1616
struct node *new_root = node;
1717
if (value < node->value) {
1818
node->left = delete(node->left, value);

debugger/Dockerfile.prod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ run pip3 install -r requirements.txt --root-user-action=ignore
1010

1111
copy . .
1212
expose 8000
13-
run echo 'ZmxhZ3tjbGlja19jbGlja19jbGlja30K' | base64 -d > flag
13+
run echo 'Y2xpY2tfbWU=' | base64 -d > flag
1414
cmd ["python3", "src/serve.py"]

0 commit comments

Comments
 (0)