Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- #include <stdlib.h>
- // seemsToEncodeSomething(0x6010a0, dataSize, buffer, pass, 18);
- // void fun_4008a8(int64_t rdi, uint32_t esi, int64_t rdx, int64_t rcx, int32_t r8d) {
- void seemsToEncodeSomething(long rdi, unsigned nSize, void* rdx, char* rcx, int r8d) {
- long v6;
- unsigned v7;
- void* v8;
- char* v9;
- int v10;
- unsigned v11;
- long rdx12;
- long rdx13;
- long rdx14;
- unsigned eax15;
- v6 = rdi;
- v7 = nSize;
- v8 = rdx;
- v9 = rcx;
- v10 = r8d;
- v11 = 0;
- while (v11 < v7) {
- *reinterpret_cast<unsigned*>(&rdx12) = v11;
- *reinterpret_cast<int*>(reinterpret_cast<long>(&rdx12) + 4) = 0;
- *reinterpret_cast<unsigned*>(&rdx13) = v11;
- *reinterpret_cast<int*>(reinterpret_cast<long>(&rdx13) + 4) = 0;
- *reinterpret_cast<unsigned*>(&rdx14) = v11 % v10;
- *reinterpret_cast<int*>(reinterpret_cast<long>(&rdx14) + 4) = 0;
- eax15 = static_cast<unsigned>(*reinterpret_cast<unsigned char*>(v9 + rdx14)) ^ static_cast<unsigned>(*reinterpret_cast<unsigned char*>(v6 + rdx13));
- *reinterpret_cast<signed char*>(rdx12 + (int)v8) = *reinterpret_cast<signed char*>(&eax15);
- ++v11;
- }
- return;
- }
- // seemsToWriteToFile(buffer, dataSize, buffer, pass, 18);
- // void fun_400912(int64_t rdi, int32_t esi, int64_t rdx, int64_t rcx, int64_t r8) {
- void seemsToWriteToFile(void* buffer, int nSize, void* rdx, char* rcx, long r8) {
- FILE* file;
- long rdx7; //nSize
- long rdi8;
- long wroteBytes;
- long rdi10;
- file = fopen("/tmp/steganography_lsb.png", "w");
- if (file != NULL) {
- wroteBytes = fwrite(buffer, 1, nSize, file);
- if (wroteBytes > 0) {
- fclose(file);
- puts("Done!");
- }
- else {
- perror("Error writing bytes");
- }
- }
- return;
- }
- void fun_40084d(unsigned edi, long rsi, long rdx, long rcx, long r8) {
- unsigned v6;
- FILE* rax7;
- unsigned v8;
- FILE* rax9;
- v6 = edi;
- rax7 = stdout;
- fflush(rax7);
- v8 = 0;
- while (v6 > v8) {
- //sleep(1);
- putchar(46);
- rax9 = stdout;
- fflush(rax9);
- ++v8;
- }
- return;
- }
- int main() {
- long rsi1;
- long rdx2;
- long rcx3;
- long r8_4;
- void* buffer;
- char pass[] = "THEFASTESTMANALIVE";
- int dataSize = 0x1e0de;
- printf("Writing file.");
- fun_40084d(3, rsi1, rdx2, rcx3, r8_4);
- buffer = malloc(dataSize); // gets 123102 bytes
- seemsToEncodeSomething(0x6010a0, dataSize, buffer, pass, 18);
- seemsToWriteToFile(buffer, dataSize, buffer, pass, 18);
- //fputc(10, dataSize, buffer, pass, 18);
- free(buffer);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement