Exetools  

Go Back   Exetools > General > General Discussion

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-03-2007, 21:34
yaa
 
Posts: n/a
Question Calculating the size in bytes of a C++ function

Hello,

I'm writing a little proggie that injects code inside a running process without using the DLL loading approach and I got to the point of code injection itself and here an issue arises ... calculating how big my piece of code is. Obviously how the compiler lays out the code inside your binary may play a role depending on how you try to calculate the size ...

Anyhow, I seem to be able to calculate a size that is always greater than the real size ... so this would be enough for it to work but I was wondering if there is any nice trick C/C++ gurus may suggest.

Obviously I could check how many bytes this function gets compiled into using a disassembler or a debugger ... but doing everything directly from the IDE editor and using C/C++ code would be so much better!!

yaa

Last edited by yaa; 11-04-2007 at 00:31.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating relative jnz opcode sizes in a custom code generator redbull General Discussion 3 09-15-2005 23:54
Writing 4 bytes to COM Port AgentSmith General Discussion 3 04-08-2005 01:25
Damaged stolen bytes *RemedY* General Discussion 9 05-22-2004 16:58
22 stolen bytes? SvensK General Discussion 2 11-06-2003 17:13


All times are GMT +8. The time now is 14:55.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )