Skip to content

Instantly share code, notes, and snippets.

View Inndy's full-sized avatar

Inndy Inndy

View GitHub Profile
#include <stdio.h>
// 1 2 3 simple math
#define x (argc / 12 % (3 * (1 + 2)) + 3 - 1 + 2 - 3)
#define y (argc / 12 / 3 / (1 + 2) + 3 - 1 + 2 - 3)
#define z x * y
int main(int argc, char *argv[])
{
return argc > 970 /* can't afford 1080 :( */ ? 0 :
@Inndy
Inndy / Tab.vue
Created April 5, 2018 16:45
Vue.js tab components
<template lang="pug">
div(v-show="activated")
slot
</template>
<script>
export default {
created () {
if (this.active) {
this.$parent.$emit('active', this)
@Inndy
Inndy / AntiBlockAdblock.user.js
Created November 3, 2017 10:19
Fuck you, I love Adblock
// ==UserScript==
// @name AntiBlockAdblock
// @namespace https://www.r3sub.com/
// @version 0.1
// @description Fuck you and I love Adblock
// @author Inndy
// @match https://*.r3sub.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
import struct
def hash(data):
trail = struct.pack("I", len(data))
v = 0x44556677
v2 = 0x94879487
for i in bytearray(data + trail):
v = ~v ^ (v * 1231) ^ ((i + 345) * 123123557) ^ (v << 7) + i
v &= 0xffffffff
return v
from pwn import *
io = remote('quiz.ais3.org', 4869)
def format(fmt):
io.sendline('1')
io.sendlineafter('What do you want to say : ', fmt)
io.recvuntil('You say : ')
return io.recvuntil('*' * 27)[:-27]

Step 1: Extract original binary file

import PIL.Image # pip install pillow

img = PIL.Image.open('en.png')
width, height = img.size

stream = ''

How to install Windows 10 on KVM-based virtualization environment

Instructions

  1. Download virtio-win.iso for KVM drivers
  2. Run qemu manually, don't relay on libvirt
qemu-system-x86_64 --enable-kvm \
 -smp 4 -m 4096 -cpu host -vga qxl \
var qs = 'https://example.com/?a=b&cc=I%20can%27t%20fix%20it&kk=box'
function parseQueryString(url)
{
var result = {};
var qstr = ('?' + url).replace(/.*\?/, ''); // get query string from url
qstr.split('&') // split by '&'
.map(item => item.split('=', 2)) // split pairs
.forEach(pair => {
@Inndy
Inndy / RecordViewController.swift
Created April 30, 2017 06:26
iOS create overlay with UIWindow
import UIKit
class RecordViewController: UIViewController {
@IBAction func closeOverlay(_ sender: Any) {
self.view.window?.resignKey()
self.view.window?.isHidden = true
}
}
#!/bin/bash
last -i | grep -o ' \([[:digit:]]\+\.\)\{3\}[[:digit:]]\+ ' | while read ip; do
geoiplookup $ip | grep -v "can't resolve" | cut -d ' ' -f 4-5
done | sort | uniq -c | sort -n