Skip to content

Instantly share code, notes, and snippets.

View cmarshall108's full-sized avatar

Caleb Marshall cmarshall108

View GitHub Profile
@cmarshall108
cmarshall108 / test.cpp
Created August 26, 2019 00:57
Panda3D cling main module demo C++
// ensure the cling environment is present
#ifndef __CLING__
#error Must be using cling in order to build the cling Panda3D main function wrapper!
#endif
// edit the library path according to where your Panda3D installation is located:
#pragma cling add_library_path("/Developer/Panda3D/lib")
// libpanda libs:
#pragma cling load("libpanda")
@cmarshall108
cmarshall108 / interpreter.py
Created August 12, 2019 03:41
A dead simple assembly language-like Interpreter written in Python utilizing the Python tokenize module
"""
NOTE: This is a dead simple interpreter written in Python, it's syntax is based on assembly language,
it is for educational purposes only and was not written to be a full fledged
interpreted language to any capacity... Enjoy :D
Below is the test file named "test.asm", to run the interpreter use the following command:
```
python interpreter.py test.asm
python3 interpreter.py test.asm
```
"""
Example of compressed hashes, intended to make blake2 ASIC resistant
using CPU based compression algorithms such as, ZLIB, LZMA etc...
"""
import os
import hashlib
import zlib
import time
@cmarshall108
cmarshall108 / txpool.py
Created December 10, 2018 02:06
A Blockchain-less Transaction Pool based Cryptocurrency that relays on signatures to verify authenticity (Proof of Verification), zero fees, instant transaction times, unlimited scalability.
import math
import time
import base64
import hashlib
import struct
from ecdsa import SigningKey, VerifyingKey, NIST256p
DECIMAL = math.pow(10, 6)
import binascii
class HashCipher(object):
BLOCK_SIZE = 64
HASH_SEEDS = [
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
@cmarshall108
cmarshall108 / memory.py
Created July 7, 2018 17:53
Loading Python modules from code objects dynamically into memory without the use of frozen objects in pure Python.
import sys
import os
import types
import threading
class MemoryImporterError(RuntimeError):
"""
An memory importer specific runtime error
"""
#!/usr/bin/python
"""
This Version: $Id: obj2egg.py,v 1.7 2008/05/26 17:42:53 andyp Exp $
Info: info >at< pfastergames.com
Extended from: http://panda3d.org/phpbb2/viewtopic.php?t=3378
.___..__ .___.___.___.__..__ . .
| [__)[__ [__ [__ | |[__)|\/|
| | \[___[___| |__|| \| |
obj2egg.py [n##][b][t][s] filename1.obj ...
public static void patchExe()
{
if (Hash.GetMd5HashFromFile(Directory.GetCurrentDirectory() + "\\WAR.exe") == "8fc62753982d50cf6a6b73025adf98fb")
return;
using (Stream stream = new FileStream(Directory.GetCurrentDirectory() + "\\WAR.exe", FileMode.OpenOrCreate))
{
int i1 = 5603265;
stream.Seek((long)i1, SeekOrigin.Begin);
stream.WriteByte(1);
byte[] bArr1 = new byte[] { 144, 144, 144, 144, 87, 139, 248, 235, 50 };