Parse File at compile time, but not embedded

cym13 via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 14 02:47:58 PDT 2016


On Tuesday, 7 June 2016 at 04:17:05 UTC, Pie? wrote:
> Ok, I will assume it will be able to be removed for release. It 
> is an easy check(just search if binary contains file info). I'm 
> sure an easy fix could be to write 0's over the data in the 
> binary if necessary.

Binaries aren't magical beings, if your string is there you can 
just
check for it as you would any other file:

     # Check
     grep "mysecret" mybinary

     # Replace if found
     sed "s/mysecret/garbage/g" mybinary

If your string is very small you may hit a problem though. I know 
gcc
for example sometimes maps little strings directly using mov
instructions and the numeric value of the string chars. So if your
string is very short it may be segmented in words, just adapt your
search from there.


More information about the Digitalmars-d-learn mailing list