Read bin?

Feb 5, 2006 at 8:55pm

Read bin?

#24285
Feb 5, 2006 at 9:30pm

#69982
Feb 5, 2006 at 11:18pm

Thanks for the tip, but I’m already working with Jitter. But for a project ( http://recyclism.com/corrupt.php ) I’d like to manipulate the binary of a document, and the matrix system of Jitter is not what I’m looking for, I just want to be able to access the binary code of a picture and scramble with it. I’m not looking for ways to simulate or to create visual effects with Jitter.

I’m looking for an object to read the binary, manipulate it and save the document again (I hope this is more clear now ;-)

Best,

bnjmn

#69983
Feb 6, 2006 at 1:44am

#69984
Feb 6, 2006 at 3:37am

have you seen the glitch browser?

http://dataisnature.com/?p=254

actually, here is some javascript code for a firefox plugin that the
glitchbrowser uses

http://glitchbrowser.com/gmonkey/

Similar ‘corrupt’ image processing

enjoy!

v a d e //

http://www.vade.info
abstrakt.vade.info

I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I
LIVE! I LIVE! I LIVE! I LIVE!

You will not be saved by the Holy Ghost. You will not be saved by the
God Plutonium.

In fact, YOU WILL NOT BE SAVED!

#69985
Feb 6, 2006 at 3:42am

actually on closer inspection that JS code simply redirects to their
php parser and returns the image. oh well.but thats what you are
talking about right?

v a d e //

http://www.vade.info
abstrakt.vade.info

I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I LIVE! I
LIVE! I LIVE! I LIVE! I LIVE!

You will not be saved by the Holy Ghost. You will not be saved by the
God Plutonium.

In fact, YOU WILL NOT BE SAVED!

#69986
Feb 6, 2006 at 9:26am

#69987
Feb 6, 2006 at 4:02pm

#69988
Feb 6, 2006 at 4:11pm

#69989
Feb 6, 2006 at 4:32pm

filein

salutations

/*j

Benjamin Gaulon wrote:

> Yes indeed, it could fix a part of the pbl, thanks… Still I wonder how to read the binary of a file.. there must be something for that… ;-)

#69990
Feb 6, 2006 at 4:45pm

> filein

> salutations

> /*j

I knew there was soething ;-)

Merci Jasch, ones again !!!!

All the best,

bnjmn

#69991
Feb 6, 2006 at 6:44pm

you live, but i will be saved, by my-self.
i have red sand on my hand-mind prooving that.
someone broke the code.

to gar estin, to gar estin
for it is the same as to think and to be
to gar estin,

via page number: georges ifrah

#69992
Feb 6, 2006 at 9:51pm

On Feb 6, 2006, at 4:11 PM, Benjamin Gaulon wrote:

> Still I wonder how to read the binary of a file.. there must be
> something for that… ;-)

Please see the JS documentation of the FIle object, specifically the
readbytes and writebytes methods to access the raw binary data of files.

readbytes (byte_count)
Reads and returns an array containing up to byte_count numbers, read
as bytes
from the file, starting at the current file position. The file
position is updated
accordingly.

writebytes (byte_array)
Writes the numbers contained in the byte_array argument as bytes to
the file,
starting at the current file position. The file position is updated
accordingly.

-Joshua

#69993
Feb 6, 2006 at 11:10pm

Yeah, this sound more like it ;-) I knew there was something there…

thx,

bnjmn?

#69994
Feb 7, 2006 at 1:20am

Javascript is suppose to be simple but maybe I miss something here (when I call my function I only get the flying pizza of death… and I have to force quit Max…), I certainly have made a stupod mistake but I don’t see it… :

function readbytes(s)
{
var f = new File(s);
var i,a,c;

if (f.isopen) {
c = f.eof;
for (i=0;i
a = f.readbytes(1); //
post(“byte_count[" + f.position + "]: ” + a + “n”);
}
f.close();
} else {
post(“could not open file: ” + s + “n”);
}
}

readbytes (byte_count)
Reads and returns an array containing up to byte_count numbers, read
as bytes
from the file, starting at the current file position. The file
position is updated
accordingly.

writebytes (byte_array)
Writes the numbers contained in the byte_array argument as bytes to
the file,
starting at the current file position. The file position is updated
accordingly.

-Joshua

#69995
Feb 7, 2006 at 1:33am

On Feb 7, 2006, at 1:20 AM, Benjamin Gaulon wrote:

>
> Javascript is suppose to be simple but maybe I miss something here
> (when I call my function I only get the flying pizza of death…
> and I have to force quit Max…), I certainly have made a stupod
> mistake but I don’t see it… :
>

I don’t think so. The code looks okay at a glance. It sounds like
it’s taking that long to read in. Don’t underestimate the overhead of
doing this in JavaScript. Note that the max window won’t update
until you’ve completed your function. Try doing this just for a few
bytes. It will also be faster to read more than one byte at a time,
but still not that fast, as the byte is read, converted to a max
atom, which is converted to a JS number. Doing in Java or C would be
faster than in JS.

-Joshua

#69996
Feb 7, 2006 at 1:53am

ok, thank you very much. finally it seams that my Proce55ing methods was more efficent ;-) but I will keep investigating with Max ;-)

thx again,

bnjmn

Doing in Java or C would be faster than in JS.

#69997

You must be logged in to reply to this topic.