Skip to content

Instantly share code, notes, and snippets.

Mārtiņš Možeiko mmozeiko

  • RAD Game Tools
  • Kirkland, WA
Block or report user

Report or block mmozeiko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
mmozeiko /
Last active Aug 29, 2015
AES in Python
from __future__ import print_function
import sys
import struct
rcon = [ \
0x01000000, 0x02000000, 0x04000000, 0x08000000,
0x10000000, 0x20000000, 0x40000000, 0x80000000,
0x1b000000, 0x36000000,
mmozeiko /
Created Jul 26, 2014
lz4 decompression in Python 2.x
# Warning: this implementation doesn't check if writes or reads will happen
# out of input/output buffer range, so that will generate IndexError exception
def LZ4_decompress(source, osize):
isize = len(source)
src = bytearray(source)
dst = bytearray(osize)
si = 0
View ScopeGuard11.h
#pragma once
template <class Fun>
class ScopeGuard
Fun f;
bool active;
View Expected.h
#pragma once
#include <exception>
#include <stdexcept>
#include <utility>
template <class T>
class Expected
View ipviking.cs
using Microsoft.Win32;
using System;
using System.Drawing;
using System.Windows.Forms;
class ipviking
class ScreenSaver : Form
public ScreenSaver(Rectangle bounds)
mmozeiko / gist:8770c6d35f67fdab9c7c
Last active Aug 29, 2015 with MinGW 4.9.2 (-fno-exceptions -msse2 -mfpmath=sse -O3 -ffast-math)
View gist:8770c6d35f67fdab9c7c
pushl %edi
pushl %esi
pushl %ebx
subl $8, %esp
movl 24(%esp), %edi
testl %edi, %edi
je L1
movl 28(%esp), %eax
movl 32(%esp), %ebx
movl 44(%esp), %esi
mmozeiko / gist:bd29519cd538b2989011
Last active Aug 29, 2015 with MinGW 4.9.2 (-fno-exceptions -msse2 -mfpmath=sse -O3)
View gist:bd29519cd538b2989011
pushl %ebp
pushl %edi
pushl %esi
pushl %ebx
subl $92, %esp
movl 112(%esp), %eax
testl %eax, %eax
je L1
movl 116(%esp), %ebp
movl 120(%esp), %ecx
mmozeiko / data.asm
Last active Feb 16, 2016
Create COFF file from scratch
View data.asm
;;; 1) get nasm assembler:
;;; 2) compile this with: nasm.exe data.asm -o data.obj
;;; 3) to test create simple C file main.c with:
;;; #include <stdio.h>
;;; extern const char MyGlobalVariable[];
;;; int main()
;;; {
;;; printf("%s\n", MyGlobalVariable);
;;; }
;;; 4) compile and link with data.obj: cl.exe main.c data.obj
You can’t perform that action at this time.