Run with Python:
pip-2.7 install cffi PYTHON=python2.7 sh go.sh
Run with PyPy:
pip-pypy install cffi PYTHON=pypy sh go.sh
| /* --- Usage --- */ | |
| g++ server.c -o server | |
| g++ client.c -o client | |
| ./server | |
| ./client 127.0.0.1 | |
| /* --- server.c --- */ | |
| #include <sys/socket.h> | |
| #include <netinet/in.h> | |
| #include <arpa/inet.h> |
Run with Python:
pip-2.7 install cffi PYTHON=python2.7 sh go.sh
Run with PyPy:
pip-pypy install cffi PYTHON=pypy sh go.sh
| package com.company; | |
| import javax.crypto.Cipher; | |
| import javax.crypto.Mac; | |
| import javax.crypto.spec.IvParameterSpec; | |
| import javax.crypto.spec.SecretKeySpec; | |
| import java.security.MessageDigest; | |
| import java.security.SecureRandom; | |
| public class Main { |
| #if !defined(__GNUC__) || ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800) | |
| # error "This program requires GNU C compiler v4.8+!" | |
| #endif | |
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #define PRINT_TEST_CPU_SUPPORT_RESULT(inst) printf("\t%-7s: %d\n", inst, __builtin_cpu_supports(inst)?1:0) | |
| #define PRINT_TEST_CPU_TYPE_RESULT(inst) printf("\t%-12s: %d\n", inst, __builtin_cpu_is(inst)?1:0) |
| #include <stdio.h> | |
| int main() | |
| { | |
| volatile int i = 0; | |
| while (i < 100000000) { | |
| asm ("xbegin ABORT"); | |
| i++; | |
| asm ("xend"); | |
| asm ("ABORT:"); |
| #include <stdio.h> | |
| /* | |
| * This program checks SGX availability by checking CPUID | |
| * Relevant spec sections: 1.7 (and 1.7.1 and 1.7.2) | |
| * 2015-08-14 Nico Weichbrodt | |
| */ | |
| /* | |
| * Helper function for CPUID querying |
| // clang -std=c11 -mavx avxvec.c -o avxvec | |
| #include <x86intrin.h> | |
| #include <stdio.h> | |
| // see https://software.intel.com/sites/landingpage/IntrinsicsGuide/#techs=AVX | |
| int main() { | |
| double mem[4] = {1.0, 2.0, 3.0, 4.0}; | |
| //__m256d v = _mm256_load_pd(mem); | |
| __m256d v = _mm256_set_pd(1, 2, 3, 4); // (e3, e2, e1, e1) | |
| __m256d sq = _mm256_mul_pd(v, v); |
| #!/usr/bin/env python | |
| __author__ = 'Mahmood S. Zargar' | |
| import poppler | |
| import sys | |
| import urllib | |
| import os | |
| def main(): |
| Hello libtls - libressl libtls API sample program |
| simple-rop: simple-rop.c | |
| gcc -m32 -O0 -g -static -fno-stack-protector $^ -o $@ | |
| .PHONY: clean | |
| clean: | |
| rm -rf simple-rop |