The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: AeroASM on June 12, 2005, 11:46:01 AM

Title: Efficient API calls
Post by: AeroASM on June 12, 2005, 11:46:01 AM
How is this? Can it go any faster?

[attachment deleted by admin]
Title: Re: Efficient API calls
Post by: hutch-- on June 12, 2005, 11:57:43 AM
Aero,

It works OK but I wonder why you bother. There is a trick to make at least some API calls faster and that is to copy them from the resident system DLL into local memory and execute them from local memory. Use the address from GetProcAddress and make a generous enough guess at how big the algo will be that allocate enough memory to place it in.

It used to help with some GDI functions that were being hammered fast.
Title: Re: Efficient API calls
Post by: ThoughtCriminal on June 13, 2005, 02:09:49 AM
One time just for fun I wrote code to make a faster exit process.

I made the code section writable and patch all the API calls which are FFxxxx to E8-xxxx.

As long as you can get an entry point there should be a way to at runtime make all external calls E8 calls I think.