File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,9 @@ typedef struct {
8282/* Immediate Grp 1(1A), Ev, Iz */
8383#define UCM_BISTRO_X86_IMM_GRP1_EV_IZ 0x81
8484
85+ /* Immediate Grp 1(1A), Ev, Ib - 8-bit immediate */
86+ #define UCM_BISTRO_X86_IMM_GRP1_EV_IB 0x83
87+
8588/* MOV Ev,Gv */
8689#define UCM_BISTRO_X86_MOV_EV_GV 0x89
8790
@@ -156,11 +159,18 @@ ucs_status_t ucm_bistro_relocate_one(ucm_bistro_relocate_context_t *ctx)
156159 /* push reg */
157160 goto out_copy_src ;
158161 } else if ((rex == UCM_BISTRO_X86_REX_W ) &&
159- (opcode == UCM_BISTRO_X86_IMM_GRP1_EV_IZ )) {
162+ ((opcode == UCM_BISTRO_X86_IMM_GRP1_EV_IZ ) || /* sub $imm32, r/m64 */
163+ (opcode == UCM_BISTRO_X86_IMM_GRP1_EV_IB ))) { /* sub $imm8, r/m64 */
160164 modrm = * ucs_serialize_next (& ctx -> src_p , const uint8_t );
161165 if (modrm == UCM_BISTRO_X86_MODRM_SUB_SP ) {
162- /* sub $imm32, %rsp */
163- ucs_serialize_next (& ctx -> src_p , const uint32_t );
166+ if (opcode == UCM_BISTRO_X86_IMM_GRP1_EV_IB ) {
167+ /* sub $imm8, %rsp */
168+ ucs_serialize_next (& ctx -> src_p , const uint8_t );
169+ } else {
170+ /* sub $imm32, %rsp */
171+ ucs_serialize_next (& ctx -> src_p , const uint32_t );
172+ }
173+
164174 goto out_copy_src ;
165175 }
166176 } else if ((rex == UCM_BISTRO_X86_REX_W ) &&
You can’t perform that action at this time.
0 commit comments