Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. __int64 __fastcall encode(const char *input_file, const char **argv)
  2. {
  3. rgb *col; // ST28_8@3
  4. signed int y; // [sp+8h] [bp-138h]@1
  5. signed int x; // [sp+Ch] [bp-134h]@2
  6. signed int i; // [sp+10h] [bp-130h]@5
  7. int bit; // [sp+14h] [bp-12Ch]@6
  8. rgb *row; // [sp+18h] [bp-128h]@2
  9. rgb *selected_col; // [sp+20h] [bp-120h]@6
  10. char message[256]; // [sp+30h] [bp-110h]@1
  11. __int64 v11; // [sp+138h] [bp-8h]@1
  12.  
  13. v11 = *MK_FP(__FS__, 40LL);
  14. memset(message, 0, sizeof(message));
  15. printf("message (less than 256 bytes): ", argv, message);
  16. fgets(message, 256, _bss_start);
  17. for ( y = 0; y <= 255; ++y )
  18. {
  19. row = input_rows[y];
  20. for ( x = 0; x <= 255; ++x )
  21. {
  22. col = &row[x];
  23. col->red ^= rand() & 1;
  24. col->green ^= rand() & 1;
  25. col->blue ^= rand() & 1;
  26. }
  27. for ( i = 0; i <= 7; ++i )
  28. {
  29. selected_col = &row[32 * i];
  30. bit = (message[y] >> i) & 1;
  31. if ( selected_col->blue & 1 )
  32. selected_col->blue ^= 1u;
  33. selected_col->blue |= (selected_col->red ^ selected_col->green) & 1 ^ (unsigned __int8)bit;
  34. }
  35. }
  36. return *MK_FP(__FS__, 40LL) ^ v11;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement