Skip to content

Instantly share code, notes, and snippets.

{
"configurations": [
{
"name": "Xbox",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/3rdparty/nxdk/**"
],
"defines": [
"NXDK",
@LoveMHz
LoveMHz / DriveUtils.cpp
Created June 8, 2023 22:05
Extended Partition Table (LBA48v2/v3 oz_paul)
PXBOX_PARTITION_TABLE PartitionTable = NULL;
NTSTATUS DriveUtils::ReadPartitionTable() {
ANSI_STRING PartitionPath;
RtlInitAnsiString(&PartitionPath, "\\Device\\Harddisk0\\Partition0");
OBJECT_ATTRIBUTES ObjectAttributes;
InitializeObjectAttributes(&ObjectAttributes, &PartitionPath, OBJ_CASE_INSENSITIVE, NULL, NULL);
IO_STATUS_BLOCK IoStatusBlock = { 0 };
@LoveMHz
LoveMHz / scan_xbes.py
Created February 16, 2022 02:56
scan_xbes.py
#!/usr/bin/env python3
import glob
search_bytes = b'\x04\x01\x48\x00\x80\x02\xE0\x01\x01\x07\x07\x88\x04\x01\x49\x00\x80\x02\xE0\x01\x01\x07\x07\x88\x04\x01\x48\x00\xD0\x02\xE0\x01'
xbe_list = glob.glob("/home/dustin/Projects/extract-xiso-test/build/**/*.xbe", recursive=True)
print("Scanning %d XBEs" % len(xbe_list))
matches_no_table = []
matches_multiple = []
SUBSYSTEM=="usb", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02d1", MODE="660", GROUP+="plugdev", ATTR{authorized}="0"
ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02d1", DRIVER="usbhid", RUN="/bin/sh -c 'echo -n $kernel >/sys/bus/usb/drivers/usbhid/unbind'"
SYSFS{idVendor}=="045e", SYSFS{idProduct}=="02d1", MODE="0666", PROGRAM="/bin/sh -c 'echo -n $id:1.0 >/sys/bus/usb/drivers/usbhid/unbind;\
echo -n $id:1.1 >/sys/bus/usb/drivers/usbhid/unbind'"
ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02d1", OPTIONS=="ignore_device"
ACTION=="add", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02d1", ATTRS{authorized}=="1", ENV{PARID}="$id", RUN+="/bin/sh -c 'echo 0 >/sys/bus/usb/devices/$env{PARID}/authorized'"
@LoveMHz
LoveMHz / llvm-clang-alternatives.sh
Last active July 19, 2023 23:32 — forked from bhaskarvk/Setup GCC and CLANG Toolchains.md
LLVM/CLANG (vers. 6/7/8) Toolchain Setup on Ubuntu/Linux Mint
#!/usr/bin/env sh
# Remove all existing alternatives
sudo update-alternatives --remove-all llvm
sudo update-alternatives --remove-all clang
# exit on first error
set -e
# To Install llvm/clang 4.0/5.0
NXDK_DIR = $(CURDIR)/../nxdk
DXT_TITLE = force480p
SRCS = main.c
include $(NXDK_DIR)/Makefile_dxt
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 112, 113].filter(function(number) {
return !(number % 2);
})
@LoveMHz
LoveMHz / CakePHP 3 - Loading and Saving JoinData.php
Last active August 29, 2015 14:27
CakePHP 3 - Loading and Saving JoinData
<?PHP
// Controller - Loading Data
$property = $this->Properties->get($id, [
'contain' => [
'Rates'
]
]);
// Controller - Saving Data
$property = TableRegistry::get('Properties')->patchEntity($property, $request_data, [
@LoveMHz
LoveMHz / gist:51066b1ba42e01799125
Created December 26, 2014 20:34
GTA:IV SCO Script File Decoding
#include <string>
#include <windows.h>
#include <fstream>
#include <iostream>
typedef struct SCO_Header {
int Identifier;
int Code_Size;
int Global_Var_Count;
int Public_Var_Count;