Skip to content

Instantly share code, notes, and snippets.

View sidsenkumar11's full-sized avatar
🚩

Siddarth Senthilkumar sidsenkumar11

🚩
View GitHub Profile
@sidsenkumar11
sidsenkumar11 / README.md
Last active March 30, 2025 14:46
GDB Tutorial

GDB for the Uninitiated

Overview

You're working on a C project for CS 2200. There's 2 days left before the assignment is due and for some reason, you're getting a segmentation fault after writing your last function. You've looked over your code 23 times but you just can't figure out where the bug is! Giving up and calling it a day, you decide to go to office hours and ask a TA for help.

If it sounds like this might be you in the near future, then allow me to run through a typical scenario for what happens when you come in and ask for help. You'll sit down, wait for 30 minutes while the TAs get through the queue of students asking questions, and finally notice that it's your turn next. The TA will walk over and ask you what's up. You'll explain that your code is seg-faulting and for the life of you, you can't figure out why. So the TA will take a quick peak at your code for any obvious errors, and then ask you the following question:

Did you run it through GDB?

@sidsenkumar11
sidsenkumar11 / run.py
Created January 24, 2018 15:18
Mind Your P's and Q's Script
from Crypto.Cipher import PKCS1_OAEP
from Crypto.PublicKey import RSA
from fractions import gcd
import glob
import gmpy
# Get all file names
key_files = glob.glob("./*.key")
cipher_files = glob.glob("./*.enc")
@sidsenkumar11
sidsenkumar11 / compiling_asm.md
Created October 21, 2018 22:10 — forked from yellowbyte/compiling_asm.md
how to assemble assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc

32-bit ELF binary

how to assemble and link:

nasm -f elf32 -o <filename>.o <filename>.asm
ld -m elf_i386 -o <filename> <filename>.o

template code (hello world):

section .text
global _start
@sidsenkumar11
sidsenkumar11 / abekarplus22_state_transitions.md
Last active March 18, 2019 21:30
AbeKarplus 22 State Transitions
Rule Matched Premise State(s) New State(s)
6 s?=•; x=0; k*=[if e s1 else s2, print] s?=if e s1 else s2; x=0; k*=[print]
[true]: 2
[false]: 3
s?=if e s1 else s2; x=0; k*=[print]
s?=if e s1 else s2; x=0; k*=[print]
s?=•; x=0; k*=[while(e, s+), print]
s?=•; x=0; k*=[x=2, x=x, x=x, x=x, print]
[true]: 6
[false]: 6
s?=•; x=0; k*=[while(e, s+), print]
s?=•; x=0; k*=[x=2, x=x, x=x, x=x, print]
s?=while(e, s+); x=0; k*=[print]
s?="x=2"; x=0; k*=[x=x, x=x, x=x, print]
[true]: 4
[false]: 1
s?=while(e, s+); x=0; k*=[print]
s?="x=2"; x=0; k*=[x=x, x=x, x=x, print]
s?=•; x=0; k*=[x+=1, whileK(e, s+), print]
s?=•; x=2; k*=[x=x, x=x, x=x, print]
[true]: 6[false]: 6 s?=•; x=0; k*=[x+=1, whileK(e, s+), print] s?=•; x=2; k*=[x=x, x=x, x=x, print] s?="x+=1"; x=0; k*=[whileK(e, s+), print] s?="x=x"; x=2; k*=[x=x, x=x, print]