When does Linux KVM emulate instructions?
graph LR
x86_emulate_instruction --> x86_emulate_insn
emulate_instruction --> x86_emulate_instruction
env = Environment( | |
CCFLAGS = ['-Wall', '-Werror'], | |
) | |
env.Program('mkdir_p_test', ['mkdir_p.c', 'test.c']) |
# Display integers as hex and decimal | |
import sys | |
def displayhook(item): | |
if isinstance(item, int) and not isinstance(item, bool): | |
print '0x{0:X} ({0})'.format(item) | |
elif isinstance(item, long): | |
print '0x{0:X}L ({0}L)'.format(item) | |
elif item is not None: | |
print repr(item) | |
sys.displayhook = displayhook |
#!/usr/bin/env python | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl | |
import sys | |
import argparse | |
ap = argparse.ArgumentParser() | |
ap.add_argument('--certfile') | |
ap.add_argument('--keyfile') | |
ap.add_argument('--port', type=int, default=443) |
using System; | |
using System.Text; | |
using System.Threading; | |
using System.Windows.Forms; | |
using WinformsExceptions; | |
static class Program | |
{ | |
/// <summary> |
version: '2' | |
services: | |
# MySQL Database | |
db: | |
image: mysql:5.6 | |
volumes: | |
- ./data/mysql:/var/lib/mysql | |
- ./mysql-entrypoint.sh:/custom-entrypoint.sh:ro |
import time | |
import struct | |
f = open(r'\\.\pipe\NPtest', 'r+b', 0) | |
i = 1 | |
while True: | |
s = 'Message[{0}]'.format(i).encode('ascii') | |
i += 1 | |
#!/usr/bin/env python3 | |
from __future__ import print_function | |
from tempfile import TemporaryFile | |
from binascii import hexlify | |
from ctypes import * | |
class StructHelper(object): | |
def __get_value_str(self, name, fmt='{}'): | |
val = getattr(self, name) |
#!/usr/bin/env python3 | |
# Show Linux NBD (Network Block Device) info | |
# Requires Python 3.7+ | |
# Author: Jonathon Reinhart | |
# License: MIT | |
from dataclasses import dataclass | |
from pathlib import Path | |
class NotConnected(Exception): | |
pass |
import string | |
def hexdump(src, length=16, sep='.'): | |
DISPLAY = string.digits + string.letters + string.punctuation | |
FILTER = ''.join(((x if x in DISPLAY else '.') for x in map(chr, range(256)))) | |
lines = [] | |
for c in xrange(0, len(src), length): | |
chars = src[c:c+length] | |
hex = ' '.join(["%02x" % ord(x) for x in chars]) | |
if len(hex) > 24: |