dim as integer layermax=lof(ff)/255,layertimer get #ff,,byte2 do byte1=byte2 get #ff,,byte2 layertimer+=1 if layertimer>=layermax then layer+=1 layertimer=0 end if bytes(byte1,byte2,layer)+=4 loop until eof(ff)close #ff

glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT glBegin gl_Points r=-1:g=127:b=127 for z as integer=0 to 255 step 2 r+=1:b-=1 for y as integer=0 to 255 for x as integer=0 to 255 if bytes(x,y,z)>0 then glColor4b r,g,b,bytes(x,y,z) glVertex3f x/32-256/64, y/32-256/64, -z/32+256/64 end if next next next glEnd

Hold your left mouse button and then move the mouse to rotate the rendered file.

I took some images from the renders:The 64bit gcc-compiler. Notice the bright "cubes" in the center of the image. Those are the areas where the strings are stored in the file.Random bitmap-image.A 32bit library with a lot of images saved inside.

.Interesting... I guess you inspected the binary files to figure out where the location of the data was that was being rendered, so that you could tell "what is what" in the image.

Might be even more interesting to have the program inspect the data while it was reading it and create a key that displayed which datatype belonged to which color... so you would know what you were looking at without having to bring up a hex viewer on some large program. Might have to parse the file first to identify strings, etc. - and then assign colors based on that. Visual inspection of files might create some insights that we normally don't have.

I'll have to think if I can make more use of it than just pretty pictures.

cbruce wrote:Might be even more interesting to have the program inspect the data while it was reading it and create a key that displayed which datatype belonged to which color... so you would know what you were looking at without having to bring up a hex viewer on some large program. Might have to parse the file first to identify strings, etc. - and then assign colors based on that.

Like this?Yellow bytes are ASCII-letters, blue bytes are opcode-prefixes. The blue line is common for 64bit executables, but you won't find it in 32bit binaries. It's quite easy to achieve this. Just change the "bytes"-array to 3 seperate arrays containing the rgb-values and then check, if the bytes you were reading are between 65 and 122 and then assign the colors.

It can come in handy when you want to inspect an unknown file. It is pretty easy to distinquish images, sounds and strings in a tar-ball or a library for example. "Trigram"-visualization is also interesting. It uses 3 byte-patterns instead of 2.

open "/usr/bin/gcc" for binary as #ff dim as integer mx,my,mb,oldmx,oldmy

dim shared as ubyte bytesr(255,255,255),bytesg(255,255,255),bytesb(255,255,255) dim as ubyte byte1,byte2,byte3 get #ff,,byte2 get #ff,,byte3 do byte1=byte2 byte2=byte3 get #ff,,byte3

If byte2>64 And byte2<123 And byte3>64 And byte3<123 Then If bytesr(byte1,byte2,byte3)<127 Then bytesr(byte1,byte2,byte3)+=8 If bytesg(byte1,byte2,byte3)<127 Then bytesg(byte1,byte2,byte3)+=8 Else If bytesr(byte1,byte2,byte3)<127 Then bytesr(byte1,byte2,byte3)+=8 If bytesg(byte1,byte2,byte3)<127 Then bytesg(byte1,byte2,byte3)+=8 If bytesb(byte1,byte2,byte3)<127 Then bytesb(byte1,byte2,byte3)+=8 End If loop until eof(ff)close #ff

glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT glBegin gl_Points for z as integer=0 to 255 step 2 for y as integer=0 to 255 for x as integer=0 to 255 if bytesg(x,y,z)>0 then glColor4b bytesr(x,y,z),bytesg(x,y,z),bytesb(x,y,z),bytesg(x,y,z) glVertex3f x/32-256/64, y/32-256/64, -z/32+256/64 end if next next next glEnd