diff --git a/Docs/src/history.but b/Docs/src/history.but index 7c2fb70c..40083e91 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -26,7 +26,7 @@ Released on ??? ??rd, 20?? \b Added IntOp and System::Int64Op >>> operator -\b Plug-ins now set the ASLR, DEP, LAA and NOSEH PE flags (\W{http://sf.net/p/nsis/bugs/1188}{bug #1188}) +\b Plug-ins now set the ASLR, DEP, LAA, NOSEH and TS PE flags (\W{http://sf.net/p/nsis/bugs/1188}{bug #1188}) \b MakeNSIS exits with code 0 for various information commands (\W{http://sf.net/p/nsis/bugs/1193}{bug #1193}) diff --git a/SCons/utils.py b/SCons/utils.py index b0f250d4..1d561e90 100644 --- a/SCons/utils.py +++ b/SCons/utils.py @@ -131,38 +131,85 @@ def GetOptionOrEnv(name, defval = None): return os.environ[name] return defval -def EnablePESecurityFlagsHelper(filepath): +import struct +def FileUnpackRead(pack, size, f, fpos=None, defval=None): + r = defval + try: + if not fpos is None: f.seek(fpos) + r = struct.unpack(pack, f.read(size))[0] + finally: + return r +def ReadU16LE(f, fpos=None, defval=None): + return FileUnpackRead("