Skip to content

Commit 4db8d02

Browse files
committed
DBG: show operand visibility in Zydis command
1 parent 3096f0d commit 4db8d02

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/dbg/commands/cmd-undocumented.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,26 @@ bool cbInstrZydis(int argc, char* argv[])
251251
return "write";
252252
return "???";
253253
};
254+
auto vis = [](uint8_t visibility)
255+
{
256+
switch(visibility)
257+
{
258+
case ZYDIS_OPERAND_VISIBILITY_INVALID:
259+
return "invalid";
260+
case ZYDIS_OPERAND_VISIBILITY_EXPLICIT:
261+
return "explicit";
262+
case ZYDIS_OPERAND_VISIBILITY_IMPLICIT:
263+
return "implicit";
264+
case ZYDIS_OPERAND_VISIBILITY_HIDDEN:
265+
return "hidden";
266+
default:
267+
return "???";
268+
}
269+
};
254270
for(int i = 0; i < argcount; i++)
255271
{
256272
const auto & op = instr->operands[i];
257-
dprintf("operand %d (size: %d, access: %s) \"%s\", ", i + 1, op.size, rwstr(op.action), cp.OperandText(i).c_str());
273+
dprintf("operand %d (size: %d, access: %s, visibility: %s) \"%s\", ", i + 1, op.size, rwstr(op.action), vis(op.visibility), cp.OperandText(i).c_str());
258274
switch(op.type)
259275
{
260276
case ZYDIS_OPERAND_TYPE_REGISTER:

0 commit comments

Comments
 (0)