From 63a9c856fcd0e6c69aead75c91e43cba3a71e271 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 18 Jun 2019 11:32:03 -0700 Subject: [PATCH] git subrepo pull emummc subrepo: subdir: "emummc" merged: "44ecdb45" upstream: origin: "https://github.com/m4xw/emuMMC" branch: "develop" commit: "44ecdb45" git-subrepo: version: "0.4.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "5d6aba9" --- emummc/.gitrepo | 4 +-- emummc/source/FS/offsets/400.h | 8 ++--- emummc/source/FS/offsets/400_exfat.h | 8 ++--- emummc/source/FS/offsets/410.h | 8 ++--- .../fs_ida_nintendo_folder_xref_formatter.au3 | 34 ++++++++++++++----- 5 files changed, 39 insertions(+), 23 deletions(-) diff --git a/emummc/.gitrepo b/emummc/.gitrepo index 0fdf65396..26931dd8d 100644 --- a/emummc/.gitrepo +++ b/emummc/.gitrepo @@ -6,7 +6,7 @@ [subrepo] remote = https://github.com/m4xw/emuMMC branch = develop - commit = b9ac428bc24582aa5a2b563f800a4ac80fe65585 - parent = 0bf7df04262ea057b4cb48051cd43b4e19594d4e + commit = 44ecdb457a59d365423e7bd7e312253e87b2e176 + parent = 31fde233e177ba53e1359686f01ed4188c3a282e method = rebase cmdver = 0.4.0 diff --git a/emummc/source/FS/offsets/400.h b/emummc/source/FS/offsets/400.h index edee7cc19..360ab399a 100644 --- a/emummc/source/FS/offsets/400.h +++ b/emummc/source/FS/offsets/400.h @@ -47,10 +47,10 @@ // Nintendo Paths #define FS_OFFSET_400_NINTENDO_PATHS \ { \ - {.opcode_reg = 3, .adrp_offset = 0x0002023C, .add_rel_offset = 4}, \ - {.opcode_reg = 3, .adrp_offset = 0x00021BE8, .add_rel_offset = 4}, \ - {.opcode_reg = 3, .adrp_offset = 0x00021EC4, .add_rel_offset = 4}, \ - {.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \ + {.opcode_reg = 3, .adrp_offset = 0x0002023C, .add_rel_offset = 0x00000004}, \ + {.opcode_reg = 3, .adrp_offset = 0x00021BE8, .add_rel_offset = 0x0000000C}, \ + {.opcode_reg = 3, .adrp_offset = 0x00021EC4, .add_rel_offset = 0x0000000C}, \ + {.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \ } #endif // __FS_400_H__ diff --git a/emummc/source/FS/offsets/400_exfat.h b/emummc/source/FS/offsets/400_exfat.h index 0afe003c2..42c2dba25 100644 --- a/emummc/source/FS/offsets/400_exfat.h +++ b/emummc/source/FS/offsets/400_exfat.h @@ -47,10 +47,10 @@ // Nintendo Paths #define FS_OFFSET_400_EXFAT_NINTENDO_PATHS \ { \ - {.opcode_reg = 3, .adrp_offset = 0x0002023C, .add_rel_offset = 4}, \ - {.opcode_reg = 3, .adrp_offset = 0x00021BE8, .add_rel_offset = 4}, \ - {.opcode_reg = 3, .adrp_offset = 0x00021EC4, .add_rel_offset = 4}, \ - {.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \ + {.opcode_reg = 3, .adrp_offset = 0x0002023C, .add_rel_offset = 0x00000004}, \ + {.opcode_reg = 3, .adrp_offset = 0x00021BE8, .add_rel_offset = 0x0000000C}, \ + {.opcode_reg = 3, .adrp_offset = 0x00021EC4, .add_rel_offset = 0x0000000C}, \ + {.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \ } #endif // __FS_400_EXFAT_H__ diff --git a/emummc/source/FS/offsets/410.h b/emummc/source/FS/offsets/410.h index 7540e8caf..4299ba944 100644 --- a/emummc/source/FS/offsets/410.h +++ b/emummc/source/FS/offsets/410.h @@ -47,10 +47,10 @@ // Nintendo Paths #define FS_OFFSET_410_NINTENDO_PATHS \ { \ - {.opcode_reg = 3, .adrp_offset = 0x0002023C, .add_rel_offset = 4}, \ - {.opcode_reg = 3, .adrp_offset = 0x00021BE8, .add_rel_offset = 12}, \ - {.opcode_reg = 3, .adrp_offset = 0x00021EC4, .add_rel_offset = 12}, \ - {.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \ + {.opcode_reg = 3, .adrp_offset = 0x0002023C, .add_rel_offset = 0x00000004}, \ + {.opcode_reg = 3, .adrp_offset = 0x00021BE8, .add_rel_offset = 0x0000000C}, \ + {.opcode_reg = 3, .adrp_offset = 0x00021EC4, .add_rel_offset = 0x0000000C}, \ + {.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \ } #endif // __FS_410_H__ diff --git a/emummc/tools/fs_ida_nintendo_folder_xref_formatter.au3 b/emummc/tools/fs_ida_nintendo_folder_xref_formatter.au3 index 6e28f869b..269ffc8ce 100644 --- a/emummc/tools/fs_ida_nintendo_folder_xref_formatter.au3 +++ b/emummc/tools/fs_ida_nintendo_folder_xref_formatter.au3 @@ -1,7 +1,8 @@ ParseClipboard() -Func FormatLineData($sLineData) +Func FormatLineData($sLineData, $sLineDataAdd) Local $lineData = StringReplace($sLineData, @TAB, " ") + Local $lineDataADRP, $lineDataADD Local $isADRP = false $lineData = StringReplace($lineData, "Up o sub_71000" , "0x") $isADRP = StringInStr($lineData, "ADRP") @@ -13,24 +14,39 @@ Func FormatLineData($sLineData) $lineDataAddr = StringReplace($lineDataAddr, "0x" , "") $lineDataAddition = StringReplace($lineDataAddition, "0x" , "") + $addrADRP = Dec($lineDataAddr) + Dec($lineDataAddition) - If $isADRP Then - $lineData = "0x" & Hex(Dec($lineDataAddr) + Dec($lineDataAddition)) - Else - Return "" - EndIf + $lineDataADRP = "0x" & Hex($addrADRP) - Return "{.opcode_reg = " & $targetRegister & ", .adrp_offset = " & $lineData & "}, \" & @LF + Local $lineDataADD = StringReplace($sLineDataAdd, @TAB, " ") + Local $isADD = false + $lineDataADD = StringReplace($lineDataADD, "Up o sub_71000" , "0x") + $isADD = StringInStr($lineData, "ADD") + + $lineDataADD = StringSplit($lineDataADD, " ")[1] + $lineDataAddAddr = StringSplit($lineDataADD, "+")[1] + $lineDataAddAddition = StringSplit($lineDataADD, "+")[2] + + $lineDataAddAddr = StringReplace($lineDataAddAddr, "0x" , "") + $lineDataAddAddition = StringReplace($lineDataAddAddition, "0x" , "") + $addrADD = Dec($lineDataAddAddr) + Dec($lineDataAddAddition) + $addrADD = $addrADD - $addrADRP + $lineDataADD = "0x" & Hex($addrADD) + + Return @TAB & "{.opcode_reg = " & $targetRegister & ", .adrp_offset = " & $lineDataADRP & ", .add_rel_offset = " & $lineDataADD & "}, \" & @LF EndFunc Func ParseClipboard() Local $sData = ClipGet() Local $oData = "" Local $sLineData = StringSplit(StringReplace($sData, @CRLF, @LF), @LF) - For $i = 2 to UBound($sLineData) - 2 - Local $lineData = FormatLineData($sLineData[$i]) + For $i = 2 to UBound($sLineData) - 2 Step 2 + Local $lineData = FormatLineData($sLineData[$i], $sLineData[$i+1]) ;ConsoleWrite($lineData) $oData = $oData & $lineData Next + + $oData = "{ \" & @LF & $oData & @TAB & "{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \" & @LF & "}" & @LF + ;ConsoleWrite($oData) ClipPut($oData) EndFunc