External tool to look for a certain byte sequence in a file?

Do we know a utility which could monitor a file, search for a byte sequence and throw a notification if it is (not) found?

Here is why:

I’m struggling with a tough nut bug: Sometimes one particular actor type’s (a BP class) certain properties get reset when saving a map. This loss of data is not visible from the editor right away: everything looks good and works as expected throughout the current editor session (PIE and all). However when the editor is restarted and the map is loaded again, the data loss (if it occurred) is there.

The trouble is that I have no idea what triggers this behaviour. I tried everything I could think of (recompiling related BP classes, etc) but I was not able to make the bug show itself. It just happens every now and then while I’m working on stuff and usually only notice it the next morning when I fire up the editor again.

Now what would help me a lot is an instant notification when a broken map is written to disk: that would allow me to take note just what I was doing and test it for a repro.
I checked the map file in a hex editor and found the actor’s name and a couple of bytes after it. One of the properties which gets reset is a boolean so I saved the map with that flag on and off. Several bytes are different but I think this would be a reliable way to tell if the data has been reset.

Just an idea off the top of my head, but would a Checksum program work? One that you could verify a working copy and checksum it against the recently saved copy.

Hm, I’ve just compared two maps where the only functional difference was an actor’s boolean property on and off: there were many many differences between the files all over the place not just after the name of the changed actor. Plus I have to keep working on the map so the only thing I can rely on is that somewhere in there is the byte sequence representing a certain actor and it’s properties.

I whipped up a small python script which checks for a byte pattern which is the actor in question with it’s properties reset. It’s running in an infinite loop at the background and beeps if there is a match. We’ll see if it helps me catch this sneaky bug.

Yeah it’s not really working, the actor’s binary representation keeps changing over time even if the properties are unchanged. :frowning: I have no idea how to tell the good and bad states apart.