This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.
Install for Windows from https://qemu.weilnetz.de/w64/ (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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Colors] | |
AbstractTableViewBackgroundColor=#272822 | |
AbstractTableViewHeaderTextColor=#000000 | |
AbstractTableViewSelectionColor=#363930 | |
AbstractTableViewSeparatorColor=#555A4C | |
AbstractTableViewTextColor=#FFFFFF | |
DisassemblyAddressBackgroundColor=#XXXXXX | |
DisassemblyAddressColor=#AE81FF | |
DisassemblyAutoCommentBackgroundColor=#XXXXXX | |
DisassemblyAutoCommentColor=#CF780D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* USB HID Keyboard scan codes as per USB spec 1.11 | |
* plus some additional codes | |
* | |
* Created by MightyPork, 2016 | |
* Public domain | |
* | |
* Adapted from: | |
* https://source.android.com/devices/input/keyboard-devices.html | |
*/ |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
daemon=true | |
continue=true | |
enable-rpc=true | |
rpc-listen-port=6800 | |
rpc-listen-all=true | |
check-certificate=false |
NewerOlder