Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 7th, 2012  |  syntax: None  |  size: 0.97 KB  |  views: 46  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #ifdef _MSC_VER
  2. #define FORCEDINLINE __forceinline
  3. #else
  4. #define FORCEDINLINE __attribute__((always_inline))
  5. #endif
  6.  
  7. FORCEDINLINE void * __stdcall asdf(int addr)
  8. {
  9.         __asm
  10.         {
  11.                 push addr
  12.                 call core_call
  13.         }
  14. }
  15.  
  16. template <class A>
  17. FORCEDINLINE void * __stdcall asdf(int addr, A a)
  18. {
  19.         __asm
  20.         {
  21.                 push a
  22.                 push addr
  23.                 call core_call
  24.         }
  25. }
  26.  
  27. template <class A, class B>
  28. FORCEDINLINE void * __stdcall asdf(int addr, A a, B b)
  29. {
  30.         __asm
  31.         {
  32.                 push b
  33.                 push a
  34.                 push addr
  35.                 call core_call
  36.         }
  37. }
  38.  
  39. template <class A, class B, class C>
  40. FORCEDINLINE void * __stdcall asdf(int addr, A a, B b, C c)
  41. {
  42.         __asm
  43.         {
  44.                 push c
  45.                 push b
  46.                 push a
  47.                 push addr
  48.                 call core_call
  49.         }
  50. }
  51.  
  52. template <class A, class B, class C, class D>
  53. FORCEDINLINE void * __stdcall asdf(int addr, A a, B b, C c, D d)
  54. {
  55.         __asm
  56.         {
  57.                 push d
  58.                 push c
  59.                 push b
  60.                 push a
  61.                 push addr
  62.                 call core_call
  63.         }
  64. }
  65. // ... and so on
  66.  
  67. #define function(...) (HANDLE WINAPI) asdf(123456, __VA_ARGS__);