Jump to content

Bytes/File structure reading/ Editing in Autoit


Recommended Posts

Hi all

I am wondering if in autoit it's possible to get the structure of a file, choose a byte and edit it directly from the autoit program. Maybe with a GUI and a box 

If for example i want to take the 4th byte of a file, is that possible to turn this 4th byte in a box and edit it easily?

Link to comment
Share on other sites

you should read help on this commands:

FileOpen

FileSetPos

FileGetPos

FileRead

p.s.

search for "Hex editor"  in autoit advanced search for some examples

edit:

>here a very simple example to use that commands

Edited by PincoPanco

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

you should read help on this commands:

FileOpen

FileSetPos

FileGetPos

FileRead

p.s.

search for "Hex editor"  in autoit advanced search for some examples

edit:

>here a very simple example to use that commands

This can really help me,i'll look into it

Isn't there an example script about it?

I need to make a tool which reads a byte of a file, then i want to transfer this byte in a box and edit it manually.

Edited by Nymphetamine
Link to comment
Share on other sites

This can really help me,i'll look into it

Isn't there an example script about it?

I need to make a tool which reads a byte of a file, then i want to transfer this byte in a box and edit it manually.

 

If you're talking about binary data you'll have to also use binarytostring() and binary() on the data before/after editing.

Link to comment
Share on other sites

This can really help me,i'll look into it

Isn't there an example script about it?

I need to make a tool which reads a byte of a file, then i want to transfer this byte in a box and edit it manually.

 

An very minimalist example to read 4° byte from any file

$File = FileOpenDialog('Please choose file', '', 'All files (*.*)', 1)

$myfile = FileOpen($File, 16) ; open file in binary mode

Local $x = 3 ; we will read 4° byte first byte is nr.0 (0 based)

FileSetPos($myfile, $x, 0) ; position "cursor" to byte nr $x

$byte = FileRead($myfile, 1) ; read 1 byte (and autoincrement position)

MsgBox(0, "", "Value of byte in position " & $x & " is " & $byte)

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

 

An very minimalist example to read 4° byte from any file

$File = FileOpenDialog('Please choose file', '', 'All files (*.*)', 1)

$myfile = FileOpen($File, 16) ; open file in binary mode

Local $x = 3 ; we will read 4° byte first byte is nr.0 (0 based)

FileSetPos($myfile, $x, 0) ; position "cursor" to byte nr $x

$byte = FileRead($myfile, 1) ; read 1 byte (and autoincrement position)

MsgBox(0, "", "Value of byte in position " & $x & " is " & $byte)

And how can i put the number of this 4th value in a box and edit it?

I would like to make a GUI window with some boxes to read a byte and make it editable from it. And then save the file with the edited byte

Edited by Nymphetamine
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...