Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
4b4963f3
Commit
4b4963f3
authored
Nov 08, 2011
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
peflags.py -> peflags.pl
parent
1476c5ee
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
63 additions
and
1 deletion
+63
-1
Makefile.am
Makefile.am
+1
-1
extras/package/win32/peflags.pl
extras/package/win32/peflags.pl
+62
-0
No files found.
Makefile.am
View file @
4b4963f3
...
@@ -767,7 +767,7 @@ endif
...
@@ -767,7 +767,7 @@ endif
find
$(win32_destdir)
-type
f
\(
-name
"*xml"
-or
-name
"*html"
-or
-name
'*js'
-or
-name
'*css'
-or
-name
'*hosts'
-or
-iname
'*txt'
-or
-name
'*.cfg'
-or
-name
'*.lua'
\)
-exec
$(U2D)
{}
\;
find
$(win32_destdir)
-type
f
\(
-name
"*xml"
-or
-name
"*html"
-or
-name
'*js'
-or
-name
'*css'
-or
-name
'*hosts'
-or
-iname
'*txt'
-or
-name
'*.cfg'
-or
-name
'*.lua'
\)
-exec
$(U2D)
{}
\;
#Enable DEP and ASLR for all the binaries
#Enable DEP and ASLR for all the binaries
find
$(win32_destdir)
-type
f
\(
-name
'*$(LIBEXT)'
-print
-o
-name
'*$(EXEEXT)'
-print
\)
-exec
$(top_srcdir)/extras/package/win32/peflags.p
y
{}
\;
find
$(win32_destdir)
-type
f
\(
-name
'*$(LIBEXT)'
-print
-o
-name
'*$(EXEEXT)'
-print
\)
-exec
$(top_srcdir)/extras/package/win32/peflags.p
l
{}
\;
find
$(win32_destdir)/plugins/
-type
f
\(
-name
'*.a'
-or
-name
'*.la'
\)
-exec
rm
-rvf
{}
\;
find
$(win32_destdir)/plugins/
-type
f
\(
-name
'*.a'
-or
-name
'*.la'
\)
-exec
rm
-rvf
{}
\;
package-win-base
:
package-win-common
package-win-base
:
package-win-common
...
...
extras/package/win32/peflags.p
y
→
extras/package/win32/peflags.p
l
View file @
4b4963f3
#!/usr/bin/env python
#!/usr/bin/perl
# -*- coding: utf8 -*-
#
# Copyright © 2011 Rafaël Carré <funman at videolanorg>
# Copyright © 2011 Rafaël Carré <funman at videolanorg>
#
#
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
...
@@ -18,40 +16,47 @@
...
@@ -18,40 +16,47 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
#
#
from
os
import
SEEK_CUR
use
warnings
;
from
sys
import
argv
if
(
$#ARGV
!=
0
)
{
die
"
Need exactly one argument
";
}
def
get_le
(
f
,
n
):
open
F
,
"
+<
$ARGV
[0]
"
array
=
bytearray
(
f
.
read
(
n
))
or
die
"
Can't open `
$ARGV
[0]'
";
if
len
(
array
)
!=
n
:
binmode
F
;
raise
Exception
(
'Reading failed!'
)
shift
=
0
ret
=
0
for
c
in
array
:
ret
=
ret
+
(
c
<<
shift
)
shift
=
shift
+
8
return
ret
###
seek
F
,
0x3c
,
0
;
my
$offset
=
get_le
(
4
);
seek
F
,
$offset
,
0
;
if
len
(
argv
)
!=
2
:
if
(
get_le
(
4
)
!=
0x00004550
)
{
# IMAGE_NT_SIGNATURE
exit
(
1
)
die
"
Not a NT executable
";
}
f
=
open
(
argv
[
1
],
'r+b'
)
seek
F
,
20
+
70
,
1
;
f
.
seek
(
0x3c
)
my
$flags
=
get_le
(
2
);
f
.
seek
(
get_le
(
f
,
4
))
seek
F
,
-
2
,
1
;
if
get_le
(
f
,
4
)
!=
0x00004550
:
# IMAGE_NT_SIGNATURE
$flags
|=
0x100
;
# NX Compat
raise
Exception
(
'Not a NT executable'
)
$flags
|=
0x40
;
# Dynamic Base
f
.
seek
(
20
+
70
,
SEEK_CUR
)
printf
F
"
%c%c
",
$flags
&
0xff
,(
$flags
>>
8
)
&
0xff
;
flags
=
get_le
(
f
,
2
)
close
F
;
f
.
seek
(
-
2
,
SEEK_CUR
)
flags
|=
0x100
# NX Compat
flags
|=
0x40
# Dynamic Base
f
.
write
(
bytearray
([
flags
&
0xff
,
(
flags
>>
8
)
&
0xff
]))
sub
get_le
{
my
$bytes
;
read
F
,
$bytes
,
$_
[
0
];
if
(
length
$bytes
ne
$_
[
0
])
{
die
"
Couldn't read
";
}
f
.
close
my
$ret
=
0
;
my
@array
=
split
//
,
$bytes
;
for
(
my
$shift
=
0
,
my
$i
=
0
;
$i
<
$_
[
0
];
$i
++
,
$shift
+=
8
)
{
$ret
+=
(
ord
$array
[
$i
])
<<
$shift
;
}
return
$ret
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment