Qt Code:
#include "StdAfx.h" #include <iostream> #include <string.h> using namespace std; void encrypt_data(); int main() { FILE * f; unsigned char buffer[100]; int n; f = fopen("C:\\Program Files (x86)\\TeamViewer\\Version6\\TeamViewer.exe", "rb"); if (f) { n = fread(buffer, 100, 1, f); for (int c = 0; c <= 100 ; c++) { printf("%.2X ", (int)buffer[c]); //outputs hex!!!!!! // put an extra space between every 4 bytes if (c % 4 == 3) { printf(" "); } // Display 16 bytes per line if (c % 16 == 15) { printf("\n"); } } // Add an extra line feed for good measure printf("\n\n\n"); } else { cout << "error"; } char a; cin >> a; return 0; }To copy to clipboard, switch view to plain text mode
I want to make that in Qt^^^
And FelixB the loop doesn't stop for me.
it keeps outputting bytes....never stops.
Accually yes.It works with a smaller one.
Thank you for this,could you comment a bit the lines?
Thanks.
Maybe he wants to encrypt twice as much as he needs to?It's always fun to make a 10MB file out of a 5MB file...
You mean like this?
Qt Code:
To copy to clipboard, switch view to plain text mode
This outputs some strange symbols(I suppose bin. code),but it also beeps and crashes after some secs...
Do you want to encrypt it or print it? I doubt encrypting it outputs any strange symbols or makes any sounds. This is binary data that is not suitable for printing to a text terminal.
Well,crypt it of course,but I want to out put it,to make sure,everything works...and that I will encrypt the data I need.!
So encrypt the binary data but output it to a terminal as hex for the before and after.
Yup.
Thanks guys for the support,help and sorry for the dump question...![]()
Bookmarks