Skip to content

Instantly share code, notes, and snippets.

View h1994st's full-sized avatar
🧠
Focusing

Shengtuo Hu h1994st

🧠
Focusing
View GitHub Profile
@h1994st
h1994st / AttackContract.sol
Last active March 13, 2020 19:37
Solidity Basics
pragma solidity ^0.6.1;
import "VulnContract.sol";
/**
* Reference: https://blog.sigmaprime.io/solidity-security.html#reentrancy
*/
contract Attack {
VulnContract public vulnContract;
@h1994st
h1994st / example-debug.ll
Last active March 9, 2020 18:22
Program slice on function pointers
; ModuleID = 'example_2.bc'
source_filename = "example_2.c"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.test_type_t = type { i8*, i32, i32 (%struct.test_type_t*)* }
@test_instance_2 = internal global %struct.test_type_t { i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i32 0, i32 0), i32 0, i32 (%struct.test_type_t*)* @a_func }, align 8
@.str = private unnamed_addr constant [36 x i8] c"after calling the function pointer\0A\00", align 1
@.str.1 = private unnamed_addr constant [11 x i8] c"instance 2\00", align 1
@h1994st
h1994st / Solidity Contract C3.md
Last active June 29, 2018 03:54
C3 Linearization

第三题(加分题):自学C3 Linearization, 求以下 contract Z 的继承线

  • contract O
  • contract A is O
  • contract B is O
  • contract C is O
  • contract K1 is A, B
  • contract K2 is A, C
  • contract Z is K1, K2
@h1994st
h1994st / ff-tree.md
Last active January 8, 2016 15:47
Firefox Dependency Tree
           +---------------+
           |     id=0      |
           +---------------+
           ^       ^       ^
          /        |        \
    w=201/    w=101|         \w=1
        /          |          \
    +-----+     +-----+     +-----+
    |id=3 |     |id=5 |     |id=7 |
@h1994st
h1994st / 1. HTTP2 Dependency.md
Last active January 8, 2016 15:14
HTTP/2 Dependency & Priority