This file contains 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
#include <stdio.h> | |
/*@ | |
requires \forall int i; 0<=i<=9 ==> x[i] == 0 || x[i] == 1; | |
requires 0 <= offset <= n; | |
assigns \nothing; | |
ensures 0 <= offset <= \result <=n; | |
ensures \result < n ==> |
This file contains 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
/* | |
* krpn.c - 逆ポーランド計算機カーネルモジュール(仮) | |
* | |
* ビルド方法: | |
* * /usr/src/samples/krpn にソースコードを置いてください。 | |
* * 同じディレクトリにKbuildファイルを作成し、以下を記載します。 | |
* | |
* obj-m := krpn.o | |
* | |
* * 以下の手順でビルドします。 |
This file contains 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 glob,pathlib,os,sys,subprocess | |
files = glob.glob("check/**/*.cocci", recursive=True) | |
fnum = len(files) | |
failed = 0 | |
import random | |
random.shuffle(files) | |
for f in files: | |
print(f) | |
fname_in_linux = f[len("check/"):-len("occi")] |
This file contains 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
#include <iostream> | |
#include <chrono> | |
#include <sys/mman.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <string.h> | |
using namespace std; |
This file contains 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
# Rough Count | |
# grep --include='*.c' --include='*.h' -r -oP '__attribute__\s*\(\(.+\)\)' ./linux | awk -F'__attribute__\\s*' '{print $2}' | sed 's/^((//' | sed 's/))$//' | sort | uniq -c | sort -nr > res.txt | |
1817 packed | |
362 __packed__ | |
199 unused | |
137 packed, aligned(4) | |
97 aligned(8) | |
73 always_inline | |
71 aligned(32) |
This file contains 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 argparse | |
import angr #angr8 | |
from angr import sim_options as so | |
import claripy | |
import logging | |
from struct import pack | |
from pwn import * | |
import angrop | |
bin_path = '' |