This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
typedef struct file { | |
char buff[0x1000]; | |
int bitind; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BITS 64 | |
%define REL_LOC 0x1CB0 | |
%define REL_HUFF 0x18a0 | |
%define REL_NSG 0x14a0 | |
%macro xcall 1 | |
db 0xe8 | |
dd %1 - (REL_LOC + $ - $$ + 4) | |
%endmacro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_start: | |
; greet user | |
mov edx, msg1end - msg1 ; arg2: message length | |
mov ecx, msg1 ; arg1: message | |
mov ebx, 1 ; arg0: stdout | |
mov eax, SYS_WRITE | |
int 0x80 | |
; read in the input, expect "XXXXXXXX-XXXXXXXX" | |
mov edi, inbuf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TERMINAL_INPUT = 0 | |
TERMINAL_OUTPUT = 1 | |
DOOR_CONTROL = 2 | |
main: | |
.correct_pin = 0 | |
.main_loop: | |
call ask_and_verify_code | |
test al, al |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TERMINAL_INPUT = 0 | |
TERMINAL_OUTPUT = 1 | |
DOOR_CONTROL = 2 | |
main: | |
.correct_pin = 0 | |
.main_loop: | |
call ask_and_verify_code | |
test al, al |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Welcome to CSAW! And, presumably, welcome to reverse engineering. | |
; This challenge is for N3WbS ONLY, so if you know what you're doing, then put one of your freshmen on this challenge..if you don't have any freshmen, then you need to recruit harder - for now just go steal one. Come back when you're ready with some fresh blood, or go work on some harder challenges! | |
; Rule # ONE : | |
; Since this problem is designed to introduce newbies to reverse engineering, I've designed this source document such that you can hopefully read it straight down and come to a reasonable understanding of this nonsense... | |
; Reverse engineering is the dissection and understanding of SYSTEMS, not of CODE.. As such, you won't need to read and understand every single line so long as you can understand what is general occurring and build a working intuition of what the system is doing. | |
; For example, if you see a call to `print("input: ")` then a call to `password = inputPassword()`, I would sincerely hope that you could deduce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%include "nasmx.inc" | |
ENTRY main | |
IMPORT fgets | |
IMPORT printf | |
IMPORT puts | |
IMPORT atoi | |
EXTERN stdin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%include "nasmx.inc" | |
ENTRY main | |
IMPORT fgets | |
IMPORT printf | |
IMPORT puts | |
IMPORT atoi | |
EXTERN stdin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JFLAGS= | |
JCFLAGS= | |
include config.mk | |
# Some private variables | |
MAINCLASS=$(join $(NAMEPREF), $(PROJ)) | |
DATAFILE=$(join $(PROJ), data) | |
.PHONY: all test clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; https://tinyurl.com/hello-in-asm | |
; | |
; Requires nasmx | |
; Linux: | |
; nasm -f elf64 hello.asm && gcc -o hello.o -o hello && ./hello | |
; Windows: (requires mingw) | |
; nasm -f win32 hello.asm && gcc -o hello.obj -o hello.exe && ./hello.exe | |
%include "nasmx.inc" |