Help with script Log Out | Topics | Search
Moderators | Edit Profile

X-Ways Support Forum » Advanced Features » Help with script « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Jimmy Weg
Username: jw

Registered: 7-2006
Posted on Friday, Mar 27, 2009 - 3:31:   

I'm trying my hand at a very simple script. I opened a file and wanted to write jimmyweg at Offset 0x200 from the begining and at every 512th byte from that point. Hence, the string would be written at Offset 512, 1024, etc., until the file ends or I run out of 512-byte blocks. I came up with the script below, but am lost at the point where I must make the script repeat as desired. I tried a loop such as {<script>}[10] (an arbitrary number), but the script just wrote jimmyweg ten consecutive times starting at 0x200.

goto 0x200
insert jimmyweg
move -8

Thanks.
Top of pagePrevious messageNext messageBottom of page Link to this message

René Axnix
Username: reax

Registered: N/A
Posted on Friday, Mar 27, 2009 - 12:30:   

This is the easiest way (i think so) to do that:

goto 0x200
Label Schleife //Schleife=loop
write "jimmyweg"
move -8
move 512
JumpTo Schleife

This script will run until the end of the file is reached.
Top of pagePrevious messageNext messageBottom of page Link to this message

René Axnix
Username: reax

Registered: N/A
Posted on Friday, Mar 27, 2009 - 13:42:   

you can use TURBO ON at first line of the script
Top of pagePrevious messageNext messageBottom of page Link to this message

Jimmy Weg
Username: jw

Registered: 7-2006
Posted on Friday, Mar 27, 2009 - 15:50:   

Thanks very much, René. That works fine. At the end, when too few bytes remain, I receive a maeesgae that the file does not contain required offset n, followed by the command execution error (move 512). I just click through those and all is well.
Top of pagePrevious messageNext messageBottom of page Link to this message

Patricia Monica Delbono
Username: pato

Registered: N/A
Posted on Monday, Mar 30, 2009 - 2:06:   

some days I post a message but i don't know what happedened that I can not see it. So I ask you again
In what cases do you use a script?
Where do you invoke the script? for example net code
"goto 0x200
Label Schleife //Schleife=loop
write "jimmyweg"
move -8
move 512
JumpTo Schleife"
Can I use with specialist licence -this question is for Mr. Stefhan.
Thanks
Patricia
Top of pagePrevious messageNext messageBottom of page Link to this message

Stefan Fleischmann
Username: admin

Registered: 1-2001
Posted on Monday, Mar 30, 2009 - 18:36:   

Yes, you can execute your own scripts with a professional, specialist, or forensic license, from within the Start Center (e.g. Tools | Start Center), or by double-clicking the .whs file (if it's associated with WinHex).

Add Your Message Here
Post:
Username: Posting Information:
Only registered users may post messages here, i.e. you need to have an account.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:
Forum operated by X-Ways Software Technology AG.