View Single Post
  #3  
Old 09-06-2004, 20:10
nikita@work
 
Posts: n/a
Quote:
Originally Posted by zaratustra
I need to calculate the exact number of bytes occupies Func() so I can pass this information to the writeprocessmemory.
How can i do that?
For example this way:

Code:
void __declspec(naked) BeginOfCode() {}

void __stdcall Wrapper()
{
   [...your code... ]
}

void __declspec(naked) EndOfCode() {}

void Inject()
{
   WriteProcess(
     ...
     Wrapper,
     EndOfCode - BeginOfCode,
     ...
}
Naked attribute used to strip any dummy code in output object
Reply With Quote