Skip to content

Instantly share code, notes, and snippets.

View dev-zzo's full-sized avatar

DJ Sunshine dev-zzo

View GitHub Profile
@dev-zzo
dev-zzo / vm80a.v
Created December 22, 2014 10:54
BM80A
//
// copyright (c) 2014 by 1801BM1@gmail.com
//______________________________________________________________________________
//
`timescale 1ns / 1ns
module vm80a
(
input pin_clk, // global module clock (no in original 8080)
input pin_f1, // clock phase 1 (used as clock enable)
@dev-zzo
dev-zzo / ff4save.bt
Last active August 29, 2015 14:12
010 Templates: FF4 Saves
//--------------------------------------
//--- 010 Editor v6.0 Binary Template
//
// File: ff4save.bt
// Author: DJ
// Revision: 1
// Purpose: Parse FF4 save slot.
//--------------------------------------
local int doSteam = -1;
@dev-zzo
dev-zzo / unpack-dlink.c
Created August 6, 2013 14:36
version 1 of D-LINK fw image unpacker.
@dev-zzo
dev-zzo / coffdump.py
Last active December 21, 2015 19:01
COFF dumper plugin
#
# BUGS:
#
# * Data is not handled at all.
#
# * Imports which are either IMPORT_NAME_NOPREFIX or IMPORT_NAME_UNDECORATE
# should be properly restored -- make a huge map?..
#
import idaapi
@dev-zzo
dev-zzo / info.txt
Created January 28, 2016 08:40 — forked from anonymous/info.txt
MS16-005 (CVE-2016-0009) Win32k Remote Code Execution Vulnerability info
MS16-005 (CVE-2016-0009) Win32k Remote Code Execution Vulnerability info
just look at PFTOBJ::bUnloadAllButPermanentFonts
@dev-zzo
dev-zzo / gpm.md
Created February 10, 2016 13:31
Global pointers misuse

Global pointer variables misused in C programs

TL;DR: load global variables into local ones before use.

I've spotted a quite widespread misuse of global pointer variables. The issue is easily demonstrated by the following simplified example.

struct some_type_t {
    int a1;
    int a2;
@dev-zzo
dev-zzo / ann.c
Created April 10, 2016 21:53
N-layer ANN
#include <stdio.h>
#include <malloc.h>
#include <math.h>
#include <stdlib.h>
//
// Generic N-layer neuron network code (using unipolar sigmoid activation function)
//
// Data type to operate on; typically double.
@dev-zzo
dev-zzo / github.py
Created May 11, 2016 12:41
GitHub API wrapper
"""
GitHub API v3 Wrapper
Ref: https://developer.github.com/v3/git/
"""
import base64
import json
import requests
#include <stdio.h>
#include <malloc.h>
struct _perceptron_t {
size_t weights_count;
float thfunc_param;
float weights[1];
};
typedef struct _perceptron_t perceptron_t;
@dev-zzo
dev-zzo / mp.c
Last active June 1, 2016 21:38
void matrix_multiply(const data_t *M, const data_t *x, data_t *y, size_t width, size_t height)
{
// assert(height > 0);
// assert(width >= 4);
// assert((width & 3) == 0);
IACA_START;
#if 1
if (height >= 4) {