Skip to content

Instantly share code, notes, and snippets.

// Needed for registry stuff
#pragma comment(lib, "advapi32.lib")
// For message boxes
#pragma comment(lib, "user32.lib")
// Use wchar_t
#define _UNICODE 1
#define UNICODE _UNICODE
// Speed up build process with minimal headers.
@juntalis
juntalis / memmodule.py
Created November 22, 2012 02:03
MemModule.py
#!/usr/bin/env python
# encoding: utf-8
"""
memmodule.py.py
Created by Charles on 10/25/12.
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
BITS 32
%define MAX_PATH 0x1
%define SZWCHAR 0x2 ; sizeof(wchar_t)
%define u(x) __utf16__(x)
SECTION .data
storage:
hNtDll dd 0x0
hKernel32 dd 0x0
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
// Our shellcode buffer.
DWORD previous;
unsigned char *scbuffer, *start;
@juntalis
juntalis / libjit.py
Created December 7, 2012 19:28
CTypes Bindings to libjit
from ctypes import *
_libraries = {}
_libraries['libjit-0.dll'] = CDLL('libjit-0.dll')
STRING = c_char_p
jit_abi_vararg = 1
jit_abi_cdecl = 0
jit_abi_fastcall = 3
@juntalis
juntalis / jit.pyx
Created December 9, 2012 15:19
LibJit Cython Bindings WIP
try:
cimport cython
except:
# To please my IDE, I have to do this.
import Cython.Shadow as cython
#noinspection PyUnresolvedReferences
from jit.internals cimport initinternals, JitType
from libjit cimport *
import weakref
@juntalis
juntalis / libjit.pxd
Created December 9, 2012 15:21
Lib Jit Cythonic Declarations
"""
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.
This file was partially hand-written and partially generated with
the pyxelator script found in yasm's source tree. (under tools/python)
"""
if (!Object.keys) {
Object.keys = (function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({
toString : null
}).propertyIsEnumerable('toString'),
dontEnums = [
'toString',
'toLocaleString',
'valueOf',
// Type: JetBrains.ReSharper.VSI.OnlineHelp.MsdnOnlineHelpProvider
// Assembly: JetBrains.ReSharper.Product.VisualStudio.Internal, Version=7.0.97.60, Culture=neutral, PublicKeyToken=1010a0d8d6380325
// Assembly location: C:\Program Files (x86)\JetBrains\ReSharper\v7.0\Bin\JetBrains.ReSharper.Product.VisualStudio.Internal.dll
using JetBrains.ReSharper.Psi;
using System;
namespace JetBrains.ReSharper.VSI.OnlineHelp
{
public class MsdnOnlineHelpProvider : IOnlineHelpProvider
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Development\py.workspace\python-remote>rpy.cmd
(Interactive Console in Command Prompt)
>>> cmd.jump_table.name
u'DIR'
>>> newname = create_unicode_buffer('SOME_WEIRD_COMMAND')
>>> cmd.jump_table.name = cast(newname, c_wchar_p)
>>> ^C