Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.44 KB | None | 0 0
  1. #include "stdio.h"
  2. #include <stdlib.h>
  3.  
  4. //  seemsToEncodeSomething(0x6010a0, dataSize,     buffer,      pass,        18);
  5. // void fun_4008a8(int64_t rdi,      uint32_t esi, int64_t rdx, int64_t rcx, int32_t r8d) {
  6.  
  7. void seemsToEncodeSomething(long rdi, unsigned nSize, void* rdx, char* rcx, int r8d) {
  8.     long v6;
  9.     unsigned v7;
  10.     void* v8;
  11.     char* v9;
  12.     int v10;
  13.     unsigned v11;
  14.     long rdx12;
  15.     long rdx13;
  16.     long rdx14;
  17.     unsigned eax15;
  18.  
  19.     v6 = rdi;
  20.     v7 = nSize;
  21.     v8 = rdx;
  22.     v9 = rcx;
  23.     v10 = r8d;
  24.     v11 = 0;
  25.     while (v11 < v7) {
  26.         *reinterpret_cast<unsigned*>(&rdx12) = v11;
  27.         *reinterpret_cast<int*>(reinterpret_cast<long>(&rdx12) + 4) = 0;
  28.         *reinterpret_cast<unsigned*>(&rdx13) = v11;
  29.         *reinterpret_cast<int*>(reinterpret_cast<long>(&rdx13) + 4) = 0;
  30.         *reinterpret_cast<unsigned*>(&rdx14) = v11 % v10;
  31.         *reinterpret_cast<int*>(reinterpret_cast<long>(&rdx14) + 4) = 0;
  32.         eax15 = static_cast<unsigned>(*reinterpret_cast<unsigned char*>(v9 + rdx14)) ^ static_cast<unsigned>(*reinterpret_cast<unsigned char*>(v6 + rdx13));
  33.         *reinterpret_cast<signed char*>(rdx12 + (int)v8) = *reinterpret_cast<signed char*>(&eax15);
  34.         ++v11;
  35.     }
  36.     return;
  37. }
  38. //  seemsToWriteToFile(buffer, dataSize, buffer, pass, 18);
  39. // void fun_400912(int64_t rdi, int32_t esi, int64_t rdx, int64_t rcx, int64_t r8) {
  40.  
  41. void seemsToWriteToFile(void* buffer, int nSize, void* rdx, char* rcx, long r8) {
  42.     FILE* file;
  43.     long rdx7; //nSize
  44.     long rdi8;
  45.     long wroteBytes;
  46.     long rdi10;
  47.  
  48.     file = fopen("/tmp/steganography_lsb.png", "w");
  49.     if (file != NULL) {
  50.         wroteBytes = fwrite(buffer, 1, nSize, file);
  51.         if (wroteBytes > 0) {
  52.             fclose(file);
  53.             puts("Done!");
  54.         }
  55.         else {
  56.             perror("Error writing bytes");
  57.         }
  58.     }
  59.     return;
  60. }
  61.  
  62. void fun_40084d(unsigned edi, long rsi, long rdx, long rcx, long r8) {
  63.     unsigned v6;
  64.     FILE* rax7;
  65.     unsigned v8;
  66.     FILE* rax9;
  67.  
  68.     v6 = edi;
  69.     rax7 = stdout;
  70.     fflush(rax7);
  71.     v8 = 0;
  72.     while (v6 > v8) {
  73.         //sleep(1);
  74.         putchar(46);
  75.         rax9 = stdout;
  76.         fflush(rax9);
  77.         ++v8;
  78.     }
  79.     return;
  80. }
  81.  
  82. int main() {
  83.     long rsi1;
  84.     long rdx2;
  85.     long rcx3;
  86.     long r8_4;
  87.     void* buffer;
  88.     char pass[] = "THEFASTESTMANALIVE";
  89.     int dataSize = 0x1e0de;
  90.  
  91.     printf("Writing file.");
  92.     fun_40084d(3, rsi1, rdx2, rcx3, r8_4);
  93.     buffer = malloc(dataSize); // gets 123102 bytes
  94.     seemsToEncodeSomething(0x6010a0, dataSize, buffer, pass, 18);
  95.     seemsToWriteToFile(buffer, dataSize, buffer, pass, 18);
  96.     //fputc(10, dataSize, buffer, pass, 18);
  97.     free(buffer);
  98.     return 0;
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement