Change the hex value
Moderator: DosItHelp
Change the hex value
Using batch script how can I change the value of the exe file without hex editor?
I need to change the value 84 to 85 in offset 000B8F40 to enable or disable one switch relay http://postimg.org/image/4z59ac2vx/
Thank you
I need to change the value 84 to 85 in offset 000B8F40 to enable or disable one switch relay http://postimg.org/image/4z59ac2vx/
Thank you
Last edited by space on 15 Aug 2014 10:33, edited 1 time in total.
Re: Change the hex value
Is there only one 84 value in the file?
Re: Change the hex value
foxidrive wrote:Is there only one 84 value in the file?
yes
Re: Change the hex value
Code: Select all
repl \x84 \x85 xm <file.bin >filenew.bin
This uses a helper batch file called `repl.bat` (by dbenham) - download from: https://www.dropbox.com/s/qidqwztmetbvklt/repl.bat
Place `repl.bat` in the same folder as the batch file or in a folder that is on the path.
Re: Change the hex value
foxidrive wrote:Code: Select all
repl \x84 \x85 xm <file.bin >filenew.bin
This uses a helper batch file called `repl.bat` (by dbenham) - download from: https://www.dropbox.com/s/qidqwztmetbvklt/repl.bat
Place `repl.bat` in the same folder as the batch file or in a folder that is on the path.
More easy to understand the code is there?
Thank you
Re: Change the hex value
space wrote:More easy to understand the code is there?
Could you rephrase that. You have a question mark at the end of your sentence but the sentence really isn't phrased as a question.
Re: Change the hex value
Squashman wrote:space wrote:More easy to understand the code is there?
Could you rephrase that. You have a question mark at the end of your sentence but the sentence really isn't phrased as a question.
is there any code more easier for me to understand?
Re: Change the hex value
space wrote:Squashman wrote:space wrote:More easy to understand the code is there?
Could you rephrase that. You have a question mark at the end of your sentence but the sentence really isn't phrased as a question.
is there any code more easier for me to understand?
What don't you understand about the code you were given?
Editing a binary file pretty much requires some type of 3rd party program. You are not going to do it with native batch file commands.
-
- Expert
- Posts: 1167
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Change the hex value
What's wrong with using a hex editor?
Re: Change the hex value
I need to automate but first I need to understand and ajust the code for my relay board. the code does more than I need.
Re: Change the hex value
space wrote:I need to automate but first I need to understand and ajust the code for my relay board. the code does more than I need.
Not sure what you mean. It only does one thing. It replaces the hex value in file and outputs it to a new file.
Re: Change the hex value
you can try also with certutil -> http://ss64.org/viewtopic.php?id=1562
At the moment I have no complete script that will replace your 84 value but it easy can be created with pure batch....
At the moment I have no complete script that will replace your 84 value but it easy can be created with pure batch....
Re: Change the hex value
space wrote:is there any code more easier for me to understand?
I wasn't sure what you meant either - but I think you are trying to decipher how repl.bat works internally.
Use it as a tool, like findstr or sort or wmic etc, and just learn the basic syntax that you need, for now.