Skip to content

Instantly share code, notes, and snippets.

@paigeadelethompson
Last active July 11, 2023 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paigeadelethompson/ad522225c4c4f7dc1bfb2b7d93e4b03d to your computer and use it in GitHub Desktop.
Save paigeadelethompson/ad522225c4c4f7dc1bfb2b7d93e4b03d to your computer and use it in GitHub Desktop.
[General]
cleanup=true
noauth=false
unpack=true
bootstrap=Debian
aptsources=Debian
[Debian]
packages=wine wine32
source=http://deb.debian.org/debian
keyring=debian-archive-keyring
suite=stable
components=main contrib non-free
root@debian:/home/linux/i386-debian/bin# cat /proc/sys/fs/binfmt_misc/i386
enabled
interpreter /usr/bin/qemu-i386-static
flags:
offset 0
magic 7f454c46010000000000000000000000020003
mask fffffffffffefefffffffffffffffffffbffff
root@debian:/home/linux/i386-debian/bin# which /usr/bin/qemu-i386-static/usr/bin/qemu-i386-static
root@debian:/home/linux/i386-debian/bin# echo "7f454c46010000000000000000000000020003" | wc -c
39
root@debian:/home/linux/i386-debian/bin# xxd -p ls | head -c 39
7f454c460101010000000000000000000300030root@debian:/home/linux/i386-debian/bin# xxd -p ls | head -c 39 | wc -c
39
root@debian:/home/linux/i386-debian/bin# echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff:/usr/bin/qemu-i386-static:' > /proc/sys/fs/binfmt_misc/register
root@debian:/home/linux/i386-debian# chroot . /bin/bash
I have no name!@debian:/#
I have no name!@debian:/# ls
bin boot dev etc home lib lib64 proc root run sbin sys tmp usr var
I have no name!@debian:/#
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff:/usr/bin/qemu-i386-static:' > /proc/sys/fs/binfmt_misc/register
multistrap -a i386 -f multistrap.conf -d i386-debian
cp /usr/bin/qemu-i386-static i386-debian/usr/bin/qemu-i386-static
cd i386-debian
tar -cvf - . | docker import - wine:i386
xhost +
docker run -it --rm -v /media/psf/MS_Agent:/MS_Agent -v /tmp:/tmp -e "DISPLAY=:0" 4696f2c1bb45 /bin/bash
@paigeadelethompson
Copy link
Author

cat /bin/bash | xxd -p | fold -w 2 | head -n 128 | tr '\n' ' '
7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 03 00 b7 00 01 00 00 00 00 44 03 00 00 00 00 00 40 00 00 00 00 00 00 00 f0 84 14 00 00 00 00 00 00 00 00 00 40 00 38 00 09 00 40 00 1b 00 1a 00 06 00 00 00 04 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 f8 01 00 00 00 00 00 00 f8 01 00 00 00 00 00 00 08 00 00 00 00 00 00 00 03 00 00 00 04 00 00 00 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment