[vlc-commits] peflags: add -AppContainer option
Rafaël Carré
git at videolan.org
Mon Jan 28 18:55:52 CET 2013
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Jan 28 18:55:24 2013 +0100| [415da293016efc689e749c580d35f5349008f692] | committer: Rafaël Carré
peflags: add -AppContainer option
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=415da293016efc689e749c580d35f5349008f692
---
extras/package/win32/peflags.pl | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/extras/package/win32/peflags.pl b/extras/package/win32/peflags.pl
index 14366fab..62ae010 100755
--- a/extras/package/win32/peflags.pl
+++ b/extras/package/win32/peflags.pl
@@ -18,12 +18,18 @@
use warnings;
-if ($#ARGV != 0) {
- die "Need exactly one argument";
+if ($#ARGV < 0 || $#ARGV > 1 || ($#ARGV == 1 && $ARGV[0] ne "-AppContainer")) {
+ die "Usage: peflags.pl [-AppContainer] file";
+}
+my $appContainer = 0;
+my $file = $ARGV[0];
+if ($#ARGV == 1 && ($ARGV[0] eq "-AppContainer")) {
+ $appContainer = 1;
+ $file = $ARGV[1];
}
-open F, "+<$ARGV[0]"
- or die "Can't open `$ARGV[0]'";
+open F, "+<$file"
+ or die "Can't open `$file'";
binmode F;
seek F, 0x3c, 0;
@@ -42,7 +48,9 @@ seek F, -2, 1;
$flags |= 0x40; # Dynamic Base
$flags |= 0x100; # NX Compat
$flags |= 0x400; # NO SEH
-#$flags |= 0x1000; # App Container
+if ($appContainer) {
+ $flags |= 0x1000; # App Container
+}
printf F "%c%c", $flags & 0xff,($flags >> 8) & 0xff;
More information about the vlc-commits
mailing list