Advertisement
Guest User

Untitled

a guest
Nov 29th, 2012
699
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.98 KB | None | 0 0
  1.     #define JUNK_CODE_ONE                               \
  2.         __asm {push eax}                                \
  3.         __asm {xor eax, eax}                            \
  4.         __asm {setpo al}                                \
  5.         __asm {push edx}                                \
  6.         __asm {xor edx, eax}                            \
  7.         __asm {sal edx, 2}                              \
  8.         __asm {xchg eax, edx}                           \
  9.         __asm {pop edx}                                 \
  10.         __asm {or eax, ecx}                             \
  11.         __asm {pop eax}
  12.  
  13.     // ..
  14.     #define JUNK_CODE_TWO_2(lineno, value)              \
  15.         __asm {jz _1##lineno}                           \
  16.         __asm {jnz _1##lineno}                          \
  17.         __asm {_emit 0x##value}                         \
  18.         __asm {_1##lineno: }
  19.     #define JUNK_CODE_TWO_1(name, value) JUNK_CODE_TWO_2(name, value)
  20.     #define JUNK_CODE_TWO JUNK_CODE_TWO_1(__LINE__, __LINE__*1111%253)
  21.  
  22.     // ..
  23.     #define JUNK_CODE_TWO_2_2(lineno)                   \
  24.         __asm {jz _112##lineno}                         \
  25.         __asm {jnz _112##lineno}                        \
  26.         __asm {_emit 0e8h}                              \
  27.         __asm {_112##lineno: }
  28.     #define JUNK_CODE_TWO_1_2(name) JUNK_CODE_TWO_2_2(name)
  29.     #define JUNK_CODE_TWO2 JUNK_CODE_TWO_1_2(__LINE__)
  30.  
  31.     // ..
  32.     #define JUNK_CODE_TWO_2_3(lineno)                   \
  33.         __asm { xor eax, eax }                          \
  34.         __asm { test eax, eax }                         \
  35.         __asm {jz _1121##lineno}                        \
  36.         __asm {jnz _1120##lineno}                       \
  37.         __asm {_1120##lineno: }                         \
  38.         __asm {_emit 0e8h}                              \
  39.         __asm {_1121##lineno: }                         \
  40.         __asm { xor eax, 3 }                            \
  41.         __asm { add eax, 4 }                            \
  42.         __asm { xor eax, 5 }                           
  43.     #define JUNK_CODE_TWO_1_3(name) JUNK_CODE_TWO_2_3(name)
  44.     #define JUNK_CODE_TWO3 JUNK_CODE_TWO_1_3(__LINE__)
  45.  
  46.  
  47.     // ..
  48.     #define JUNK_CODE_THREE_2(lineno, value1, value2)   \
  49.         __asm {clc}                                     \
  50.         __asm {jnb _3t##lineno}                         \
  51.         __asm {_emit 0x##value1}                        \
  52.         __asm {_emit 0x##value2}                        \
  53.         __asm {_3t##lineno: }
  54.     #define JUNK_CODE_THREE_1(name, value1, value2) JUNK_CODE_THREE_2(name, value1, value2)
  55.     #define JUNK_CODE_THREE JUNK_CODE_THREE_1(__LINE__, __LINE__*1222%253, __LINE__*1111%253)
  56.  
  57.     // ..
  58.     #define JUNK_CODE_FOUR_2(lineno, value)             \
  59.         __asm {jl _11f##lineno}                         \
  60.         __asm {_12f##lineno: }                          \
  61.         __asm {jmp _13f##lineno }                       \
  62.         __asm {_emit 0x##value }                        \
  63.         __asm {_11f##lineno: }                          \
  64.         __asm {jz _12f##lineno }                        \
  65.         __asm {_13f##lineno: }
  66.     #define JUNK_CODE_FOUR_1(name, value) JUNK_CODE_FOUR_2(name, value)
  67.     #define JUNK_CODE_FOUR JUNK_CODE_FOUR_1(__LINE__, __LINE__*1111%253)
  68.  
  69.  
  70.     // ..
  71.     #define JUNK_CODE_FIVE_2(lineno)                    \
  72.         __asm {pushf}                                   \
  73.         __asm {push 0x0a}                               \
  74.         __asm {_51f##lineno: jnb _53f##lineno}          \
  75.         __asm {jmp _52f##lineno}                        \
  76.         __asm {_52f##lineno: call _54f##lineno}         \
  77.         __asm {_53f##lineno: jnb _52f##lineno}          \
  78.         __asm {_54f##lineno: add esp,4}                 \
  79.         __asm {jmp _55f##lineno}                        \
  80.         __asm {_55f##lineno: }                          \
  81.         __asm {dec dword ptr [esp]}                     \
  82.         __asm {jno _56f##lineno}                        \
  83.         __asm {_56f##lineno: jns _51f##lineno}          \
  84.         __asm {jp _57f##lineno}                         \
  85.         __asm {_57f##lineno: add esp,4}                 \
  86.         __asm {popf}                                    \
  87.         __asm {jmp _58f##lineno}                        \
  88.         __asm {_58f##lineno: }
  89.     #define JUNK_CODE_FIVE_1(name) JUNK_CODE_FIVE_2(name)
  90.     #define JUNK_CODE_FIVE JUNK_CODE_FIVE_1(__LINE__)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement