Skip to content

Instantly share code, notes, and snippets.

View sajattack's full-sized avatar

Paul Sajna sajattack

View GitHub Profile
#!/bin/bash
# Clone ROM trees for Android T
clone_android_t() {
rm -rf device/lge/${device}
rm -rf device/lge/sdm845-common
rm -rf kernel/lge/sdm845
rm -rf vendor/lge
rm -rf hardware/lg
rm -rf device/lge
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="EmanuelCN" fetch="ssh://git@github.com/EmanuelCN/" revision="T" />
<project name="EmanuelCN/android_kernel_lge_sdm845" path="kernel/lge/sdm845" remote="github" revision="T" />
<project name="EmanuelCN/android_device_lge_judyln" path="device/lge/judyln" remote="github" revision="T" />
<project name="EmanuelCN/android_device_lge_sdm845-common" path="device/lge/sdm845-common" remote="github" revision="T" />
<project name="EmanuelCN/proprietary_vendor_lge" path="vendor/lge" remote="github" revision="T" />
<project name="EmanuelCN/hardware_qcom-caf_sdm845_display" path="hardware/qcom-caf/sdm845/display" remote="github" revision="twelve" />
<project name="LineageOS/android_kernel_lge_msm8998" path="kernel/lge/msm8998" remote="github" revision="lineage-20" />
@sajattack
sajattack / Cargo.toml
Created July 11, 2022 04:21
Wavefront OBJ to raw vertices, used for importing models to PSP, very primitive
[package]
name = "obj2verts"
version = "0.1.0"
authors = ["Paul Sajna <sajattack@gmail.com>"]
edition = "2018"
[dependencies]
wavefront_obj = "8.0.0"
byteorder = "1.3.4"
[package]
name = "png2gu"
version = "0.1.0"
authors = ["Paul Sajna <sajattack@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
png = "0.16"
@sajattack
sajattack / config.toml
Created September 8, 2021 16:49
cargo config for riscv32gc std
[unstable]
build-std = ["std", "panic_abort"]
build-std-features = ["panic_immediate_abort"]
[build]
target= "riscv32gc-unknown-linux-gnu"
rustflags = [
"-C", "link-arg=-march=rv32gc",
"-C", "link-arg=-mabi=ilp32d",
"-C", "linker-flavor=gcc"
@sajattack
sajattack / main.rs
Created August 16, 2021 09:04
psp-tls-downloader
#![no_std]
#![no_main]
extern crate alloc;
use psp::sys;
use drogue_tls::blocking::*;
use drogue_network::addr::HostSocketAddr;
use drogue_network::dns::Dns;
@sajattack
sajattack / main.rs
Created August 13, 2021 07:29
tls-weather
#![no_std]
#![no_main]
extern crate alloc;
use psp::sys;
use drogue_tls::blocking::*;
use drogue_network::addr::HostSocketAddr;
use drogue_network::dns::Dns;
@sajattack
sajattack / leda-re.c
Last active February 16, 2021 08:55
Ghidra export of my PSP leda RE project
bool is_elf(int *param_1)
{
if (*param_1 != 0x464c457f) {
return false;
}
return *(short *)(param_1 + 4) == 2;
}
@sajattack
sajattack / fpu.txt
Created October 23, 2020 05:54
sceFpu library for Sony PSP mips floating point unit
0x00015a2c <sceFpuGetFCR31+0>: cfc1 v0,$31
0x00015a30 <sceFpuGetFCR31+4>: jr ra
0x00015a34 <sceFpuGetFCR31+8>: nop
0x00015a38 <sceFpuSetFCR31+0>: cfc1 v0,$31
0x00015a3c <sceFpuSetFCR31+4>: ctc1 zero,$31
0x00015a40 <sceFpuSetFCR31+8>: nop
0x00015a44 <sceFpuSetFCR31+12>: ctc1 a0,$31
0x00015a48 <sceFpuSetFCR31+16>: jr ra
0x00015a4c <sceFpuSetFCR31+20>: nop
0x00015a50 <sceFpuAbs+0>: jr ra
@sajattack
sajattack / vfpu.txt
Created October 23, 2020 05:29
sceVfpu, Sony's static library for the PSP's hardware vector unit
sceVfpuVector2SignFloat:
lwc1 f0,0x0(a1)
mtc1 zero,f1
c.lt f0,f1
nop
bc1f pos_0881A344
lui v1,0x88E
lwc1 f0,-0x4560(v1)