Skip to content

Instantly share code, notes, and snippets.

View namazso's full-sized avatar
😂
👌

namazso

😂
👌
View GitHub Profile
@namazso
namazso / CMakeLists.txt
Created March 26, 2024 10:22
Universal function proxy
cmake_minimum_required(VERSION 3.28)
project(untitled C ASM)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "")
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "")
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
@namazso
namazso / pdb_parser_lite.cpp
Created April 18, 2018 17:49
A lightweight PDB parser that retrieves type and symbol CodeView streams.
/* MIT License
*
* Copyright (c) namazso 2018
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@namazso
namazso / config.json
Created February 21, 2024 01:52
Syanpse matrix.org media piggyback for Caddy
{
"match": [
{
"host": [
"matrix.yourdomain.com"
],
"path": [
"/_matrix/media/*/download/*/*",
"/_matrix/media/*/download/*/*/*",
"/_matrix/media/*/thumbnail/*/*"
@namazso
namazso / wg-nm-firewalld.md
Last active December 24, 2023 17:02
Wireguard VPN with NetworkManager and firewalld

WireGuard VPN setup with NetworkManager and firewalld

Prerequisites

This guide uses NetworkManager and firewalld. Both of these are installed and used by default on current versions of Red Hat Enterprise Linux and Fedora.

First, test that NetworkManager is in use:

# nmcli
@namazso
namazso / hwinfosharedmem.h
Last active October 27, 2023 07:41
Reverse engineered HWiNFO shared memory format
#pragma once
// HWiNFOSharedMem - Reverse engineered HWiNFO shared memory format
// Copyright (C) 2020 namazso
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
@namazso
namazso / ThemeManagerDemo.cs
Last active October 8, 2023 05:51
Setting themes with IThemeManager2 in C#
// Copyright (c) 2022 namazso <admin@namazso.eu>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
@namazso
namazso / mbrpart.c
Last active December 25, 2022 20:00
quick raw mbr partition editor
#define _CRT_SECURE_NO_WARNINGS
#define _FILE_OFFSET_BITS 64
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include <stdio.h>
enum { kSectorSize = 512 };
@namazso
namazso / large_files.c
Created January 23, 2020 05:17
Some helpers to handle large files with pure C
#define _CRT_SECURE_NO_WARNINGS
#define _FILE_OFFSET_BITS 64
#include <stdint.h>
#include <stdio.h>
/* while these are standard C functions used properly, your platform may require additional macros or
* settings to enable proper handling of files larger than 2 or 4 GB */
uint64_t large_getsize(FILE* fp)
{
fseek(fp, 0, SEEK_END);
@namazso
namazso / coff.ksy
Created January 13, 2022 20:41
Kaitai Struct YAML for COFF
meta:
id: coff
title: Common Object Format File
file-extension:
- obj
license: CC0-1.0
ks-version: 0.9
endian: le
doc-ref: https://wiki.osdev.org/COFF
seq:
@namazso
namazso / settings.json
Created February 22, 2022 09:20
MSYS2 in Windows terminal
{
"commandline": "cmd /c \"set MSYSTEM=MINGW32 && set LOGINSHELL=bash && C:\\msys64\\usr\\bin\\bash.exe --login\"",
"name": "MSYS2 MinGW 32-bit",
"icon": "C:\\msys64\\mingw32.ico"
},
{
"commandline": "cmd /c \"set MSYSTEM=MINGW64 && set LOGINSHELL=bash && C:\\msys64\\usr\\bin\\bash.exe --login\"",
"name": "MSYS2 MinGW 64-bit",
"icon": "C:\\msys64\\mingw64.ico"
},