bsf
Closed this issue · 7 comments
brandonros commented
{
"i": 2993,
"iHex": "bb1",
"x64dbgLine": {
"rawLine": {
"Index": "00BB1",
"Address": "000000014501BC20",
"Bytes": "45:0FBCDF",
"Disassembly": "bsf r11d,r15d",
"Registers": "",
"Memory": "",
"Comments": ""
},
"rip": "14501bc20",
"registerChanges": [],
"memoryChanges": []
},
"scemuLine": {
"rawLine": {
"diffRegLine": "diff_reg: pos = 2993 rip = 14501bc20 r11 9d46c36de8c10d85 -> e8c10d85;",
"memTraceLines": [
{
"rawLine": "mem_trace: pos = 2993 rip = 14501bc1d op = write bits = 32 address = 0x14f288 value = 0xe8c199fa name = 'stack'",
"position": "bb1",
"rip": "14501bc1d",
"operation": "write",
"bits": "20",
"address": "14f288",
"value": "e8c199fa"
}
]
},
"position": "bb1",
"rip": "14501bc20",
"registerChanges": [
{
"registerName": "r11",
"previousValue": "9d46c36de8c10d85",
"newValue": "e8c10d85"
}
],
"memoryChanges": [
{
"address": "14f288",
"previousValue": 0,
"newValue": "e8c199fa"
}
]
},
"instructionErrors": [
{
"index": 0,
"message": "unmatchedRegisterChange mismatch (scemu but not x64dbg)",
"scemu": "r11"
}
]
},
brandonros commented
should be a no-op?
brandonros commented
2994 0x14501bc20: bsf r11d,r15d
/!\ undefined behavior on BSF with src == 0
diff_flags: pos = 2993 rip = 14501bc20 in = 296 out = 2d6 f_zf 0 -> 1;
diff_reg: pos = 2993 rip = 14501bc20 r11 9d46c36de8c10d85 -> e8c10d85;
rax: 0xfffffffffff63e25 rbx: 0x5370 rcx: 0x144fa54ec rdx: 0x144fa54ec rsi: 0x14f490 rdi: 0x144e4713b rbp: 0x144ec1d56 rsp: 0x14f288
r8: 0x50 r9: 0x14f480 r10: 0x8cb75dbe12d3c81d r11: 0xe8c10d85 r12: 0x1448a76a4 r13: 0x0 r14: 0x140000000 r15: 0x0
r8u: 0x0 r9u: 0x0 r10u: 0x8cb75dbe r11u: 0x0 r12u: 0x1 r13u: 0x0 r14u: 0x1 r15u: 0x0
r8d: 0x50 r9d: 0x14f480 r10d: 0x12d3c81d r11d: 0xe8c10d85 r12d: 0x448a76a4 r13d: 0x0 r14d: 0x40000000 r15d: 0x0
r8w: 0x50 r9w: 0xf480 r10w: 0xc81d r11w: 0xd85 r12w: 0x76a4 r13w: 0x0 r14w: 0x0 r15w: 0x0
r8l: 0x50 r9l: 0x80 r10l: 0x1d r11l: 0x85 r12l: 0xa4 r13l: 0x0 r14l: 0x0 r15l: 0x0
zf: true pf: true af: true of: false sf: true df: false cf: false tf: false if: true nt: false
sha0coder commented
it's a nop but enabling ZF, like the manual says:
https://www.felixcloutier.com/x86/bsf
is it incorrect enabling ZF?
sha0coder commented
I did a test on x64dbg and it's enabling the ZF.
brandonros commented
"x64dbgLine": {
"rawLine": {
"Index": "00BB1",
"Address": "000000014501BC20",
"Bytes": "45:0FBCDF",
"Disassembly": "bsf r11d,r15d",
"Registers": "",
"Memory": "",
"Comments": ""
},
"rip": "14501bc20",
"registerChanges": [],
"memoryChanges": []
},
this means in x64dbg it is not modifying and registers or any memory writes
brandonros commented
"registerChanges": [
{
"registerName": "r11",
"previousValue": "9d46c36de8c10d85",
"newValue": "e8c10d85"
}
],
in scemu we should not have this change, this is what i mean by "should be no-op"?
sha0coder commented
fixed.