Skip to content

Instantly share code, notes, and snippets.

View seisvelas's full-sized avatar
🦊
const sh = network.pop(shell); sh.write({recipient:'admin'}, 'nice system!');

Xandre V seisvelas

🦊
const sh = network.pop(shell); sh.write({recipient:'admin'}, 'nice system!');
View GitHub Profile
@seisvelas
seisvelas / poem.js
Created November 7, 2018 04:03
A symptom of studying Node.js
try { 2; console; 'myself'; }
catch (myself) { falling.asleep(instead) }
var ious = times = (wondering) => {
if (this.strange_dream(ends) &
"I'll wake up".and)
return home; }
hc027@HC027:~$ nc -l -p 0 >> server.log &
[3] 13060
hc027@HC027:~$ netstat -ltnp | grep nc # do rest in separate shell window
tcp 0 0 0.0.0.0:34033 0.0.0.0:* LISTEN 13060/nc
hc027@HC027:~$ nc localhost 34033
Test Alexis hypothesis
^C
hc027@HC027:~$ cat server.log
@seisvelas
seisvelas / first.s
Created November 24, 2018 02:11
My first asm!
.section .data
.section .text
.globl _start
_start:
mov $1, %eax # this is the linux kernel command
# number (system call) for exiting
# a program
@seisvelas
seisvelas / eightqueens.py
Created November 26, 2018 21:28
This prints empty list!
queens = []
def legalize(past):
row = [0 for i in range(8)]
for p_row in range(len(past)):
for i in range(len(past[p_row])):
if past[p_row][i] == "Q":
row[i] = 1
if i - p_row >= 0:
row[i - p_row] = 1
@seisvelas
seisvelas / 8queens.py
Created November 27, 2018 22:05
Generate all solutions to the eight queens puzzle
from copy import deepcopy
# deepcopy allows us to pass
# arrays as function arguments
# by value instead of reference
# array of solutions
queens = []
# generate new row, marking unthreatened rows
# with 0 and threatened riws as 1
.section .text
.globl _start
_start:
movl $5, %edi # number of fibnum we hunt
movl $0, %ebx # 1st fibnum
movl $1, %eax # 2nd fibnum
start_loop:
## Check if %edi is 0
## (thus meaning %ebx is nth fibnum)
@seisvelas
seisvelas / fib.s
Created November 29, 2018 22:41
Exit with status code of the nth fib number, where n is stored in %edi
.section .data
.section .text
.globl _start
_start:
movl $5, %edi # number of fibnum we hunt
movl $0, %ebx # 1st fibnum
movl $1, %eax # 2nd fibnum
start_loop:
## Check if %edi is 0
@seisvelas
seisvelas / fib.c
Last active December 10, 2018 20:13
Learnin' C
#include <stdlib.h>
int main(void) {
int edi = 5; // nth fib num
int ebx = 0;
int eax = 1;
int edx; // tmp
start_loop:
--edi;
@seisvelas
seisvelas / readelf.output
Created November 30, 2018 02:25
Output of readelf -a love_asm
hc015@HC015:~$ readelf -e love_asm
ELF Header:
Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
Class: ELF64
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: Advanced Micro Devices X86-64
@seisvelas
seisvelas / EIP_play_fib.s
Last active December 3, 2018 23:59
fib.s implemented with hacky EIP loop instead of normal label
.section .data
.section .text
.globl _start
_start:
movl $10, %edi # number of fibnum we hunt
movl $0, %ebx # 1st fibnum
movl $1, %esi
call _saveIP
_saveIP: