Skip to content

Instantly share code, notes, and snippets.

View MayerDaniel's full-sized avatar

Daniel Mayer MayerDaniel

  • New Orleans, LA
View GitHub Profile
@MayerDaniel
MayerDaniel / edgar_cloud.py
Created December 13, 2017 18:59
Edgar Code
from pyicloud import PyiCloudService
import sys
class iCloudInterface:
def __init__(self, id, password):
self.id = id
self.password = password
self.api = ''
def login(self):
@MayerDaniel
MayerDaniel / vba_write_to_file.vba
Created January 5, 2021 00:47
VBA write to file
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
Dim oFile As Object
Set oFile = fso.CreateTextFile(".\out.txt")
oFile.WriteLine ("replaceme")
oFile.Close
@MayerDaniel
MayerDaniel / xor.py
Created January 5, 2021 00:49
python xor
#python2 or 3
def xor_two_str(a,b):
return ''.join([chr(ord(a[i%len(a)]) ^ ord(b[i%(len(b))])) for i in range(max(len(a), len(b)))])
#python3 bytes - add cycle() if the two byte strings are not the same length
def byte_xor(ba1, ba2):
return bytes([_a ^ _b for _a, _b in zip(ba1, ba2)])
@MayerDaniel
MayerDaniel / IDA_headers.md
Created January 5, 2021 00:50
How to cast MZ and PE headers in IDA

Go to libraries Shift+F11 and add the headers for the ms sdk win 10

IMAGE_DOS_HEADER for the MZ header and IMAGE_NT_HEADERS for the PE header

@MayerDaniel
MayerDaniel / ida_dec.py
Created April 28, 2021 22:46
Example LCG String Decryption Patcher
def strdec(offset, key, leng, mult=1664525, const=1013904223):
out = bytearray()
bytes_read = ida_bytes.get_bytes(offset, leng)
for i in range(len(bytes_read)):
key = mult * key + const
b1 = (bytes_read[i] ^ (key >> 12)) & 0xff
out.append(b1)
'''
background_assets.py
usage:
background_assets.py /path/or/glob/to/files/*.png
a small image manipulation script with hardcoded presets to help my wonderful
girlfriend automate asset creation for her game and teach me about PIL
@MayerDaniel
MayerDaniel / most_significant_bytes.py
Last active May 13, 2022 00:05
most significant bytes
def msb(i, n):
return int(hex(i)[2:2+(2*n)],16)
@MayerDaniel
MayerDaniel / rorrol.py
Created September 22, 2021 00:38
rol/ror
def __ROL__(num, count, bits=8):
return ((num << count) | (num >> (bits - count))) & ((0b1<<bits) - 1)
def __ROR__(num, count, bits=8):
return ((num >> count) | (num << (bits - count))) & ((0b1<<bits) - 1)
#from https://onsoim.tistory.com/entry/RORROL
@MayerDaniel
MayerDaniel / twineOrganize.js
Last active May 14, 2022 19:33
A twine script to CSV organizer for Lucy
/*
For Sugarlumps by Sugarlumps
REQUIREMENTS:
You need to have nodejs on your computer:
https://nodejs.org/en/download/
Run these commands on your computer first in the same folder as this script.
Once they are installed you never need to run them again.
npm i -s csv-writer
@MayerDaniel
MayerDaniel / ida_enums.md
Last active May 19, 2022 17:41
How to add macros as enums to IDA

copy the macros into atom, for example:

#define GET_FILE 1
#define PUT_FILE 2
#define RUNSHELL 3

Use atom and its regex find and replace to convert into a valid enum.