#include <iostream>
#include <fstream>
#define LOG(x) std::cout << #x << " = " << x << std::endl
int main() {
{
std::cout << "ofstream(\"/tmp\")" << std::endl;
std::ofstream f("/tmp");
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### GDB DEV | |
function gdb-conf { | |
if [ "$#" -lt 1 ]; then | |
echo "Usage: gdb-conf configure-path [additional args...]" | |
return | |
fi | |
conf=$1 | |
shift 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### GDB DEV | |
function gdb-conf { | |
if [ "$#" -lt 1 ]; then | |
echo "Usage: gdb-conf configure-path [additional args...]" | |
return | |
fi | |
conf=$1 | |
shift 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22:56:51 in ~/evelek | |
➜ cat main.c | |
#include <iostream> | |
int main() { | |
// below is a result of `pwn cyclic -n 8 1000` string added to `'a`' character | |
std::string s = "aaaaaaaabaaaaaaacaaaaaaadaaaaaaaeaaaaaaafaaaaaaagaaaaaaahaaaaaaaiaaaaaaajaaaaaaakaaaaaaalaaaaaaamaaaaaaanaaaaaaaoaaaaaaapaaaaaaaqaaaaaaaraaaaaaasaaaaaaataaaaaaauaaaaaaavaaaaaaawaaaaaaaxaaaaaaayaaaaaaazaaaaaabbaaaaaabcaaaaaabdaaaaaabeaaaaaabfaaaaaabgaaaaaabhaaaaaabiaaaaaabjaaaaaabkaaaaaablaaaaaabmaaaaaabnaaaaaaboaaaaaabpaaaaaabqaaaaaabraaaaaabsaaaaaabtaaaaaabuaaaaaabvaaaaaabwaaaaaabxaaaaaabyaaaaaabzaaaaaacbaaaaaaccaaaaaacdaaaaaaceaaaaaacfaaaaaacgaaaaaachaaaaaaciaaaaaacjaaaaaackaaaaaaclaaaaaacmaaaaaacnaaaaaacoaaaaaacpaaaaaacqaaaaaacraaaaaacsaaaaaactaaaaaacuaaaaaacvaaaaaacwaaaaaacxaaaaaacyaaaaaaczaaaaaadbaaaaaadcaaaaaaddaaaaaadeaaaaaadfaaaaaadgaaaaaadhaaaaaadiaaaaaadjaaaaaadkaaaaaadlaaaaaadmaaaaaadnaaaaaadoaaaaaadpaaaaaadqaaaaaadraaaaaadsaaaaaadtaaaaaaduaaaaaadvaaaaaadwaaaaaadxaaaaaadyaaaaaadzaaaaaaebaaaaaaecaaaaaaed |
Based on https://stackoverflow.com/a/27522149
11:00:31 in ~/playground
➜ cat check_dynlibs.cpp
#include <iostream>
#include <dlfcn.h>
#include <link.h>
using UnknownStruct = struct unknown_struct {
void* pointers[3];
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import marshal | |
import mod | |
print("Test code:") | |
print(mod.foo()) | |
print(mod.__doc__) | |
PYCFILE = '__pycache__/mod.cpython-36.pyc' | |
with open(PYCFILE, 'rb') as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# requires `pip install sqlalchemy` | |
import datetime | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import create_engine, Column, String, Integer, ForeignKey, DateTime, join, func | |
from sqlalchemy.orm import Session | |
import sqlalchemy as sa | |
import logging | |
logging.basicConfig() |
// copied from http://edoceo.com/notabene/ova-to-vmdk-to-qcow2
The OVA file is nothing more than a TAR archive, containing the .OVF and .VMDK files. Easy!
Using Evergreen ILS for example:
~ $ file Evergreen_trunk_Squeeze.ova
Evergreen_trunk_Squeeze.ova: POSIX tar archive (GNU)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from distutils.core import setup, Extension | |
mod = Extension('my_types', sources=['my_types.c']) | |
setup( | |
name='PackageName', | |
version='1.0', | |
description='This is a demo package', | |
ext_modules=[mod] | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Adds a command to GDB that let you specify prefix for a breakpoint. | |
E.g. you want to invoke `z foo` and make it so that it creates a breakpoint on `packageX.foo`. | |
With this command you just do `z prefix packageX.` and then `z SOMETHING` will | |
set a breakpoint at `packageX.SOMETHING`. | |
For more info on GDB API refer to its docs: | |
https://sourceware.org/gdb/onlinedocs/gdb/Commands-In-Python.html#Commands-In-Python | |
""" | |
import gdb |