Skip to content

Instantly share code, notes, and snippets.

#coding=utf-8
import sys,os
import re
from collections import defaultdict,namedtuple
from itertools import *
def scc(edges,redges):
def dfs(v):
used.add(v)
if v in edges:
#coding=utf-8
import sys,os
import re
from collections import defaultdict
from itertools import *
def scc(edges,redges):
def dfs(v):
used.add(v)
if v in edges:
------------------------------
8048d1c: 55 push ebp;
8048d1d: 89 e5 mov ebp,esp;
8048d1f: 57 push edi;
8048d20: 53 push ebx;
8048d21: 81 ec a0 02 00 00 sub esp,0x2a0;
8048d27: 8b 45 08 mov eax,DWORD PTR [ebp+0x8];
8048d2a: 89 85 84 fd ff ff mov DWORD PTR [ebp-0x27c],eax;
8048d30: 65 a1 14 00 00 00 mov eax,gs:0x14;
8048d36: 89 45 f4 mov DWORD PTR [ebp-0xc],eax;
------------------------------
8048d1c: 55 push ebp;
8048d1d: 89 e5 mov ebp,esp;
8048d1f: 57 push edi;
8048d20: 53 push ebx;
8048d21: 81 ec a0 02 00 00 sub esp,0x2a0;
8048d27: 8b 45 08 mov eax,DWORD PTR [ebp+0x8];
8048d2a: 89 85 84 fd ff ff mov DWORD PTR [ebp-0x27c],eax;
8048d30: 65 a1 14 00 00 00 mov eax,gs:0x14;
8048d36: 89 45 f4 mov DWORD PTR [ebp-0xc],eax;
Disassembly of section .text:
------------------------------
------------------------------
8048850: 31 ed xor ebp,ebp;
8048852: 5e pop esi;
8048853: 89 e1 mov ecx,esp;
8048855: 83 e4 f0 and esp,0xfffffff0;
8048858: 50 push eax;
8048859: 54 push esp;
804885a: 52 push edx;
#coding=utf-8
import sys,os
import re
from collections import namedtuple
from itertools import *
class Asm(object):
def __init__(self,address,binary,opecode,operand):
self.address = address
#coding=utf-8
import sys,os
import re
from collections import namedtuple
Code = namedtuple('Code',['address','binary','opecode','operand'])
def load_assembler(file_name):
part = re.compile(r"\s(?P<address>\w+):\s+(?P<binary>(\w\w\s)+)\s+((?P<opecode>\w+)(\s+(?P<operand>.*))?)?$")
data = [i.strip('\n') for i in open(file_name)]
#coding=utf-8
from subprocess import Popen,STDOUT,PIPE # Python 2.4以上が必要
import os
def next_line(stdout):
line = ""
while True:
r = stdout.read(1)
if r == '\n':
break
#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#! /usr/bin/python
import subprocess,glob,time
def execute(cmd):
print cmd
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for _ in xrange(10):
if p.poll() != None:
stdout_data, stderr_data = p.communicate()
return stdout_data