add a build tool command which can strip timestamps from PE files (for my own use).

not even committing the built buildtool exe since we're not using it.
This commit is contained in:
zeromus 2017-12-04 00:59:40 -06:00
parent 05f165af1f
commit 6c1e45963e
1 changed files with 10 additions and 0 deletions

View File

@ -18,6 +18,7 @@ namespace BizHawk.Build.Tool
case "GIT_REV": SVN_REV(false,cmdArgs); break;
case "NXCOMPAT": NXCOMPAT(cmdArgs); break;
case "LARGEADDRESS": LARGEADDRESS(cmdArgs); break;
case "TIMESTAMP": TIMESTAMP(cmdArgs); break;
}
}
@ -113,6 +114,15 @@ namespace BizHawk.Build.Tool
}
}
//clears the timestamp in PE header (for deterministic builds)
static void TIMESTAMP(string[] args)
{
using (var fs = new FileStream(args[0], FileMode.Open, FileAccess.ReadWrite, FileShare.Read))
{
fs.Position = 0x88;
fs.WriteByte(0); fs.WriteByte(0); fs.WriteByte(0); fs.WriteByte(0);
}
}
//sets NXCOMPAT bit in PE header
static void NXCOMPAT(string[] args)