Skip to content

Commit 49b5023

Browse files
committed
Added PE32+ magic Number support to PE95TIME.LUA.
1 parent 44d9488 commit 49b5023

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

demo/xtra/PE95TIME.LUA

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env lua
1+
#!/usr/bin/env lua
22

33
I,X,V,H="<I4",0x80000000,809222400,[[This script edits timestamps in a PE formatted EXE to the Windows 95 release date.
44
This allows repeatable builds to be verified by checksum tools. Backup the EXE before using this tool on it.]]
@@ -9,7 +9,7 @@ function W(p,v)S(p)F:write(string.pack(I,v))end
99
function P()local mz=F:read(2)S(60)if mz=="MZ"then return R(4)end error("!MZ")end
1010
function O()
1111
S(J)local s,n,h,m=F:read(4)if s~="PE\0\0"then error("!PE")end C(2)n=R(2)C(12)s=R(2)C(2)h,m=C(),R(2)
12-
if m~=267 then error("!10")end S(h+s)
12+
if m~=267 and m~=523 then error("!MN")end S(h+s)
1313
for _=1,n do local u,o=C(),F:read(8):gsub("\0.*","")C(4)J=R(4)C(4)K=R(4)S(u+40)if o==".rsrc"then return end end error("!rsrc")end
1414
function B(p,s)
1515
S((p-J)+K)local d,t,k=F:read(s),("VS_VERSION_INFO"):gsub(".","\0%1").."\0\0"k=d:find(t,1,1)

0 commit comments

Comments
 (0)