Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am canance on github.
* I am c0ry (https://keybase.io/c0ry) on keybase.
* I have a public key ASDvIZKz_ZacvXWjYtgspQvr0J8yA3w25NpavFlyExabdQo
To claim this, I am signing this object:
@canance
canance / pe_analysis.py
Created February 8, 2021 21:46
Example pefile usage in Python.
import pefile
import time
import sys
# based on examples from Learning Malware Analysis by Monnappa K A
# adapted for Python 3 by Cory Nance
if len(sys.argv) < 2:
print("%s <file>" % sys.argv[0])
@canance
canance / VirusTotal.py
Last active February 8, 2021 19:50
Example VirusTotal public API usage
import os
import sys
import requests
# https://www.geeksforgeeks.org/print-colors-python-terminal/
from colorama import Fore, Back, Style
# get VT_API key from ENV variable
# not required, you can hardcode your API key
# becareful about posting code to Github or other places
# DO NOT SHARE YOUR API KEY
import java.util.Scanner;
/**
* A Tic Tac Toe game
*/
public class TicTacToe {
/**
* Entry point for program
*
@canance
canance / cars
Created November 10, 2019 22:10
"amc ambassador dpl", "amc gremlin", "amc hornet", "amc rebel sst", "buick estate wagon (sw)", "buick skylark 320", "chevrolet chevelle malibu", "chevrolet impala", "chevrolet monte carlo", "chevy c20", "dodge challenger se", "dodge d200", "ford f250", "ford galaxie 500", "ford maverick", "ford torino", "hi 1200d", "plymouth 'cuda 340", "plymouth duster", "plymouth fury iii", "plymouth satellite", "pontiac catalina", "audi 100 ls", "bmw 2002", "peugeot 504", "saab 99e", "volkswagen 1131 deluxe sedan", "datsun pl510", "toyota corona mark ii", "amc gremlin", "amc hornet sportabout (sw)", "amc matador", "chevrolet chevelle malibu", "chevrolet impala", "chevrolet vega (sw)", "chevrolet vega 2300", "dodge monaco (sw)", "ford country squire (sw)", "ford galaxie 500", "ford mustang", "ford torino 500", "mercury capri 2000", "plymouth cricket", "plymouth fury iii", "plymouth satellite custom", "pontiac catalina brougham", "pontiac firebird", "pontiac safari (sw)", "fiat 124b", "opel 1900", "peugeot 304", "volkswagen
@canance
canance / procinfo.c
Created May 24, 2019 15:26
procinfo.c for kernel 4.1.17+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/security.h>
#include <linux/kprobes.h>
#include <linux/string.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/syscalls.h>
@canance
canance / index.html
Created February 21, 2019 20:35
Unbeatable ai tic tac toe
<table>
<tr>
<td class = "cell" id = "0"></td>
<td class = "cell" id = "1"></td>
<td class = "cell" id = "2"></td>
</tr>
<tr>
<td class = "cell" id = "3"></td>
<td class = "cell" id = "4"></td>
<td class = "cell" id = "5"></td>
import random
number = random.randint(1,9)
guess = 0
count = 0
while guess != number and guess != "exit":
guess = input("What's your guess?")