Ai
30 Star 75 Fork 414

openEuler/qemu
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
extract-vsssdk-headers 937 Bytes
一键复制 编辑 原始数据 按行查看 历史
#! /bin/bash
# extract-vsssdk-headers
# Author: Paolo Bonzini <pbonzini@redhat.com>
set -e
if test $# != 1 || ! test -f "$1"; then
echo 'Usage: extract-vsssdk-headers /path/to/setup.exe' >&2
exit 1
fi
if ! command -v msiextract > /dev/null; then
echo 'msiextract not found. Please install msitools.' >&2
exit 1
fi
if test -e inc; then
echo '"inc" already exists.' >&2
exit 1
fi
# Extract .MSI file in the .exe, looking for the OLE compound
# document signature. Extra data at the end does not matter.
export LC_ALL=C
MAGIC=$'\xd0\xcf\x11\xe0\xa1\xb1\x1a\xe1'
offset=$(grep -abom1 "$MAGIC" "$1" | sed -n 's/:/\n/; P')
tmpdir=$(mktemp -d)
trap 'rm -fr -- "$tmpdir" vsssdk.msi' EXIT HUP INT QUIT ALRM TERM
tail -c +$(($offset+1)) -- "$1" > vsssdk.msi
# Now extract the files.
msiextract -C $tmpdir vsssdk.msi
mv "$tmpdir/Program Files/Microsoft/VSSSDK72/inc" inc
echo 'Extracted SDK headers into "inc" directory.'
exit 0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/openeuler/qemu.git
git@gitee.com:openeuler/qemu.git
openeuler
qemu
qemu
stable-5.0

搜索帮助