Skip to content

Instantly share code, notes, and snippets.

@ssfang
ssfang / NtQueryInformationProcess.cpp
Last active January 23, 2020 11:51
Get N level parent process id
//#include <stdio.h>
#include <io.h>
#include <fcntl.h>
//#include <windows.h>
//typedef LONG (__stdcall *FPTR_NtQueryInformationProcess) (HANDLE, INT, PVOID, ULONG, PULONG);
//FPTR_NtQueryInformationProcess NtQueryInformationProcess;
// Retrieve function address from DLL
//NtQueryInformationProcess = (FPTR_NtQueryInformationProcess) GetProcAddress(GetModuleHandle("ntdll"), "NtQueryInformationProcess");
//if (NtQueryInformationProcess == NULL) {
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 20, 2025 23:02
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
### OR take a look at
### https://github.com/HotCakeX/Harden-Windows-Security
@0XDE57
0XDE57 / config.md
Last active April 22, 2025 18:51
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable. I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere No longer required: Enable HTTPS-Only Mode, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@absynce
absynce / DisableChromeUpdates.ps1
Created February 4, 2015 21:23
Disable Chrome updates in Windows via the registry.
# *******************************************
#
# Mod by: Jared M. Smith
# Mod on: 2015.01.14
# Mod y?: Disable Google Chrome updates.
#
# *******************************************
# Log method
function Log { Param([string]$message) Write-Host $message; }
@Manu343726
Manu343726 / cowbasic_string.hpp
Last active November 15, 2023 17:44
(conceptual) COW string implementation
/*
* A simple Copy On Write (COW) string implementation.
*
* Copyright © 2014 Manu Sanchez. @Manu343726 on GitHub, Stack Overflow, etc.
*
* manu343726.github.io
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
@mgronhol
mgronhol / fast-str.c
Last active October 23, 2024 16:28
Fast string compare
int fast_compare( const char *ptr0, const char *ptr1, int len ){
int fast = len/sizeof(size_t) + 1;
int offset = (fast-1)*sizeof(size_t);
int current_block = 0;
if( len <= sizeof(size_t)){ fast = 0; }
size_t *lptr0 = (size_t*)ptr0;
size_t *lptr1 = (size_t*)ptr1;
@ashelly
ashelly / getopt.c
Last active August 25, 2024 03:25
"Port of GNU getopt() to Win32 for anyone who's tired of dealing with getopt() calls in Unix-to-Windows ports." Ported by Pete Wilson. Recovered from the Internet Archive's snapshot of www.pwilson.net/sample.html.
/* Getopt for GNU.
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to [email protected]
before changing it!
Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@michaelij
michaelij / ArgumentParser.cs
Created June 23, 2013 08:23
Utility class for parsing command line arguments
using System;
using System.Collections.Specialized;
using System.Text.RegularExpressions;
namespace Utilities
{
/// <summary>
/// ArgumentParser class
/// Intelligent handling of command line arguments based on Richard Lopes' (GriffonRL's)
/// class at http://www.codeproject.com/Articles/3111/C-NET-Command-Line-Arguments-Parser