Skip to content

Instantly share code, notes, and snippets.

Avatar

Brendan Dolan-Gavitt moyix

View GitHub Profile
@moyix
moyix / favhelp.txt
Created Dec 30, 2021
moyix's favorite TeX '82 help messages
View favhelp.txt
I'm broken. Please show this to someone who can fix can fix
--
I dddon't go any higher than filll.
--
Things are pretty mixed up, but I think the worst is over.
--
Sorry, I don't know how to help in this situation.
Maybe you should try asking a human?
--
If you really absolutely need more capacity,
@moyix
moyix / tex82_help.web
Created Dec 30, 2021
help() messages from TeX82
View tex82_help.web
print_err("Emergency stop"); help1(s); succumb;
--
help1("I'm broken. Please show this to someone who can fix can fix");
--
help1("The magnification ratio must be between 1 and 32768.");
--
help1("I'm forgetting what you said and using zero for this \the.");
--
help1("I'm forgetting what you said and using zero for this \the.");
--
@moyix
moyix / emojiauthor.tex
Created Dec 13, 2021
Example of using emoji for author marks in IEEETran
View emojiauthor.tex
% This is for IEEEtran but should give an idea of how to do it for other styles
% Preamble
\usepackage{emoji}
% [...]
% This is the main piece; we just redefine the IEEEauthorrefmark command and
% replace the symbols. We have to remove the \ensuremath{} because emoji don't
% seem to work in math mode. You can of course replace these emoji with any of
% the ones defined by the emoji package:
View decrypt_dcn.py
#!/usr/bin/env python3
import os
import sys
import hashlib
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
SHA384_SIZE=48
if len(sys.argv) != 4:
View copilot_parse_elf_v2.py
#!/usr/bin/env python3
import sys
import struct
from pprint import pprint
# Parser for ELF executables
def parse_elf_header(f):
# Parse ELF header
View copilot_parse_elf.py
#!/usr/bin/env python3
import sys
import struct
from pprint import pprint
# Parser for ELF executables
def parse_elf_header(f):
# Parse ELF header
@moyix
moyix / gist:d675c84dca9eb0cf031a755e0e9a9f4f
Last active Nov 4, 2021
Tiny script to convert my .bib to Markdown
View gist:d675c84dca9eb0cf031a755e0e9a9f4f
#!/usr/bin/env python
import sys
import bibtexparser
from bibtexparser.bparser import BibTexParser
from bibtexparser.customization import *
def comma_separator(sequence):
if not sequence:
return ''
View probs.t1_lib.txt
-1.541954 | /* ssl/t1_lib.c */
-0.001411 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
-0.000049 | * All rights reserved.
-0.000127 | *
-0.000071 | * This package is an SSL implementation written
-0.000021 | * by Eric Young (eay@cryptsoft.com).
-0.000132 | * The implementation was written so as to conform with Netscapes SSL.
-0.168987 | *
-0.000021 | * This library is free for commercial and non-commercial use as long as
-0.000075 | * the following conditions are aheared to. The following conditions
@moyix
moyix / heartbleed_probabilities.txt
Created Sep 19, 2021
Log probabilities assigned by the OpenAI Codex model to each line of the function containing Heartbleed
View heartbleed_probabilities.txt
-0.471773 | #ifndef OPENSSL_NO_HEARTBEATS
-3.596041 | int
-0.389579 | tls1_process_heartbeat(SSL *s)
-0.135248 | {
-0.778353 | unsigned char *p = &s->s3->rrec.data[0], *pl;
-0.588106 | unsigned short hbtype;
-0.750892 | unsigned int payload;
-0.836333 | unsigned int padding = 16; /* Use minimum padding */
- |
-1.023496 | /* Read type and payload length first */
View copilot_search.cu
/* License:
* Public domain.
*/
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>