Skip to content

Instantly share code, notes, and snippets.

View R0rt1z2's full-sized avatar
🇪🇸
¡Hola!

Roger Ortiz R0rt1z2

🇪🇸
¡Hola!
View GitHub Profile
diff --git a/device/src/controller.cc b/device/src/controller.cc
index ce19f5c..2d9815a 100644
--- a/device/src/controller.cc
+++ b/device/src/controller.cc
@@ -196,8 +196,10 @@ static future_t* start_up(void) {
}
#endif
- ble_supported = last_features_classic_page_index >= 1 &&
- HCI_LE_HOST_SUPPORTED(features_classic[1].as_array);
#!/usr/bin/env bash
# Original sequences to search for.
ORIGINAL_SEQUENCES=('0a2450292801080a087d0a1b28010035' '48010035822240b980420491e10313aa')
# Patch sequences to replace the original sequences with.
PATCH_SEQUENCES=('0a2450292801080a087d0a1b1f2003d5' '1f2003d5822240b980420491e10313aa')
function log() {
local colors=( "\e[34m" "\033[1;33m" "\033[1;31m" "\033[1;32m" )
@R0rt1z2
R0rt1z2 / GetGhidra.ps1
Last active January 5, 2023 12:07
Automated Ghidra Installer for Windows
#
# Invoke-WebRequest https://gist.githubusercontent.com/R0rt1z2/f91883518b5d63eedc8412eebb433ce7/raw/947dedc0455b778b7fd7e8a8c5d2266d86ed5ff0/GetGhidra.ps1 | Invoke-Expression
#
$ProgressPreference = 'SilentlyContinue'
$installPath = "C:\Program Files"
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Host "[-] This script must be run as Administrator." -ForegroundColor Red
exit
@R0rt1z2
R0rt1z2 / install.ps1
Last active December 11, 2022 18:28
Parse MediaTek bootloader logs (extracted with fastboot oem dump_pllklog)
# To install (and download at the same time) the tool in your system, run the following command:
# Invoke-WebRequest https://gist.githubusercontent.com/R0rt1z2/63c556fefdacf3bc077047e7b0b3a7fa/raw/install.ps1 | Invoke-Expression
# Note that you might have to disable Windows Defender to run this script.
# The URL where the file is going to be downloaded from
$URL = "https://gist.github.com/R0rt1z2/63c556fefdacf3bc077047e7b0b3a7fa/raw/parse_log.py"
# Check if Python is installed on the system
if (Get-Command python -ErrorAction SilentlyContinue) {
# If Python is installed, print a message and the version
@R0rt1z2
R0rt1z2 / oplus-unlock.bat
Created November 27, 2022 18:25
Windows wrapper for oplus-unlock
@echo off
setlocal
chcp 65001 2>nul >nul
cd "C:\Program Files\Python*\Scripts\oplus-unlock\oplus_unlock" 2>nul >nul
if exist main.py (
python main.py %*
) else (
@R0rt1z2
R0rt1z2 / realme-ota.bat
Created November 19, 2022 10:02
Windows wrapper for realme-ota
@echo off
setlocal
chcp 65001 2>nul >nul
cd "C:\Program Files\Python*\Scripts\realme-ota\realme_ota" 2>nul >nul
if exist main.py (
python main.py %*
) else (
#
# PowerShell displays error messages regardless of whether you redirect it whatever you're executing to null.
# To prevent this from happening, disable all the output(s) by using PowerShell's default variables.
#
$ProgressPreference = 'SilentlyContinue'
$ErrorActionPreference = 'SilentlyContinue'
#
# There is no built-in function to update the (global) Windows env %PATH%. Instead, use this function to update
# the registry directly (https://stackoverflow.com/a/69239861).
original_lk=$1
modified_lk=$2
if [ ! -f "$original_lk" ] && [ ! -f "$modified_lk" ];
then
echo "[-] Invalid image(s)!"
exit 1
fi
header=$(dd if="$original_lk" bs=1 skip=8 count=2 2>/dev/null)
  1. customer_get_capture_config_by_scenario() [0x0014a000] (full diff):

    • REF: (param_1 == 8):

    patch1

  2. customer_get_capture_scenario() [0x00148408] (full diff):

    • REF: if (4 < Utils::ULog::ULogger::sDetailsLevel): patch2
    • REF: if (4 < Utils::ULog::ULogger::sDetailsLevel): patch3
@R0rt1z2
R0rt1z2 / buffer-fix.py
Created October 3, 2021 16:43
Xiaomi Buffer Fix Patcher (based on HighwayStar's ASM patch)
#
# Buffer fix for com.qti.chi.override.so.
# Original fix: https://gist.github.com/HighwayStar/3da60a36395fa992cf4afc9f01449203
#
import sys
ORIG_SEQ = b'2\xffO\xf4\xfab\x11\x99'
PTCH_SEQ = b'2\xffO\xf0\x00\x02\x11\x99'
def main():