From f46a4e82832f8a33f3c90df46ab76f75ad139f4b Mon Sep 17 00:00:00 2001 From: CrafterPika Date: Fri, 3 Jul 2026 01:38:36 +0200 Subject: [PATCH 1/2] a little bit of cleanup --- Func.cs | 44 ++++++++++++++++++-------------------------- SaveEditor.cs | 35 +++++++++++++++++++++-------------- httpMenu.cs | 18 +++++++++--------- 3 files changed, 48 insertions(+), 49 deletions(-) diff --git a/Func.cs b/Func.cs index 5c76a66..75765ad 100644 --- a/Func.cs +++ b/Func.cs @@ -202,34 +202,26 @@ namespace Func { } - public static string EquippedHeadgear() { + public static string EquippedGear(string slot) { try { var p_SaveDataMgr = Program.readUInt32((uint)(Program.readUInt32(SaveEditor.SAVEDATAMGR_ROOT_PTR) + 0xC)); - return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x188))}"; - } catch { - return "Game not fully loaded yet..."; - } - } - public static string EquippedClothes() { - try { - var p_SaveDataMgr = Program.readUInt32((uint)(Program.readUInt32(SaveEditor.SAVEDATAMGR_ROOT_PTR) + 0xC)); - return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x180))}"; - } catch { - return "Game not fully loaded yet..."; - } - } - public static string EquippedShoes() { - try { - var p_SaveDataMgr = Program.readUInt32((uint)(Program.readUInt32(SaveEditor.SAVEDATAMGR_ROOT_PTR) + 0xC)); - return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x184))}"; - } catch { - return "Game not fully loaded yet..."; - } - } - public static string EquippedWep() { - try { - var p_SaveDataMgr = Program.readUInt32((uint)(Program.readUInt32(SaveEditor.SAVEDATAMGR_ROOT_PTR) + 0xC)); - return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x18C))}"; + switch (slot.ToLower()) { + case "headgear": + return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x188))}"; + + case "clothes": + return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x180))}"; + + case "shoes": + return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x184))}"; + + case "weapon": + return $"{Program.readUInt32((uint)(p_SaveDataMgr + 0x18C))}"; + + default: + return ""; + } + } catch { return "Game not fully loaded yet..."; } diff --git a/SaveEditor.cs b/SaveEditor.cs index ca89462..831b8f1 100644 --- a/SaveEditor.cs +++ b/SaveEditor.cs @@ -153,21 +153,28 @@ namespace ModMenu { Program.writeUInt32((uint)(p_save_start + 0xA5B4), amount); } - public static void ChangeEquippedHeadgear(uint WeaponSetID) { + public static void ChangeEquippedGear(uint id, string slot) { var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC)); - Program.writeUInt32((uint)(p_save_start + 0x188), WeaponSetID); - } - public static void ChangeEquippedClothes(uint ClothesID) { - var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC)); - Program.writeUInt32((uint)(p_save_start + 0x180), ClothesID); - } - public static void ChangeEquippedShoes(uint ShoesID) { - var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC)); - Program.writeUInt32((uint)(p_save_start + 0x184), ShoesID); - } - public static void ChangeEquippedWeapon(uint WeaponSetID) { - var p_save_start = Program.readUInt32((uint)(Program.readUInt32(SAVEDATAMGR_ROOT_PTR) + 0xC)); - Program.writeUInt32((uint)(p_save_start + 0x18C), WeaponSetID); + switch (slot.ToLower()) { + case "headgear": + Program.writeUInt32((uint)(p_save_start + 0x188), id); + return; + + case "clothes": + Program.writeUInt32((uint)(p_save_start + 0x180), id); + return; + + case "shoes": + Program.writeUInt32((uint)(p_save_start + 0x184), id); + return; + + case "weapon": + Program.writeUInt32((uint)(p_save_start + 0x18C), id); + return; + + default: + return; + } } private static T ByteArrayToStructure(byte[] bytes) where T : struct { diff --git a/httpMenu.cs b/httpMenu.cs index adb4944..e66800b 100644 --- a/httpMenu.cs +++ b/httpMenu.cs @@ -50,16 +50,16 @@ namespace ModMenu { SplatTelemetry.SendTelemetry(); }); static WorkThread HeadgearChangeThread = new WorkThread(() => { - SaveEditor.ChangeEquippedHeadgear(HeadgearID); + SaveEditor.ChangeEquippedGear(HeadgearID, "headgear"); }); static WorkThread ClothesChangeThread = new WorkThread(() => { - SaveEditor.ChangeEquippedClothes(ClothesID); + SaveEditor.ChangeEquippedGear(ClothesID, "clothes"); }); static WorkThread ShoesChangeThread = new WorkThread(() => { - SaveEditor.ChangeEquippedShoes(ShoesID); + SaveEditor.ChangeEquippedGear(ShoesID, "shoes"); }); static WorkThread WeaponChangeThread = new WorkThread(() => { - SaveEditor.ChangeEquippedWeapon(WeaponSetID); + SaveEditor.ChangeEquippedGear(WeaponSetID, "weapon"); }); public static string RunCode(ModMenuRequest data) { @@ -67,7 +67,7 @@ namespace ModMenu { switch (data.action) { case "cbase": - return $"Cemu Base: 0x{Program.cbase:X} (0x{Program.cbaseCorrected:X})

Total Wins: {Codes.TotalWins()}
Total Losses: {Codes.TotalLoss()}
Equipped Headgear: {Codes.EquippedHeadgear()}
Equipped Clothes: {Codes.EquippedClothes()}
Equipped Shoes: {Codes.EquippedShoes()}
Equipped Weapon: {Codes.EquippedWep()}

Thread Status:
- Write Gear: {WriteGear.Status.ToString()}
- Telemetry: {TelemetryThread.Status.ToString()}
- Change Gender: {ChangeGender.Status.ToString()}
- Change Level: {ChangeLevel.Status.ToString()}
- Change Cash: {ChangeCash.Status.ToString()}
- Change Sea Snails: {ChangeSeaSnails.Status.ToString()}
- Change Headgear: {HeadgearChangeThread.Status.ToString()}
- Change Clothes: {ClothesChangeThread.Status.ToString()}
- Change Shoes: {ShoesChangeThread.Status.ToString()}
- Change Weapon: {WeaponChangeThread.Status.ToString()}"; + return $"Cemu Base: 0x{Program.cbase:X} (0x{Program.cbaseCorrected:X})

Total Wins: {Codes.TotalWins()}
Total Losses: {Codes.TotalLoss()}
Equipped Headgear: {Codes.EquippedGear("headgear")}
Equipped Clothes: {Codes.EquippedGear("clothes")}
Equipped Shoes: {Codes.EquippedGear("shoes")}
Equipped Weapon: {Codes.EquippedGear("weapon")}

Thread Status:
- Write Gear: {WriteGear.Status.ToString()}
- Telemetry: {TelemetryThread.Status.ToString()}
- Change Gender: {ChangeGender.Status.ToString()}
- Change Level: {ChangeLevel.Status.ToString()}
- Change Cash: {ChangeCash.Status.ToString()}
- Change Sea Snails: {ChangeSeaSnails.Status.ToString()}
- Change Headgear: {HeadgearChangeThread.Status.ToString()}
- Change Clothes: {ClothesChangeThread.Status.ToString()}
- Change Shoes: {ShoesChangeThread.Status.ToString()}
- Change Weapon: {WeaponChangeThread.Status.ToString()}"; case "sessiondata": return Codes.GetSessionData(); @@ -184,10 +184,10 @@ namespace ModMenu { return "1"; case "AllEquipment": - string headgearID = Codes.EquippedHeadgear(); - string clothesID = Codes.EquippedClothes(); - string shoesID = Codes.EquippedShoes(); - string weaponId = Codes.EquippedWep(); + string headgearID = Codes.EquippedGear("headgear"); + string clothesID = Codes.EquippedGear("clothes"); + string shoesID = Codes.EquippedGear("shoes"); + string weaponId = Codes.EquippedGear("weapon"); return $"{{\"EquippedHeadgearId\": \"{headgearID}\", \"EquippedClothesId\": \"{clothesID}\", \"EquippedShoesId\": \"{shoesID}\", \"EquippedWepId\": \"{weaponId}\"}}"; default: From 6345e3373fec71d0574f24fa879e041d29526d96 Mon Sep 17 00:00:00 2001 From: CrafterPika Date: Sat, 8 Aug 2026 08:37:46 +0200 Subject: [PATCH 2/2] update spfn api to new domain --- Func.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Func.cs b/Func.cs index 75765ad..6011855 100644 --- a/Func.cs +++ b/Func.cs @@ -50,7 +50,7 @@ namespace Func { return "0"; } } else { - HttpResponseMessage response = await client.GetAsync($"https://account.spfn.net/v1/api/admin/mapped_ids?input_type=pid&output_type=user_id&input={pid}"); + HttpResponseMessage response = await client.GetAsync($"https://account.spbr.net/v1/api/admin/mapped_ids?input_type=pid&output_type=user_id&input={pid}"); if (response.IsSuccessStatusCode) { string content = await response.Content.ReadAsStringAsync(); XDocument doc = XDocument.Parse(content);