Skip to content

Instantly share code, notes, and snippets.

@anzz1
anzz1 / compat_random.php
Last active February 4, 2022 04:14
compat_random.php
<?php
function bytelen($str) {
if (defined('MB_OVERLOAD_STRING') && (ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING) && extension_loaded('mbstring')) {
return mb_strlen($str, '8bit');
} else {
return strlen($str);
}
}
@anzz1
anzz1 / md5.cpp
Created February 12, 2022 09:23
md5.cpp
/* MD5
converted to C++ class by Frank Thilo (thilo@unix-ag.org)
for bzflag (http://www.bzflag.org)
based on:
md5.h and md5.c
reference implemantion of RFC 1321
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
local inspect ={
_VERSION = 'inspect.lua 3.1.0',
_URL = 'http://github.com/kikito/inspect.lua',
_DESCRIPTION = 'human-readable representations of tables',
_LICENSE = [[
MIT LICENSE
Copyright (c) 2013 Enrique García Cota
Permission is hereby granted, free of charge, to any person obtaining a
@anzz1
anzz1 / chrome\userChrome.css
Last active April 8, 2022 02:11
Add URL field back to "Add Bookmark" menu in Firefox
/* userChrome.css */
@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@namespace html "http://www.w3.org/1999/xhtml";
/* Add option to edit bookmark URLs under blue star menu */
#editBMPanel_locationRow {
visibility: visible !important;
}
@anzz1
anzz1 / testEME.html
Created April 10, 2022 23:32
testEME.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Test EME</title>
<script>
function testEME() {
// https://shaka-player-demo.appspot.com/support.html
var keySysConfig = [{
@anzz1
anzz1 / Enable-Privilege.ps1
Created April 21, 2022 04:08
Enable-Privilege.ps1
function Enable-Privilege {
<#
.SYNOPSIS
Enables or disables security privileges on a target process.
.DESCRIPTION
Enables or disables security privileges on a target process.
Multiple privileges can be set at once, separated by a comma.
@anzz1
anzz1 / gist:305fb0c502b5820f1ef7864ecf1665cd
Created May 3, 2022 00:24
Visual Studio 6.0 Crash Fix (Buffer Overflow)
// Microsoft Visual Studio 6.0
// Crash Fix (Buffer Overflow)
//
// Module: Resource Editor
// DEVRES.PKG v6.0.8168.0 - 17.6.1998 0:00
//
// Original SHA1 : 59afd55f13310dcdbfff777fe6f4c7d0a8191a82
// Fixed SHA1 : 00bb8497adca2467eaba022a34bf4fdafd3d7c6c
//
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
@anzz1
anzz1 / crc32.c
Created October 9, 2022 01:57
crc32.c
// crc32.c
static const unsigned int crc32_table[] =
{
0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9,
0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
@anzz1
anzz1 / md5.c
Created October 9, 2022 03:33
md5.c
// md5.c
#include <stdlib.h>
static char* bin2hex(const unsigned char* b, size_t len, char* s)
{
int i;
for (i = 0; i < len; i++)
{
s[i*2] = (b[i] >> 4) < 10 ? (b[i] >> 4) + 48: (b[i] >> 4) + 87;