- Ilfak's presentation at Recon 2018
- Microcode in pictures
- Hex-Rays Microcode API vs. Obfuscating Compiler
- Scripts vds10, vds11, vds12 and vds13 from Hex-Rays SDK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
Copyright (c) 2020-2021, Andrea Fioraldi | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
import struct | |
s = set() | |
t = set() | |
for x in range(2**16): | |
y = (((x & 0xFFC) << 16) - 0x14C437BE) ^ ((x & 0xF0) << 8) | ((x & 0xFFC) << 8) | ((x >> 8) << 24) | x & 0xFC | |
y = ctypes.c_uint32(y).value | |
# print hex(x), hex(y) | |
if not y in s: |
This approach uses update-alternatives to manage GCC and LLVM/CLANG C/C++ compiler toolchains.
Although tested on Linux Mint 18.3, this approach should work on any Debian based distro or for that matter any Linux distro with update-alternatives
support, provided the packages are installed correctly.
There are 3 files
gcc-alternatives.sh
installs GCC versions 5/6/7 and sets up alternatives forgcc
/g++
/cpp
/gfortran
.llvm-clang-alternatives.sh
installs LLVM and CLANG versions 4/5 and sets up alternatives for various LLVM and CLANG programs includingclang
andclang++
.cc-alternatives.sh
sets up alternatives for thecc
,cxx
, and theld
commands. This script can be used to change systemwide default compiler/linker combination to either GCC or CLANG.
Once these scripts are run you can change the system GCC/CLANG versions by running sudo update-alternatives --config gcc|clang
. To change the default compiler/linker combo used by t
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set timeout=3 | |
menuentry 'Linux diskless' --class os { | |
insmod efi_gop | |
insmod efi_uga | |
# set server from option 66 (tftp-server-name) if not exist, use next_server | |
if ! net_get_dhcp_option net_default_server ${net_default_interface} 66 string; then | |
echo ' using next_server option instead.' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# build wine Docker image | |
pushd wine; docker build -t wine .; popd | |
# build x11 Docker image for IDA | |
pushd ida; docker build -t wine/ida .; popd | |
# demonstrate x11 forwarding works | |
docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix wine/ida xclock | |
# interactive shell in container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Rx: | |
"has the nums of a treatment, its name and rank" | |
def __init__(i,lst): | |
i.rx, i.lst = lst[0], lst[1:] | |
i.mean = sum(i.lst)/len(i.lst) | |
i.rank = 0 | |
def __repr__(i): | |
return 'rank #%s %s at %s'%(i.rank,i.rx,i.mean) | |
def a12s(lst,rev=True,enough=0.66): |