Commit 9c532115 authored by Rafaël Carré's avatar Rafaël Carré

new script to set AppContainer flag

parent 3ec6fb79
#!/usr/bin/perl
# Copyright © 2011 Rafaël Carré <funman at videolanorg>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
#
use warnings;
if ($#ARGV < 0 || $#ARGV > 1) {
die "Usage: appcontainer.pl file";
}
my $file = $ARGV[0];
open F, "+<$file"
or die "Can't open `$file'";
binmode F;
seek F, 0x3c, 0;
my $offset = get_le(4);
seek F, $offset, 0;
if (get_le(4) != 0x00004550) { # IMAGE_NT_SIGNATURE
die "Not a NT executable";
}
seek F, 20 + 70, 1;
my $flags = get_le(2);
seek F, -2, 1;
$flags |= 0x1000; # App Container
printf F "%c%c", $flags & 0xff,($flags >> 8) & 0xff;
close F;
sub get_le {
my $bytes;
read F, $bytes, $_[0];
if (length $bytes ne $_[0]) {
die "Couldn't read";
}
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;
}
......@@ -158,7 +158,7 @@ do
done
rm `find tmp/plugins -name 'lib*plugin.dll' | grep -E "lib(${regexp})_plugin.dll"`
find tmp \( -name "*.dll" -o -name "*.exe" \) -exec ../extras/package/win32/peflags.pl -AppContainer {} \;
find tmp \( -name "*.dll" -o -name "*.exe" \) -exec ../../appcontainer.pl {} \;
cp lib/.libs/libvlc.dll.a tmp/libvlc.lib
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment