|
zen_reg_to_string(op.reg2), |
// Now decode the remainder as necessary.
putstr("\t%-*s\t%s, %s, ",
kMnemonicWidth,
mnemonic,
zen_reg_to_string(op.reg2),
zen_reg_to_string(op.reg1));
@sirdarckcat
In dump_reg_op if both op.reg1 and op.reg2 are a differentreg[0-x] constants, i.e. "reg2" "reg4", the printed register is wrong because zen_reg_to_string uses the same static char[] buffer to create a formatted return string at runtime. The function zen_reg_to_string, is called twice before the return value is used in the putstr
Suggesting a change to split it into two separate separate putstr(...,zen_reg_to_string(...)) calls.
// Now decode the remainder as necessary.seq
putstr("\t%-*s\t%s, ",
kMnemonicWidth,
mnemonic,
zen_reg_to_string(op.reg2));
putstr("%s, ", zen_reg_to_string(op.reg1));
This also changes the expected output for /test/mcop.sh in the mcop 382E9C1110E00000 case from
adc reg2, reg2, reg7
to
adc reg2, reg4, reg7
security-research/pocs/cpus/entrysign/zentool/disas.c
Line 105 in f102f0b
@sirdarckcat
In
dump_reg_opif bothop.reg1andop.reg2are a differentreg[0-x]constants, i.e."reg2""reg4", the printed register is wrong becausezen_reg_to_stringuses the same static char[] buffer to create a formatted return string at runtime. The functionzen_reg_to_string, is called twice before the return value is used in theputstrSuggesting a change to split it into two separate separate
putstr(...,zen_reg_to_string(...))calls.This also changes the expected output for
/test/mcop.shin themcop 382E9C1110E00000case fromadc reg2, reg2, reg7to
adc reg2, reg4, reg7