cd ~/src
git clone [email protected]:trailofbits/cxx-common.git
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
| /* | |
| * Copyright (c) 2018 Trail of Bits, Inc. | |
| */ | |
| #include "mcsema/Util/ProgressBar.h" | |
| #include <algorithm> | |
| #include <cinttypes> | |
| #include <cmath> | |
| #include <cstdio> |
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 logging | |
| import os | |
| import re | |
| from subprocess import call | |
| import sys | |
| def _convert_data(data): | |
| ''' | |
| 'data' is a string of the 'disassembled' bitcode (could be | |
| read in from file/stdin) |
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
| static bool TryExtractCMEQ_ASIMDMISC_Z(InstData &inst, uint32_t bits) { | |
| // bits | |
| // & 10111111001111111111110000000000 | |
| // -------------------------------- | |
| // 00001110001000001001100000000000 | |
| if ((bits & 0xbf3ffc00U) != 0xe209800U) { | |
| return false; | |
| } | |
| union { | |
| uint32_t flat; |
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
| 0: 89 f8 mov eax,edi | |
| 2: 0f b7 4c 24 18 movzx ecx,WORD PTR [rsp+0x18] | |
| 7: 81 f9 00 80 00 00 cmp ecx,0x8000 | |
| d: 0f 95 c1 setne cl | |
| 10: d3 e0 shl eax,cl | |
| 12: c3 ret |
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
| target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | |
| target triple = "x86_64-pc-linux-gnu-elf" | |
| %struct.Memory = type opaque | |
| %struct.State = type { %struct.ArchState, [32 x %union.VectorReg], %struct.ArithFlags, %union.anon, %struct.Segments, %struct.AddressSpace, %struct.GPR, %struct.X87Stack, %struct.MMX, %struct.FPUStatusFlags, %union.anon, %union.FPU, %struct.SegmentCaches } | |
| %struct.ArchState = type { i32, i32, %union.anon } | |
| %union.VectorReg = type { %union.vec512_t } | |
| %union.vec512_t = type { %struct.uint64v8_t } | |
| %struct.uint64v8_t = type { [8 x i64] } | |
| %struct.ArithFlags = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } |
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
| clang --target=armv8-pc-linux-gnu -m64 -c /tmp/test.c -o /tmp/test.o |
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
| /path/to/remill-build/tools/anvill/anvill-decompile-json-9.0 --spec /tmp/slice.json --ir_out /dev/stderr |
export CFLAGS="-fsanitize=address -ffunction-sections -fdata-sections -Wl,-dead_strip -Wl,-undefined,dynamic_lookup -Wno-unused-command-line-argument"
export CXXFLAGS="-fsanitize=address -ffunction-sections -fdata-sections -Wl,-dead_strip -Wl,-undefined,dynamic_lookup -Wno-unused-command-line-argument"
export CFLAGS="-fsanitize=address -ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,--allow-multiple-definition"
export CXXFLAGS="-fsanitize=address -ffunction-sections -fdata-sections -Wl,--gc-sections -Wl,--allow-multiple-definition"
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
| // Copyright 2020 Peter Goodman, all rights reserved. | |
| #include <cassert> | |
| #include <cstdint> | |
| #include <cstddef> | |
| #include <iostream> | |
| #include <type_traits> | |
| #include <vector> | |
| template<typename IntegralType_, unsigned kNumBits_, unsigned kShift_> |