Originally Posted by gingerbread
Scenario 3
If the value is not at a static offset/address? What if the position is always changing at every saving?
Scenario 4
What if you need to change at multiple location of a value is not at a static offset/address? What if the position is always changing at every saving?
Scenario 5
When to use Set Pointer?
Scenario 6
When to use Copy Operation?
Thank Aldo!!
|
Scenario 3a:
; the search sets the file pointer to the offset
search "a text value that is near the bytes that will be changed"
write next 3:"TEXT"
Scenario 3b:
Code:
; the 2 bytes CA CA will be searched starting from offset 0:
search 0xCACA
write next 0x100:0xCAFE
; the 2 bytes: CA FE are written 256 bytes after the 1st occurrence of CACA
; 0x100 = (256). If the bytes CA CA are not found, the write is not performed.
Scenario 4:
Code:
; the 4 bytes BE B0 CA FE will be searched 3 times starting from offset 0:
search 0xBEB0CAFE:3
write next (-512):0xDEADC0DE
; the 4 bytes: DE AD C0 DE are overwritten 512 bytes before the 3rd occurrence of BEB0CAFE
; If the bytes CA CA are not found, the write is not performed.
Scenario 5a
This is the scenario 4 written using a Set Pointer command:
Code:
; find 3rd occurrence of BEB0CAFE
search 0xBEB0CAFE:3
set pointer:-0x200
write next 0:0xDEADC0DE
Scenario 5b
Code:
;overwrite the last 4 bytes of the file
set pointer:lastbyte-0x4
write next 0:0xDEADC0DE
Scenario 6
I don't have idea... it is just a command that read the bytes from an static address and writes it in another place. Maybe it is not needed.
;Copy 16 bytes from offset 0x1000 to offset 0x2000
copy 0x1000:0x2000:16
copy 0x1000:0x2000:0x10
The BSD scripting language could be expanded in the future to cover even more scenarios... just need to describe me the scenario in detail
__________________
~ Dreams and dedication are a powerful combination.
... multiMAN is a perfect demonstration.