It is currently Mon Sep 23, 2019 2:21 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Measuring assembly instruction byte size (code length)
PostPosted: Fri May 11, 2018 10:09 am 
Offline
Always Here
Always Here

Joined: Mon Sep 22, 2003 6:45 pm
Posts: 7439
Location: Norway
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Measuring assembly instruction byte size (code length)
PostPosted: Tue Dec 25, 2018 8:49 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Sep 22, 2009 10:41 pm
Posts: 434
Good stuff. Bypasses Disassembly lib which is more complex to code, and less light than this.


Top
 Profile  
Reply with quote  
 Post subject: Re: Measuring assembly instruction byte size (code length)
PostPosted: Tue Dec 25, 2018 9:22 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Sep 11, 2016 2:17 pm
Posts: 520
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... ?


Top
 Profile  
Reply with quote  
 Post subject: Re: Measuring assembly instruction byte size (code length)
PostPosted: Sat Dec 29, 2018 5:11 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Sep 22, 2009 10:41 pm
Posts: 434
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye