PureBasic Forum
https://www.purebasic.fr/english/

Measuring assembly instruction byte size (code length)
https://www.purebasic.fr/english/viewtopic.php?f=35&t=70690
Page 1 of 1

Author:  Trond [ Fri May 11, 2018 10:09 am ]
Post subject:  Measuring assembly instruction byte size (code length)

Code:
; Measure the code size in bytes of assembly instructions
!@@:
; Instructions here
!mov [v_size], $-@b
Debug size


Example:
Code:
!@@:
!mov rax, 0
!mov [v_size], $-@b
Debug size

!@@:
!xor rax, rax
!mov [v_size], $-@b
Debug size

!@@:
!push 0
!pop  rax
!mov [v_size], $-@b
Debug size

Author:  Olliv [ Tue Dec 25, 2018 8:49 pm ]
Post subject:  Re: Measuring assembly instruction byte size (code length)

Good stuff. Bypasses Disassembly lib which is more complex to code, and less light than this.

Author:  Mijikai [ Tue Dec 25, 2018 9:22 pm ]
Post subject:  Re: Measuring assembly instruction byte size (code length)

Olliv wrote:
Good stuff. Bypasses Disassembly lib which is more complex to code, and less light than this.


Don't u need to know the size already since u need to know where to put this... ?

Author:  Olliv [ Sat Dec 29, 2018 5:11 am ]
Post subject:  Re: Measuring assembly instruction byte size (code length)

https://www.purebasic.com/documentation/onerror/examineassembly.html

Mijikai wrote:
Don't u need to know the size already since u need to know where to put this... ?

I have no time to need to know where to put this : I was stolen this before. But I stamped a QRCode on this. No problem anymore.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/