diff options
author | Michael Smith <mikesmiffy128@gmail.com> | 2024-09-08 13:35:46 +0100 |
---|---|---|
committer | Michael Smith <mikesmiffy128@gmail.com> | 2024-09-08 13:35:46 +0100 |
commit | 7051e068d3250c44a47b7ea14d911c104696b6fa (patch) | |
tree | 221d885ddac442700af4e060da5c3b6b33fa7342 /src/x86.c | |
parent | 80e90888162628949ac6826ef15bf075b2237b0d (diff) |
This fixes the mistake with the version string in the process.
Diffstat (limited to 'src/x86.c')
-rw-r--r-- | src/x86.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1,5 +1,5 @@ /* - * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com> + * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -40,7 +40,7 @@ static int mrmsib(const uchar *p, int addrlen) { case 0x80: return 1 + addrlen + sib; } } - if (addrlen == 2 && *p == 0x26) return 3; + if (addrlen == 2 && (*p & 0xC7) == 0x06) return 3; return 1; // note: include the mrm itself in the byte count } @@ -65,6 +65,7 @@ P: X86_SEG_PREFIXES(CASES) X86_OPS_1BYTE_NO(CASES) return pfxlen + 1; X86_OPS_1BYTE_I8(CASES) operandlen = 1; X86_OPS_1BYTE_IW(CASES) return pfxlen + 1 + operandlen; + X86_OPS_1BYTE_IWI(CASES) return pfxlen + 1 + addrlen; X86_OPS_1BYTE_I16(CASES) return pfxlen + 3; X86_OPS_1BYTE_MRM(CASES) return pfxlen + 1 + mrmsib(insn + 1, addrlen); X86_OPS_1BYTE_MRM_I8(CASES) operandlen = 1; |