Skip to content

Instantly share code, notes, and snippets.

PZ Read pzread

Block or report user

Report or block pzread

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View somethingwrong.c
#include<stdio.h>
#include<stdlib.h>
int loop(int x){
unsigned long a;
unsigned long *ptr;
ptr = &a;
if(x == 0){
return 0;
@pzread
pzread / package.md
Last active Aug 29, 2015
Judge Sketch
View package.md

Compress

The package is compressed in tar.xz format without top directory.

meta.json

{
  pkgid string      //Add by add_pkg API
  apiid string      //Add by add_pkg API, owner id
  when int64        //Add by add_pkg API
View upload.js
$.ajax({
'url':'/judge/api/' + api_key + '/add_pkg',
'type':'POST',
'data':pkg,
'cache':false,
'processData':false,
'contentType':false,
'xhr':function(){
var xhr = new XMLHttpRequest();
xhr.upload.addEventListener('progress',function(e){
View getcdinfo.py
import re
import requests
from bs4 import BeautifulSoup
def to_bom_utf8(name):
data = open(name, 'rb').read().decode('utf-8')
open(name, 'wb').write(data.encode('utf-8-sig'))
View check.cpp
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main() {
char str[100];
char ans[100];
FILE *ansf = fdopen(2, "r");
while(fgets(str, sizeof(str), stdin) != NULL) {
if(fgets(ans, sizeof(ans), ansf) == NULL) {
@pzread
pzread / userscript.js
Last active Apr 21, 2017
Mastodon Blocked Contents Loader
View userscript.js
// ==UserScript==
// @name Mastodon Blocked Contents Loader
// @namespace http://tampermonkey.net/
// @version 0.1
// @description shows how to use babel compiler
// @author PZ Read
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
// @match https://*/*
// ==/UserScript==
View test2.js
var objs = [];
var bases = [];
let oris = [];
let payloads = [];
for (let i = 0; i < 2; i++) {
objs.push([0x00010000]);
bases.push([0, 1]);
oris.push([100, 100, 100]);
payloads.push([0]);
View unsafe.rs
use std::collections::HashMap;
use std::mem;
struct Link {
pub value: String,
next: *const Link,
}
impl Link {
fn new(value: String, next: *const Self) -> Self {
View init.vim
set ai
set backspace=2
set cin
set et
set hidden
set mouse=
set nocompatible
set nu
set shiftwidth=2
set softtabstop=2
View textile.md

天衣無縫 ~ Fantastic Seamless Textile ~

When executing a ELF binary, Linux kernel will pass the memory address of PHDR(program header) to userspace by AT_PHDR entry of AUXV.

ld.so interpreter will parse the PHDR structure at memory addressAT_PHDR and resolve more ELF structures, such as dynamic section.

But Linux kernel wrongly calculate the PHDR address in memory.

NEW_AUX_ENT(AT_PHDR, load_addr + exec->e_phoff);
You can’t perform that action at this time.