Skip to content

Instantly share code, notes, and snippets.

View syjcnss's full-sized avatar

syjcnss syjcnss

View GitHub Profile
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
compilers: {
solc: {
version: "0.6.6",
settings: { // See the solidity docs for advice about optimization and evmVersion
optimizer: {
enabled: true,
runs: 999999
},
evmVersion: "istanbul",
const erc20abi = [
"function name() public view returns (string)",
"function symbol() public view returns (string)",
"function decimals() public view returns (uint8)",
"function totalSupply() public view returns (uint256)",
"function balanceOf(address _owner) public view returns (uint256 balance)",
"function transfer(address _to, uint256 _value) public returns (bool success)",
"function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)",
"function approve(address _spender, uint256 _value) public returns (bool success)",
"function allowance(address _owner, address _spender) public view returns (uint256 remaining)",
@syjcnss
syjcnss / CVE-2021-3156-exploit.c
Created February 1, 2021 10:38 — forked from WinMin/CVE-2021-3156-exploit.c
CVE-2021-3156-exploit
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <string.h>
/*
author: swing @ bestswngs@gmail.com
swpwn-pd@ubuntu:~/glibc-2.31$ uname -a
Linux ubuntu 5.8.0-41-generic #46~20.04.1-Ubuntu SMP Mon Jan 18 17:52:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
swpwn-pd@ubuntu:~/glibc-2.31$ cat /etc/issue
@syjcnss
syjcnss / su.c
Created December 16, 2020 13:22
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <time.h>
#include <pwd.h>
/*
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 3.18.71 (f00l@work) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) ) #68 SMP PREEMPT Fri Aug 14 01:06:41 CST 2020
[ 0.000000] CPU: AArch64 Processor [411fd070] revision 0
[ 0.000000] Detected PIPT I-cache on CPU0
[ 0.000000] alternative: enabling workaround for ARM erratum 832075
[ 0.000000] cma: Reserved 64 MiB at 0x00000000fc000000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv0.2 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
@syjcnss
syjcnss / ida
Last active August 11, 2020 11:14
#!/bin/bash
IDA_PATH=/opt/idapro-7.4/
base=`basename $0`
fn=$1
if [ "$#" -ne 1 ]; then
exe=$IDA_PATH/$base
else
@syjcnss
syjcnss / DumpHex.c
Created May 16, 2020 13:54 — forked from ccbrown/DumpHex.c
Compact C Hex Dump Function w/ASCII
#include <stdio.h>
void DumpHex(const void* data, size_t size) {
char ascii[17];
size_t i, j;
ascii[16] = '\0';
for (i = 0; i < size; ++i) {
printf("%02X ", ((unsigned char*)data)[i]);
if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') {
ascii[i % 16] = ((unsigned char*)data)[i];
#!/bin/sh
#MIRROR=http://ftp.sjtu.edu.cn/
MIRROR=https://mirrors.cloud.tencent.com/
debootstrap --components=main,restricted,universe,multiverse --include=git-core,gnupg,flex,bison,gperf,build-essential,zip,curl,zlib1g-dev,gcc-multilib,g++-multilib,libc6-dev-i386,lib32ncurses5-dev,x11proto-core-dev,libx11-dev,libgl1-mesa-dev,libxml2-utils,xsltproc,unzip --arch=amd64 trusty trusty/ $MIRROR/ubuntu
@syjcnss
syjcnss / hello.c
Created September 23, 2019 12:27
libfuse hello example
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU GPL.
See the file COPYING.
*/
/** @file
*