Skip to content

Instantly share code, notes, and snippets.

View x1unix's full-sized avatar
:shipit:
Work in progress

Denys Sedchenko x1unix

:shipit:
Work in progress
View GitHub Profile
@x1unix
x1unix / batch_iterator.go
Created January 10, 2020 18:13
Go - Batch Iterator
package util
type IteratorCallback = func(start int, v []interface{}) error
type BatchIterator struct {
batchSize int
}
func NewBatchIterator(batchSize uint) BatchIterator {
return BatchIterator{

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main
; Infinite loop (e9 fd ff)
jmp start
message db 'Hello yoba' ; 10 bytes
start:
mov ah, 0x0e ; tty mode
mov cx, 0
mov bx, message
@x1unix
x1unix / main.go
Created September 13, 2019 11:43
Go - RegNotifyChangeKeyValue
package main
import (
"context"
"fmt"
"os"
"os/signal"
"sync"
"syscall"
@x1unix
x1unix / main.go
Created September 9, 2019 15:25
unsafe
package main
import (
"fmt"
"unsafe"
)
func main() {
var mem [16*32]byte
@x1unix
x1unix / client.go
Created August 2, 2019 09:51 — forked from elico/client.go
golang tcp client connection alive check
package main
import (
"fmt"
"io"
"net"
"time"
)
func main() {
@x1unix
x1unix / surface.go
Created May 19, 2019 19:45
surface
package main
import "fmt"
type vec3 [3]byte
type vec2 [2]uint
func rgb(r, g, b byte) vec3 {
return vec3{r, g, b}
}
@x1unix
x1unix / arr_eq_and_neq.js
Last active March 21, 2019 12:26
Mongo Notes
db.getCollection('businessObjects').find({
'fields': {
'$all': [
{'$elemMatch': { name: 'IncidentID', value: {'$ne': '12'} } },
{'$elemMatch': {fieldId: '252b836fc72c4149915053ca1131d138', value: '123123'}},
]
}
})
@x1unix
x1unix / file.sh
Created February 12, 2019 14:41
Git - Delete all branches except master
git branch | grep -v "master" | xargs git branch -D
@x1unix
x1unix / pool.go
Created November 16, 2018 00:58
Go Worker pool
package worker
import (
"fmt"
"github.com/go-errors/errors"
"io"
"os"
"sync"
"time"
)