Skip to content

Instantly share code, notes, and snippets.

View Wenzel's full-sized avatar

Mathieu Tarral Wenzel

View GitHub Profile
@Wenzel
Wenzel / gist:2187306f8e581f32758686b49cec3684
Created November 20, 2020 12:45
libvmi examples images
libvmi images
#include "/usr/include/xenstore.h"
@Wenzel
Wenzel / mount_guestfs.py
Created February 4, 2019 19:50
Mount a qcow with libguestfs
#!/usr/bin/env python3
"""Mount qcow in libguestfs.
Usage:
mount_guestfs.py [options] <disk_path>
mount_guestfs.py (-h | --help)
Options:
-d --debug Enable debugging
/* The LibVMI Library is an introspection library that simplifies access to
* memory in a target virtual machine or in a file containing a dump of
* a system's physical memory. LibVMI is based on the XenAccess Library.
*
* Author: Tamas K Lengyel (tamas.lengyel@zentific.com)
*
* This file is part of LibVMI.
*
* LibVMI is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
/* The LibVMI Library is an introspection library that simplifies access to
* memory in a target virtual machine or in a file containing a dump of
* a system's physical memory. LibVMI is based on the XenAccess Library.
*
* Author: Tamas K Lengyel (tamas.lengyel@zentific.com)
*
* This file is part of LibVMI.
*
* LibVMI is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
@Wenzel
Wenzel / xen-emulate-response.c
Created September 13, 2018 21:41
vmi_step_event bug
/* The LibVMI Library is an introspection library that simplifies access to
* memory in a target virtual machine or in a file containing a dump of
* a system's physical memory. LibVMI is based on the XenAccess Library.
*
* Author: Tamas K Lengyel (tamas.lengyel@zentific.com)
*
* This file is part of LibVMI.
*
* LibVMI is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the
@Wenzel
Wenzel / script.r2
Created September 11, 2018 00:08
Show a bug in radare2 handling of hardware breakpoints
e dbg.hwbp=true
echo printing 10 opcodes
pd 10
echo setting breakpoint on next opcode
so 1
db $$
echo printing 10 opcodes, with breakpoint
pd 10
echo continue execution
dc
@Wenzel
Wenzel / packer.log
Created July 4, 2018 12:33
Packer build failed on Xen - QEMU failed to get HVM_PARAM_IOREQ_PFN
2018/07/04 12:23:52 ui: ==> qemu: Overriding defaults Qemu arguments with QemuArgs...
2018/07/04 12:23:52 packer: 2018/07/04 12:23:52 Executing /usr/bin/qemu-system-x86_64: []string{"-fda", "/tmp/packer822671350", "-name", "win7x64", "-cdrom", "/home/vagrant/packer_cache/2b74e82a7abe5592aac026c1d0d5da01dd5a8dfad148b31b32203d23739da902.iso", "-smp", "1", "-m", "2048M", "-machine", "type=pc,accel=xen", "-device", "e1000,netdev=user.0", "-vnc", "0.0.0.0:23", "-netdev", "user,id=user.0,hostfwd=tcp::2387-:5985", "-drive", "file=output-qemu/win7x64,if=ide,cache=writeback,discard=ignore,format=qcow2", "-boot", "once=d"}
2018/07/04 12:23:52 packer: 2018/07/04 12:23:52 Started Qemu. Pid: 10999
2018/07/04 12:23:53 packer: 2018/07/04 12:23:53 Qemu stderr: WARNING: Image format was not specified for '/tmp/packer822671350' and probing guessed raw.
2018/07/04 12:23:53 packer: 2018/07/04 12:23:53 Qemu stderr: Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restric
#!/usr/bin/env python3
"""
Usage:
bug_sstep.py [options] <vm_name> <symbol>
Options:
-h --help Show this screen.
--sstep Use singlestepping instead of emulation
@Wenzel
Wenzel / memdump.py
Created June 4, 2018 13:16
Create a memory dump using libvirt API
#!/usr/bin/env python3
"""MemDump.
Usage:
memdump.py [options] <vm_name>
Options:
-h --help Show this screen.
"""