Skip to content

Instantly share code, notes, and snippets.

View crowell's full-sized avatar
🐢
I may be slow to respond.

Jeffrey Crowell crowell

🐢
I may be slow to respond.
  • Boston, MA
View GitHub Profile
using System;
using System.Drawing;
using SdlDotNet.Graphics;
using SdlDotNet.Core;
using SdlDotNet.Input;
using System.IO.Ports; //connection to the Arduino
using System.Text; //stringbuilder
using System.Data;
@crowell
crowell / process.C
Created October 31, 2012 18:42
Safety in the process file
#include <iostream>
#include <cstring>
#include <cstdio>
#include <string>
#include <map>
#include "getpost.h"
#include <sys/resource.h>
using namespace std;
@crowell
crowell / hw4p1a.py
Created November 14, 2012 17:43
hw4p1a
import math
N = 15241559823203705227878887673081037716739857612370054905916497747890512048310998045508373462474562762403971294892047440113259277270082256942002416995850675202397184299808987
e = 13
def mysqrt(x):
if x < 0:
raise ValueError('square root not defined for negative numbers')
n = int(x)
if n == 0:
@crowell
crowell / hw4p1b
Created November 14, 2012 17:44
hw4p1b
import math
import fractions
N = 1791144786733299256875903974696580801523488563758757235898102851290189765401005609588035532773568199
e = 3
def gcd_iter(u, v):
while v:
u, v = v, u % v
return abs(u)
@crowell
crowell / hw4p1b.py
Created November 14, 2012 17:44
hw4p1b
import math
import fractions
N = 1791144786733299256875903974696580801523488563758757235898102851290189765401005609588035532773568199
e = 3
def gcd_iter(u, v):
while v:
u, v = v, u % v
return abs(u)
@crowell
crowell / hw4p1c.py
Created November 14, 2012 17:44
hw4p1c
import math
N = 257604469245070482680978550578686065374289166183513000923532857227284294429858993942954469559591983
e = 3
d = 85868156415023494226992850192895355124763055394504333641177619075761431476619664647651489853197328
def mysqrt(x):
if x < 0:
raise ValueError('square root not defined for negative numbers')
n = int(x)
@crowell
crowell / -
Created October 14, 2015 20:47
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Attaching to process 4570
@crowell
crowell / -
Created October 14, 2015 20:50
╒ (fcn) sym.serf_bucket_create 71
│ 0x003576e0 48895c24e8 mov qword [rsp - 0x18], rbx
│ 0x003576e5 4889f3 mov rbx, rsi
│ 0x003576e8 48896c24f0 mov qword [rsp - 0x10], rbp
│ 0x003576ed 4c896424f8 mov qword [rsp - 8], r12
│ 0x003576f2 4889fd mov rbp, rdi
│ 0x003576f5 4883ec18 sub rsp, 0x18
│ 0x003576f9 4989d4 mov r12, rdx
│ 0x003576fc 4889df mov rdi, rbx
│ 0x003576ff be18000000 mov esi, 0x18
@crowell
crowell / qmi_dissector.lua
Created October 28, 2015 23:14 — forked from ivoronin/qmi_dissector.lua
Wireshark Dissector for Qualcomm MSM Interface (QMI) Protocol
--[[
Wireshark Dissector for Qualcomm MSM Interface (QMI) Protocol v0.1
Copyright (c) 2012 Ilya Voronin <ivoronin@gmail.com>
Based on Code Aurora Forum's BSD/GPL licensed code:
http://www.codeaurora.org/contribute/projects/gobi/
Short howto for using this script:
@crowell
crowell / -
Created November 19, 2015 21:32
digraph code {
graph [bgcolor=white];
node [color=lightgray, style=filled shape=box fontname="Courier" fontsize="8"];
"0x0040128e_0x0040128e" -> "0x0040128e_0x00401356" [color="blue"];
"0x0040128e_0x0040128e" [color="red", label="/ (fcn) fcn.0040128e 258\l| ; var int local_0 @ rbp-0x0\l| ; var int local_0_1 @ rbp-0x1\l| ; var int local_1 @ rbp-0x8\l| ; var int local_66 @ rbp-0x210\l| ; var int local_67 @ rbp-0x218\l| ; var int local_68 @ rbp-0x220\l| ; var int local_69 @ rbp-0x228\l| 0x0040128e clc\l| 0x00401290 xor eax, eax\l| 0x00401292 mov edi, 0x401633\l| 0x00401297 mov eax, 0\l| 0x0040129c call sym.imp.printf\l| 0x004012a1 mov rax, qword [rip + 0x200e18]\l| 0x004012a8 mov rdi, rax\l| 0x004012ab call sym.imp.fflush\l| 0x004012b0 jmp 0x401356\l", URL="fcn.0040128e/0x0040128e"]
"0x0040128e_0x00401356" -> "0x0040128e_0x004012b5" [color="green"];
"0x0040128e_0x00401356" -> "0x0040128e_0x0040137a" [color="red"];
"0x0040128e_0x00401356" [color="yellow", labe