Skip to content

Instantly share code, notes, and snippets.

View famasoon's full-sized avatar
🎯
Focusing

Ryota Sakai famasoon

🎯
Focusing
View GitHub Profile
# coding: utf-8
from pwn import *
# Set target environment
context(os='linux', arch='i386')
HOST = 'chall.pwnable.tw'
PORT = 10000
# mov ecx, esp & write systemcall gadget address
GitHub: https://github.com/famasoon
Gist: https://gist.github.com/famasoon
Blog 1: https://famasoon.hatenablog.com/
Blog 2: https://medium.com/@FAMASoon
Blog 3: https://gyoza.in/
Twitter: https://twitter.com/FAMASoon
Qiita: https://qiita.com/FAMASoon
package twosum
func twoSum(nums []int, target int) []int {
var res []int
res = make([]int, 2)
numMap := make(map[int]int)
for i, num := range nums {
numMap[num] = i
}
package twosum
import (
"reflect"
"testing"
)
type testCase struct {
array []int
target int
@famasoon
famasoon / file0.sh
Created December 30, 2018 07:53
OpenFaas で function を自作する ref: https://qiita.com/FAMASoon/items/f9108a5a46e2fbc510e9
$ faas-cli new --lang <実装したい言語> <functionの名前>
@famasoon
famasoon / file0.sh
Created December 29, 2018 08:13
OpenFaas をセットアップして function を呼び出す ref: https://qiita.com/FAMASoon/items/bfd1d18ef695415a8d9b
$ docker swarm init
****************************mtr1.lhr15*********************************
** **
** type mpr1re0 to reach line 2002 mpr1.lhr15 Juniper MX960 RE0 **
** type mpr1re1 to reach line 2003 mpr1.lhr15 Juniper MX960 RE1 **
** **
** **
** To Exit a device type Control-Shift-6 X, then clear line **
** **
***********************************************************************
@famasoon
famasoon / Dockerfile
Created October 28, 2018 13:43
DockerとGolangでAPIサーバを立てる ref: https://qiita.com/FAMASoon/items/6c0c1410befa498bc551
FROM golang:latest
WORKDIR /go/src/godocker
COPY . .
RUN go get -d -v ./...
RUN go install -v ./...
CMD ["godocker"]
@famasoon
famasoon / file0.txt
Created October 19, 2018 13:12
retdecで"Hello, world"をデコンパイルする ref: https://qiita.com/FAMASoon/items/26d38625554b2f0ea6b1
$ uname -a
Linux ubuntu 4.15.0-36-generic #39~16.04.1-Ubuntu SMP Tue Sep 25 08:59:23 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
$ docker -v
Docker version 18.06.1-ce, build e68fc7a
DB 0xeb, 0x4e, 0x90
DB "HELLOIPL" ; ブートセクタの名前(8バイト)
DW 512 ; 1セクタの大きさ
DB 1 ; 1クラスタの大きさ
DW 1 ; FATがどこから始まるか
DB 2 ; FATの個数
DW 224 ; ルートディレクトリ領域の大きさ(普通は224エントリ)
DW 2280 ; ドライブの大きさ
DB 0xf0 ; メディアのタイプ(0xf0にしなければならに)
DW 9 ; FAT領域の長さ