2019-06-16 04:37:41 +00:00
|
|
|
ParseClipboard()
|
|
|
|
|
2019-06-18 18:32:03 +00:00
|
|
|
Func FormatLineData($sLineData, $sLineDataAdd)
|
2019-06-16 04:37:41 +00:00
|
|
|
Local $lineData = StringReplace($sLineData, @TAB, " ")
|
2019-06-18 18:32:03 +00:00
|
|
|
Local $lineDataADRP, $lineDataADD
|
2019-06-16 04:37:41 +00:00
|
|
|
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" , "")
|
2019-06-18 18:32:03 +00:00
|
|
|
$addrADRP = Dec($lineDataAddr) + Dec($lineDataAddition)
|
2019-06-16 04:37:41 +00:00
|
|
|
|
2019-06-18 18:32:03 +00:00
|
|
|
$lineDataADRP = "0x" & Hex($addrADRP)
|
2019-06-16 04:37:41 +00:00
|
|
|
|
2019-06-18 18:32:03 +00:00
|
|
|
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
|
2019-06-16 04:37:41 +00:00
|
|
|
EndFunc
|
|
|
|
|
|
|
|
Func ParseClipboard()
|
|
|
|
Local $sData = ClipGet()
|
|
|
|
Local $oData = ""
|
|
|
|
Local $sLineData = StringSplit(StringReplace($sData, @CRLF, @LF), @LF)
|
2019-06-18 18:32:03 +00:00
|
|
|
For $i = 2 to UBound($sLineData) - 2 Step 2
|
|
|
|
Local $lineData = FormatLineData($sLineData[$i], $sLineData[$i+1])
|
2019-06-16 04:37:41 +00:00
|
|
|
;ConsoleWrite($lineData)
|
|
|
|
$oData = $oData & $lineData
|
|
|
|
Next
|
2019-06-18 18:32:03 +00:00
|
|
|
|
|
|
|
$oData = "{ \" & @LF & $oData & @TAB & "{.opcode_reg = 0, .adrp_offset = 0, .add_rel_offset = 0}, \" & @LF & "}" & @LF
|
|
|
|
;ConsoleWrite($oData)
|
2019-06-16 04:37:41 +00:00
|
|
|
ClipPut($oData)
|
|
|
|
EndFunc
|