|
@@ -1,7 +1,7 @@
|
|
|
----------------------------------------------------------------------------
|
|
----------------------------------------------------------------------------
|
|
|
-- LuaJIT x86/x64 disassembler module.
|
|
-- LuaJIT x86/x64 disassembler module.
|
|
|
--
|
|
--
|
|
|
--- Copyright (C) 2005-2023 Mike Pall. All rights reserved.
|
|
|
|
|
|
|
+-- Copyright (C) 2005-2025 Mike Pall. All rights reserved.
|
|
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
|
-- Released under the MIT license. See Copyright Notice in luajit.h
|
|
|
----------------------------------------------------------------------------
|
|
----------------------------------------------------------------------------
|
|
|
-- This is a helper module used by the LuaJIT machine code dumper module.
|
|
-- This is a helper module used by the LuaJIT machine code dumper module.
|
|
@@ -122,7 +122,7 @@ local map_opc2 = {
|
|
|
"movlhpsXrm$movhpsXrm|movshdupXrm|movhpdXrm",
|
|
"movlhpsXrm$movhpsXrm|movshdupXrm|movhpdXrm",
|
|
|
"movhpsXmr||movhpdXmr",
|
|
"movhpsXmr||movhpdXmr",
|
|
|
"$prefetcht!Bm","hintnopVm","hintnopVm","hintnopVm",
|
|
"$prefetcht!Bm","hintnopVm","hintnopVm","hintnopVm",
|
|
|
-"hintnopVm","hintnopVm","hintnopVm","hintnopVm",
|
|
|
|
|
|
|
+"hintnopVm","hintnopVm","endbr*hintnopVm","hintnopVm",
|
|
|
--2x
|
|
--2x
|
|
|
"movUmx$","movUmy$","movUxm$","movUym$","movUmz$",nil,"movUzm$",nil,
|
|
"movUmx$","movUmy$","movUxm$","movUym$","movUmz$",nil,"movUzm$",nil,
|
|
|
"movapsXrm||movapdXrm",
|
|
"movapsXrm||movapdXrm",
|
|
@@ -804,6 +804,24 @@ map_act = {
|
|
|
return dispatch(ctx, map_opcvm[ctx.mrm])
|
|
return dispatch(ctx, map_opcvm[ctx.mrm])
|
|
|
end,
|
|
end,
|
|
|
|
|
|
|
|
|
|
+ -- Special NOP for endbr64/endbr32.
|
|
|
|
|
+ endbr = function(ctx, name, pat)
|
|
|
|
|
+ if ctx.rep then
|
|
|
|
|
+ local pos = ctx.pos
|
|
|
|
|
+ local b = byte(ctx.code, pos)
|
|
|
|
|
+ local text
|
|
|
|
|
+ if b == 0xfa then text = "endbr64"
|
|
|
|
|
+ elseif b == 0xfb then text = "endbr64"
|
|
|
|
|
+ end
|
|
|
|
|
+ if text then
|
|
|
|
|
+ ctx.pos = pos + 1
|
|
|
|
|
+ ctx.rep = nil
|
|
|
|
|
+ return putop(ctx, text)
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+ return dispatch(ctx, pat)
|
|
|
|
|
+ end,
|
|
|
|
|
+
|
|
|
-- Floating point opcode dispatch.
|
|
-- Floating point opcode dispatch.
|
|
|
fp = function(ctx, name, pat)
|
|
fp = function(ctx, name, pat)
|
|
|
local mrm = getmrm(ctx); if not mrm then return incomplete(ctx) end
|
|
local mrm = getmrm(ctx); if not mrm then return incomplete(ctx) end
|