sha0coder/libscemu

shld broken

Closed this issue · 3 comments

{
    "i": 169,
    "x64dbgLine": {
      "rawLine": {
        "Index": "000A9",
        "Address": "0000000144FBED19",
        "Bytes": "6641:0FA4EB 3C",
        "Disassembly": "shld r11w,bp,3C",
        "Registers": "r11: 1BB09DE2F-> 1BB099DE2",
        "Memory": "",
        "Comments": ""
      },
      "rip": "144fbed19",
      "registerChanges": [
        {
          "registerName": "r11",
          "previousValue": "1bb09de2f",
          "newValue": "1bb099de2"
        }
      ],
      "memoryChanges": []
    },
    "scemuLine": {
      "rawLine": "diff_reg: rip = 144fbed19",
      "rip": "144fbed19",
      "registerChanges": [],
      "memoryChanges": []
    },
    "instructionErrors": [
      {
        "index": 0,
        "message": "unmatchedRegisterChange mismatch (x64dbg but not scemu)",
        "x64dbg": "r11"
      }
    ]
  },
170 0x144fbed19: shld  r11w,bp,3Ch
/!\ undefined behaviour on shld
	shld: value0 = de2f value1 = 4239 counter = 3c sz = 16 result = de2f undef = true
	diff_flags: rip = 144fbed19 f_sf 0 -> 1; 
	diff_reg: rip = 144fbed19 
	rax: 0x58 rbx: 0x0 rcx: 0x140000000 rdx: 0x100000000 rsi: 0x14f418 rdi: 0x144e47251 rbp: 0x144ed4239 rsp: 0x14f288
	r8: 0x0 r9: 0x0 r10: 0x10fee6 r11: 0x1bb09de2f r12: 0x1448a76a4 r13: 0x0 r14: 0x140000000 r15: 0x0

"Registers": "r11: 1BB09DE2F-> 1BB099DE2",

is curious the SHLD undefined behaviors are like shifting left, sometimes value1 and other times value0

inline fixed it, was undefined behavior