Skip to content

Instantly share code, notes, and snippets.

@nattybear
Created September 27, 2022 02:22
Show Gist options
  • Save nattybear/bbda0a1c5326f301cd14b6e18f24115b to your computer and use it in GitHub Desktop.
Save nattybear/bbda0a1c5326f301cd14b6e18f24115b to your computer and use it in GitHub Desktop.
Red [Needs: 'View]
view [
title "Replace Hex Data"
button "Binary Data" [
file: request-file
t1/text: form file
]
t1: text 400
return
button "Hex Table" [
table: request-file
t2/text: form table
]
t2: text 400
return
button "Replace" [
target: read/binary file
rows: split read table newline
foreach row rows [
pair: split row comma
if (length? pair) > 1 [
s: debase/base pair/1 16
r: debase/base pair/2 16
target: replace/all target s r
]
]
dst: append file "_replaced"
write/binary dst target
t3/text: "Saved!"
]
t3: text 400
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment