mirror of
https://github.com/Atmosphere-NX/Atmosphere
synced 2024-11-10 07:06:34 +00:00
b7a370b156
subrepo: subdir: "emummc" merged: "e72e8f1c" upstream: origin: "https://github.com/m4xw/emuMMC" branch: "develop" commit: "e72e8f1c" git-subrepo: version: "0.4.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "5d6aba9"
36 lines
1.1 KiB
AutoIt
36 lines
1.1 KiB
AutoIt
ParseClipboard()
|
|
|
|
Func FormatLineData($sLineData)
|
|
Local $lineData = StringReplace($sLineData, @TAB, " ")
|
|
Local $isADRP = false
|
|
$lineData = StringReplace($lineData, "Up o sub_71000" , "0x")
|
|
$isADRP = StringInStr($lineData, "ADRP")
|
|
|
|
Local $targetRegister = StringSplit(StringSplit($lineData, "X")[2], ",")[1]
|
|
$lineData = StringSplit($lineData, " ")[1]
|
|
$lineDataAddr = StringSplit($lineData, "+")[1]
|
|
$lineDataAddition = StringSplit($lineData, "+")[2]
|
|
|
|
$lineDataAddr = StringReplace($lineDataAddr, "0x" , "")
|
|
$lineDataAddition = StringReplace($lineDataAddition, "0x" , "")
|
|
|
|
If $isADRP Then
|
|
$lineData = "0x" & Hex(Dec($lineDataAddr) + Dec($lineDataAddition))
|
|
Else
|
|
Return ""
|
|
EndIf
|
|
|
|
Return "{.opcode_reg = " & $targetRegister & ", .adrp_offset = " & $lineData & "}, \" & @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])
|
|
;ConsoleWrite($lineData)
|
|
$oData = $oData & $lineData
|
|
Next
|
|
ClipPut($oData)
|
|
EndFunc
|