-2

How do I change hex values in a program with separate values like below? Is there any editors which support this? I believe that there should be methods to fix this.

(?? is any value which varies in every match. I don't know how many patterns there are, only the file.)

example(this is only an example):

SEARCH: 88 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 96 ?? ?? ?? ?? 1c 96 ?? ?? ?? ?? ?? ?? ?? 48 12 12 9d ?? ?? ?? ?? 96 ?? ?? ?? ?? ?? ?? 1c 96 ?? ?? ?? ?? ?? ?? ?? 47 1d 96 ?? ?? ?? ?? ?? ?? 1c 96 ?? ?? ?? ?? ?? ?? ?? 0b 1d

REPLACE: 88 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 96 ?? ?? ?? ?? 1c 96 ?? ?? ?? ?? ?? ?? ?? 48 12 12 9d ?? ?? ?? ?? 96 ?? ?? ?? ?? ?? ?? 1c 96 ?? ?? ?? ?? ?? ?? ?? 47 1d 96 ?? ?? ?? ?? ?? ?? 1c 96 ?? ?? ?? ?? ?? ?? ?? 0a 1d

PS. I'm a high schooler who is new to this area so I need people's help. Please don't mark me down(reputation>=1 please). Thank you very much. I believe this question is an original post, not too broad nor specific. Please fix me if my questioning format is incorrect.

Denny Kim
  • 1
  • 4

1 Answers1

2

If you're asking what I think you are, you may be able to do something like that which is explained here, https://stackoverflow.com/a/28634173/812606

It goes something like this:

hexdump -C Some/Path/To/Class/File.class | grep valtoreplace

Which will print something like the following

00005560  60 01 00 08 3a 38 30 38  30 22 3b 0a 0a 00 50 00  |valtoreplace','Y|

And you can (maybe) use its address to replace

echo -n a new value\',\'Y | dd conv=notrunc of=Some/Path/To/Class/File.class bs=1 seek=$((0x5560))
Community
  • 1
  • 1
Rahman Malik
  • 543
  • 6
  • 10