Skip to content

Instantly share code, notes, and snippets.

View is_windows_playing_sound.py
# SPDX-License-Identifier: MIT
from ctypes import c_int, POINTER, c_void_p, byref, c_float
from ctypes.wintypes import DWORD
from comtypes import GUID, IUnknown, STDMETHOD, HRESULT, COMMETHOD, CoCreateInstance
EDataFlow_eRender = 0
ERole_eMultimedia = 1
CLSID_MMDeviceEnumerator = GUID('{BCDE0395-E52F-467C-8E3D-C4579291692E}')
View conntest-handler.lua
require('luci.util')
local nx_redir = false
function http_date(time)
return os.date('!%a, %d %b %Y %H:%M:%S GMT', time)
end
function handle_request(env)
local send = uhttpd.send
if env.REQUEST_URI == '/' then -- NintendoWiFi
View luci-link.sh
View sha1.nut
// https://github.com/B-Con/crypto-algorithms/blob/master/sha1.c
const SHA1_BLOCK_SIZE = 20
class sha1_ctx
{
constructor()
{
data = array(64, 0);
datalen = 0;
View sha256.nut
// https://github.com/B-Con/crypto-algorithms/blob/master/sha256.c
const SHA256_BLOCK_SIZE = 32
class sha256_ctx
{
constructor()
{
data = array(64, 0);
datalen = 0;
View DialogFontFix.hpp
#pragma once
// DLGTEMPLATEEX structure
// https://docs.microsoft.com/en-us/windows/desktop/dlgbox/dlgtemplateex
const uint8_t* SkipIDorString(const uint8_t* p)
{
if (*reinterpret_cast<const uint16_t*>(p) == 0xFFFF)
return p + sizeof(uint16_t) * 2;
while (*reinterpret_cast<const uint16_t*>(p))
View classlist-to-ical.py
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import json, uuid, os, datetime
from datetime import time as tm
from functools import partial
open_utf8 = partial(open, encoding='utf-8')
ICAL_HEADER = r'''BEGIN:VCALENDAR
PRODID:-//ysc3839//classlist-to-ical.py//
@ysc3839
ysc3839 / padavan_mod.py
Last active May 9, 2020
MiWiFi R3 Firmware Mod
View padavan_mod.py
import sys, os
from zlib import crc32
from shutil import copyfileobj
from struct import calcsize
from io import SEEK_END
### uImage Header
### 64-byte header structure:
### uint32 magic_number
### uint32 header_crc
View raether.c
#include <linux/module.h>
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/if_vlan.h>
#include <linux/if_ether.h>
#include <linux/fs.h>
View CF_HDROP.py
from ctypes import windll, create_unicode_buffer, c_void_p, c_uint, c_wchar_p
kernel32 = windll.kernel32
GlobalLock = kernel32.GlobalLock
GlobalLock.argtypes = [c_void_p]
GlobalLock.restype = c_void_p
GlobalUnlock = kernel32.GlobalUnlock
GlobalUnlock.argtypes = [c_void_p]
user32 = windll.user32