Skip to content

Instantly share code, notes, and snippets.

View Bueddl's full-sized avatar

Sebastian Büttner Bueddl

View GitHub Profile
class replacement
{
public:
struct vmt_t
{
void (*dtor)(void* _this);
getter_fn_t *virtual_getter;
} *vmt;
void setter(int a)
class replacement
{
public:
void **vmt;
void setter(int a)
{
_setter(this, a);
}
class replacement
{
public:
void setter(int a)
{
_setter(this, a);
}
int getter() const
{
#include <iostream>
class my_class
{
public:
void test()
{
std::cout << "Hello C++" << std::endl;
}
@Bueddl
Bueddl / adobe-decrypt-serial.c
Created January 7, 2017 16:24
Adobe Serial Number Decrypter
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, const char *argv[])
{
int i, idx;
const char *adobe_cipher[] = {
"0000000001", "5038647192", "1456053789", "2604371895",
"4753896210", "8145962073", "0319728564", "7901235846",
@Bueddl
Bueddl / memfn_cast.cpp
Created January 8, 2017 00:15
cast class member functions to unsigned long (to obtain their addresses in code)
template<class T, class R, class... As>
constexpr unsigned long memfn_cast(R(T::*mfnp)(As...))
{
union {
unsigned long u_ul;
R(T::*u_mfnp)(As...);
} addr;
addr.u_mfnp = mfnp;
return addr.u_ul;
void node_param_value(std::shared_ptr<tag_node> &node, const std::string &value)
{
auto string = std::make_shared<xmlrpc::tag_node>("string");
string->append_child(std::make_shared<xmlrpc::text_node>(value));
node->append_child(string);
}
void node_param_value(std::shared_ptr<tag_node> &node, int value)
@Bueddl
Bueddl / plugin.sync_servers.php
Created January 9, 2017 20:41
XAseco Plugin to Sync Blacklist files across multiple gameservers
<?php
/* vim: set noexpandtab tabstop=2 softtabstop=2 shiftwidth=2: */
/**
* Sync servers plugin.
* Synchronizes black lists accross servers upon each round.
* Created by Bueddl
*
* Dependencies: none
*/
document ::= prolog element Misc*
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]
S ::= (#x20 | #x9 | #xD | #xA)+
NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D]
| [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF]
| [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
@Bueddl
Bueddl / rtti.cpp
Last active January 14, 2017 23:43
Runtime Type Information
#include <exception>
#include <iostream>
#include <unordered_map>
class object_base;
struct rt_type_info
{
const char *name;
const rt_type_info *base;