Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Code that checks for hidden rars/whatnot

Name: Anonymous 2006-12-01 7:05

Halo!

I was thinking about writing some code that given a directory will scan all jpegs for hidden rar files. Shouldn't be to hard, and will give me some excercise, which is good.

However.

Has this been done before? Is there a really easy way to do it now? Would the above mentioned code be of use to anyone?

Imma loading my Eclipse-with-PyDev...

Name: Anonymous 2006-12-01 8:10

grep -c Rar! *.jpg

Name: Anonymous 2006-12-01 9:25

just check if the last two bytes are $ffd9 (if not, there's 'hidden' data (or the file is incomplete))

Name: Anonymous 2006-12-01 12:57

>>1

It would be useful as an addon for a web browser too, to highlight if any of the images on the page have hidden data. Or, if there are any links to jpg, to do what >>3 said and read the last two bytes (I think you can specify just to retrieve that range using HTTP) to see if it's likely that a linked image has hidden stuff in.

Name: Anonymous 2006-12-01 13:14

function check_rar(url) {
   if (window.XMLHttpRequest) {
      xmlhttp=new XMLHttpRequest();
      xmlhttp.onreadystatechange=new Function("file_ready("+url+");");
      xmlhttp.open("GET", url, true);
      xmlhttp.send(null);
   } else if (window.ActiveXObject) {
      xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
      if (xmlhttp) {
         xmlhttp.onreadystatechange=new Function("file_ready("+url+");");
         xmlhttp.open('GET', url, false);
         xmlhttp.send();
      }
   }
}

function file_ready(url) {
   if (xmlhttp.readyState==4) {
      if (xmlhttp.status==200) {
         if(/Rar!/.test(xmlhttp.responseText)) alert(url+" contains a hidden rar file!");
      }
   }
}

Name: Anonymous 2006-12-01 13:19

>>5

Oh wow

Name: Anonymous 2006-12-01 14:09

>>4

Umm, apart from you'd have to download all the images before you could check em. Would be better as an add-on for 4chan.

Name: Anonymous 2006-12-01 14:15

>>7

No, you download part of the images to check them

Name: Anonymous 2006-12-02 5:52

Windows Powershell code that will iterate over all files in the directory you are in an rename all jpegs containing the string "Rar!" to filename.jpg.rar.

For lulz!

Get-ChildItem | ForEach { if ((Get-Content $_) -match [regex]"Rar!") {copy $_ $_".rar"}}

Name: Anonymous 2006-12-02 8:53

>>9

WIN

Name: Anonymous 2006-12-02 16:36

grep -l Rar\! *.jpg | xargs -0I% cp \'%\' \'%.rar\'

Name: Anonymous 2006-12-02 16:39

grep -l Rar\! *.jpg|xargs -I% cp \'%\' \'%.rar\'

Name: Anonymous 2006-12-02 18:17

>>11 and >>12 fail for unix/cygwin commands
Yes, I am >>9.
Yes, I dualboot windows and linux
No, I rarely ever see the need to use linux.

Name: Viral !BqcQeeA4HA 2006-12-03 0:01

lazy hack
pseduo-code

filelimiter = file.height * file.width * max.quality
if filesize > filelimiter
print FUCK YOU
else
print ;D
end if

Name: Anonymous 2006-12-03 1:20

lol troll. PNG is compressed you stupid faggot.

Name: Anonymous 2006-12-03 3:11 (sage)

>>9
>>11
>>12
The sad part is >>9 actually makes sense and the other 2 look more like random gibberish

Name: Anonymous 2006-12-03 4:55

>>16
Enjoy your object oriented shell :)

Name: Anonymous 2006-12-03 5:02

>>9 fails for Powershell super syntax bloat.
Yes, I dualboot Linux and Windows.
No, I rarely ever see the need to use Windows.

Name: Anonymous 2006-12-03 8:21

>>16
Object-oriented shell = stupid shit. After 20 years of suckage, Microsoft finally wanted to make a powerful shell (they never cared for their power users and developers, so it's not a surprise they took so long). But, to keep managers happy and to be sure to cope with enterprise Web 2.0 needs, they went and overcomplicated it with OO shit.

Although I admit Unix commands and sh-like shells suck as well, in a different way of suck. Let's see: I never cared for Microsoft's stupid shell, yet I understand perfectly what >>9 does. I use Unix commands, though for more complex stuff and any kind of shell scripting, I use Python, PHP or Perl as I hate their million of illogical switches and Bash syntax (using Perl cause Bash syntax sucks really means something). Even having used Unix OSes and fixed Windows OSes for years, I still hadn't memorized what grep -l and xargs -I do, and >>12 still looks like crap; in particular, the stupid quote hell (Perl q{...} quotes FTW).

Name: Anonymous 2006-12-03 8:36

>>19

Maybe you should try it instead of spouting off in an ill-informed rage. The object orientation aspect of it is actually rather good, as it allows objects to be piped from command to command rather than just simple text. Actually having some data structuring built in like that makes it a lot more powerful.

Name: Anonymous 2009-01-14 14:07

lol sepples

Name: Anonymous 2009-03-06 10:25


Although I could probably   develop an algorithm   that works in   every situation You   should never use   lisp again but   needs to take   a level 200   or above class   available at your   stance on emotes   and Java was   good at this   was actually a   banned page that   lets you browse   ancient unix 7th   ed source code   for this precious   kopipe which I   hate cause I   am an EXPERT   PROGRAMMER So I.

Name: Anonymous 2011-02-04 11:27

Name: Sgt.Kabu駊㝔kiman뇕 2012-05-28 21:11

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List