Skip to content

Instantly share code, notes, and snippets.

View from X86ISelLowering.cpp
// LowerUINT_TO_FP_i64 - 64-bit unsigned integer to double expansion.
SDValue X86TargetLowering::LowerUINT_TO_FP_i64(SDValue Op,
SelectionDAG &DAG) const {
// This algorithm is not obvious. Here it is what we're trying to output:
movq %rax, %xmm0
punpckldq (c0), %xmm0 // c0: (uint4){ 0x43300000U, 0x45300000U, 0U, 0U }
subpd (c1), %xmm0 // c1: (double2){ 0x1.0p52, 0x1.0p52 * 0x1.0p32 }
#ifdef __SSE3__
haddpd %xmm0, %xmm0
View gist:9360721
### Keybase proof
I hereby claim:
* I am comex on github.
* I am comex ( on keybase.
* I have a public key whose fingerprint is 749D 8F67 6885 CFAC 2B97 AB99 F0A7 1091 32BB D021
To claim this, I am signing this object:
View do_insn.c
int __usercall VTDoer$LT$$x27a$GT$::do_insn::h70de8e53099fdf71dsc@<eax>(__int64 a1@<rdi>, unsigned __int64 a2@<r14>, __int64 a3@<r15>)
int result; // eax@2
__int64 v4; // rbx@3
int v5; // eax@3
__int64 v6; // rax@4
char *v7; // rdi@4
signed __int64 v8; // rbx@8
__int64 v9; // r14@16
__int64 (__fastcall *v10)(); // rax@22
View gist:3af9342be4009033509b
/* android 1.x/2.x the real youdev feat. init local root exploit.
* (C) 2009/2010 by The Android Exploid Crew.
* Copy from sdcard to /sqlite_stmt_journals/exploid, chmod 0755 and run.
* Or use /data/local/tmp if available (thx to ioerror!) It is important to
* to use /sqlite_stmt_journals directory if available.
* Then try to invoke hotplug by clicking Settings->Wireless->{Airplane,WiFi etc}
* or use USB keys etc. This will invoke hotplug which is actually
* our exploit making /system/bin/rootshell.
* This exploit requires /etc/firmware directory, e.g. it will
comex / fetchsymbols.c
Created May 8, 2015 06:06
4 year old code to talk to a DeveloperDiskImage service
View fetchsymbols.c
#include "MobileDevice.h"
#include <assert.h>
#include <unistd.h>
#include <sys/socket.h>
#define bswap32 __builtin_bswap32
static uint32_t read32(int fd) {
uint32_t ret;
assert(read(fd, &ret, sizeof(ret)) == sizeof(ret));
return bswap32(ret);
View iba.txt
This is the Industrial Bank & Agora. The currency of the IBA is
zorkmids (zm); the recordkeepor of zorkmids is the President.
Any person CAN join this contract by announcement. Any party to this
contract CAN leave it by announcement, unless e is involved in a
pending Offer.
import re, sys, os, shutil, email.Utils, datetime, json, hashlib
DELIM = '\n\n===============================================================================\n\n'
iba = open('iba.txt').read().strip()
sections = iba.split(DELIM)
ox = int('Offers' in sections[2])
holdings = {}
ibap = []
View dsc.c
// DySlim is complicated and requires writing 6GB to disk (if only temporarily).
// This lets you mount the dyld shared cache via FUSE; the resulting files are weird but readable by things like otool and strings.
// gcc -std=gnu99 -I/opt/local/include -L/opt/local/lib -D_FILE_OFFSET_BITS=64 -o dsc dsc.c -lfuse -framework CoreFoundation
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <stdio.h>
View gist:2522441
module Main where
import Data.ByteString (ByteString, index)
import qualified Data.ByteString as BS
import Data.List
type Offset = Int
scan :: Offset -> ByteString -> [Offset]
scan off bs
View ipdtest.cpp
#include <stdlib.h>
#include <stdio.h>
#include "OVR_CAPI.h"
int main()
ovrResult result = ovr_Initialize(NULL);
if (OVR_FAILURE(result)) {
ovrErrorInfo errorInfo;