Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[x86] LOCK NOP not decoded (F0 0F 1F 00) #915

Closed
davidbrazdil opened this issue May 2, 2017 · 7 comments
Closed

[x86] LOCK NOP not decoded (F0 0F 1F 00) #915

davidbrazdil opened this issue May 2, 2017 · 7 comments

Comments

@davidbrazdil
Copy link

The byte sequence "F0 0F 1F 00" disassembles to "lock nopl (%rax)" with GNU Binutils 2.26.1 and Online Disassembler [1] but is undecoded by Capstone "next" branch. It is emitted by LLVM for alignment.

[1] https://www.onlinedisassembler.com/odaweb/mkfPEHoP/0

@aquynh
Copy link
Collaborator

aquynh commented May 2, 2017

Any other disassembler can handle this code, besides Gas?

@davidbrazdil
Copy link
Author

NASM: F00F1F00 lock nop dword [rax]
Zyan: lock nop [rax]

It's just the LOCK prefix. Capstone disassembles the NOP 0F 1F 00 just fine.

@aquynh
Copy link
Collaborator

aquynh commented May 3, 2017

fixed now, please confirm.

@davidbrazdil
Copy link
Author

Yes, now decodes. Thank you

@gdbinit
Copy link
Contributor

gdbinit commented Sep 13, 2017

Zyan doesn't accept this anymore (there's a Jul 3 commit about illegal lock prefixes).

$ ./ZydisInfo -64 F0 0F 1F 00
Could not decode instruction: ILLEGAL_LOCK

Is this instruction really valid? I'm not sure per Intel manuals.

Also from XED:
$ ./xed -64 -d F0 0F 1F 00
F00F1F00
ERROR: BAD_LOCK_PREFIX Could not decode at offset: 0x0 PC: 0x0: [F00F1F000000000000000000000000]

@aquynh
Copy link
Collaborator

aquynh commented Sep 13, 2017 via email

@gdbinit
Copy link
Contributor

gdbinit commented Sep 13, 2017

Yes, it's an illegal instruction per Intel manuals and verified on a real cpu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants