Skip to content

Instantly share code, notes, and snippets.

@nasingfaund
nasingfaund / disassemble.md
Created January 7, 2024 21:13 — forked from jarun/disassemble.md
Guide to disassemble

prerequisites

  • Compile the program in gcc with debug symbols enabled (-g)
  • Do NOT strip the binary
  • To generate assembly code using gcc use the -S option: gcc -S hello.c

utilities

objdump

@nasingfaund
nasingfaund / cutcopypaste.py
Created September 21, 2023 18:38 — forked from angeloped/cutcopypaste.py
A simple Tkinter Cut, Copy, and Paste contextmenu for Entry widgets.
import Tkinter
def make_textmenu(root):
global the_menu
the_menu = Tkinter.Menu(root, tearoff=0)
the_menu.add_command(label="Cut")
the_menu.add_command(label="Copy")
the_menu.add_command(label="Paste")
the_menu.add_separator()
the_menu.add_command(label="Select all")
@nasingfaund
nasingfaund / guide-to-x86_64.txt
Created August 1, 2023 18:47 — forked from jrelo/guide-to-x86_64.txt
x86_64 assembly guide
x86-64 (also known as just x64 and/or AMD64) is the 64-bit version of the x86/IA32 instruction set. Below is our overview of its features that are relevant to CS107. There is more extensive coverage on these topics in Chapter 3 of the B&O textbook. See also our x86-64 sheet for a compact one-page reference.
Registers
The table below lists the commonly used registers (sixteen general-purpose plus two special). Each register is 64 bits wide; the lower 32-, 16- and 8-bit portions are selectable by a pseudo-register name. Some registers are designated for a certain purpose, such as %rsp being used as the stack pointer or %rax for the return value from a function. Other registers are all-purpose, but have a conventional use depending on whether caller-saved or callee-saved. If the function binky calls winky, we refer to binky as the caller and winky as the callee. For example, the registers used for the first 6 arguments and return value are all caller-saved. The callee can freely use those registers, overwriting
@nasingfaund
nasingfaund / mmx-sim.html
Created June 7, 2023 18:18 — forked from Alikberov/mmx-sim.html
MMX-Instructions Simulator
<html>
<head>
<meta http-equiv=refresh content='3600'>
<title>It's Koyaanisqatsi, baby!</title>
<!-----------------------------------------------------------------------------
BigInt.prototype.PADD = function(n, mask) {
return (((this & mask) + (n & mask))) ^ ((this ^ n) & ~mask);
}
BigInt.prototype.PADD = function(n, mask) {
var m = BigInt(this);
@nasingfaund
nasingfaund / scraper-github-trending.py
Created April 30, 2023 12:02 — forked from Bilguun132/scraper-github-trending.py
python-scraping-tutorial-github-trending_3
@nasingfaund
nasingfaund / xml_split.py
Created April 13, 2023 15:10 — forked from benallard/xml_split.py
Small python script to split huge XML files into parts. It takes one or two parameters. The first is always the huge XML file, and the second the size of the wished chunks in Kb (default to 1Mb) (0 spilt wherever possible) The generated files are called like the original one with an index between the filename and the extension like that: bigxml.…
#!/usr/bin/env python
import os
import xml.parsers.expat
from xml.sax.saxutils import escape
from optparse import OptionParser
from math import log10
# How much data we process at a time
@nasingfaund
nasingfaund / XML_breaker.py
Created April 6, 2023 13:53 — forked from nicwolff/XML_breaker.py
Python script to break large XML files
import os
import sys
from xml.sax import parse
from xml.sax.saxutils import XMLGenerator
class CycleFile(object):
def __init__(self, filename):
self.basename, self.ext = os.path.splitext(filename)
self.index = 0
@nasingfaund
nasingfaund / shrink_xml_texts.py
Created April 5, 2023 19:37 — forked from p-jahn/shrink_xml_texts.py
reduce text content length in an xml file with a streaming reader
from xml.sax.saxutils import XMLGenerator
from defusedxml.sax import make_parser
from io import BytesIO
class XmlTextShrinker(XMLGenerator):
"""
An extended xml.sax.saxutils.XMLGenerator
"""
@nasingfaund
nasingfaund / windows_privesc
Created April 4, 2023 20:25 — forked from sckalath/windows_privesc
Windows Privilege Escalation
// What system are we connected to?
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
// Get the hostname and username (if available)
hostname
echo %username%
// Get users
net users
net user [username]
@nasingfaund
nasingfaund / tktest.py
Created March 31, 2023 12:39 — forked from dsh0005/tktest.py
Tkinter background threading example
#!/usr/bin/env python3
# encoding=utf-8
# vim: set nobomb:
from tkinter import *
from threading import Thread, Lock, Event
from queue import SimpleQueue
from time import sleep
from typing import List
import random