Skip to content

Instantly share code, notes, and snippets.


Mohd Shahril shahril96

View GitHub Profile
icecr4ck /
Last active Jun 30, 2022
Cheatsheet for IDAPython
View apollo.txt
This bug was also called moonshine in the beginning
Basically the following bug is present in all bootroms I have looked at:
1. When usb is started to get an image over dfu, dfu registers an interface to handle all the commands and allocates a buffer for input and output
2. if you send data to dfu the setup packet is handled by the main code which then calls out to the interface code
3. the interface code verifies that wLength is shorter than the input output buffer length and if that's the case it updates a pointer passed as an argument with a pointer to the input output buffer
4. it then returns wLength which is the length it wants to recieve into the buffer
5. the usb main code then updates a global var with the length and gets ready to recieve the data packages
6. if a data package is recieved it gets written to the input output buffer via the pointer which was passed as an argument and another global variable is used to keep track of how many bytes were recieved already
7. if all the data was recieved th
billti /
Last active Jun 27, 2022
ARM64 Linux on Win10

Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.

Install QEMU

Install for Windows from (I used qemu-w64-setup-20181211.exe)

Put C:\Program Files\qemu on your PATH, and run the below to check it's working (which will list out the CPUs the AArch64 emulator can emulate):

qemu-system-aarch64 -M virt -cpu help
L0SG /
Last active Apr 24, 2022
PyTorch example: freezing a part of the net (including fine-tuning)
import torch
from torch import nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.optim as optim
# toy feed-forward net
class Net(nn.Module):
def __init__(self):
mokhdzanifaeq /
Last active Apr 21, 2017
extract data embeded in pixel channels
from PIL import Image
import argparse
from collections import OrderedDict
def parseMask(string):
mask = []
for val in string.split(","):
if "-" in val:
min, max = val.split("-")
mask += [1 << (i - 1) for i in range(int(min), int(max) + 1)]
View darktheme_modded.ini
fntlnz /
Last active Jun 28, 2022
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
MightyPork / usb_hid_keys.h
Last active Jun 12, 2022
USB HID Keyboard scan codes
View usb_hid_keys.h
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
* Created by MightyPork, 2016
* Public domain
* Adapted from:

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

Nerten / gist:399257dba4c36393c063
Last active Jun 2, 2017
Aria2c + webui-aria2 to Ubuntu on Odroid-C1
View gist:399257dba4c36393c063
sudo apt-get install -y aria2
sudo mkdir /etc/aria2
sudo touch /etc/aria2/aria2.session
sudo bash -c "cat <<EOT > /etc/aria2/aria2.conf