![]() |
|
[C#] [SOURCE] Data to bitmap and back using pixel color values - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [C#] [SOURCE] Data to bitmap and back using pixel color values (/showthread.php?tid=2343137) |
[SOURCE] Data to bitmap and back using pixel color values - hgdfhsdgdfgdfh - Mar 27, 2012 Again not maybe the best quality code. Converts any byte array to a square bitmap and back. GOT THE IDEA FROM: https://hackforums.net/showthread.php?tid=2339901 Special thing: bitmap looks just the same as original bytes/file when opened in text editor (pixel values correspond to original bytes) :P Works only if bitmap is also saved as bitmap file and not compressed etc. My 0xViewer.exe converted: [img]http://img685.imageshack.us/img685/4841/tmp5a88.png[/img] BMP opened in notepad, you see the PE header: [img]http://img684.imageshack.us/img684/5541/tmp1742.png[/img] Maybe gonna add also encryption capability: have other picture with same size used as mask: xor all pixel values. Original data only can be restored using the mask picture :P NOTE: Avira detects the BITMAP file as DR/FakePic or something like that if exe file is converted to bmp xD Code /*Small sample code I used for test Code byte[] buf = System.IO.File.ReadAllBytes("0xViewer.exe");* - SIM-1033745 - Mar 27, 2012 That's fucking awesome, nice job! * - N3oNight - Mar 27, 2012 Yap Its Cool.. But any One Can post a VB.Net Version Over here.. * - hgdfhsdgdfgdfh - Mar 27, 2012 Thanks. And for VB.Net you can use some online converter (but im gonna post vb.net version also later :) ) * - CyNecx - Mar 28, 2012 https://hackforums.net/showthread.php?tid=2284748 nice ^^ Edit : updated version 6mb/sec -removed not one ite....- * - BaussHacker - Mar 28, 2012 This is really nice. It seems very interesting. * - KillαMuvz - Mar 29, 2012 (Mar 27, 2012 03:17 PM)N3oNight Wrote: Yap Its Cool.. Can't believe you asked for that. Anyway, it looks freaking awesome, I shall play with it! * - Super Scumbag - Mar 29, 2012 Might be able to avoid the avira detection by adding some junk code, or clone of part of a bmp. I'll play with it once I get VS2010U installed again in a little bit. * - hgdfhsdgdfgdfh - Mar 30, 2012 Avira detection can be avoided by simply reversing the order of image rows. In BMP file pixels are saved row by row starting from LAST row. So atm I'm starting from last row and going upwards until first. This makes bytes in BMP file be just the same as in original data so thats why I used it :P * - 0xDEAD10CC - Mar 31, 2012 The concept is cool, because uncompressed BMP's are just RGBRGBRGB,,, basically lol. Each pixel color takes up 3 bytes I believe and you would see the 3 parts of that color in #hex form if using a hex editor.. Nice idea though. :) * - ForceJew - Aug 31, 2016 Looks great! Really nice! * - Oliver Sykes - Sep 3, 2016 (Aug 31, 2016 07:31 AM)FORC3FI3LD Wrote: Looks great! And well over four years after the last post... |