Skip to content

Instantly share code, notes, and snippets.

Avatar

Michel michel-pi

View GitHub Profile
@michel-pi
michel-pi / MessageBox.cs
Created Jun 20, 2021
Using NtRaiseHardError to display a MessageBox
View MessageBox.cs
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Undocumented.Windows
{
public static unsafe class MessageBox
{
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FError%2FNtRaiseHardError.html
private static readonly delegate* unmanaged[Stdcall]<uint, uint, uint, uint*, uint, uint*, uint> _ntRaiseHardError;
@michel-pi
michel-pi / FriendCode.cs
Created Jun 13, 2021
Generates friend codes for csgo or turns them into steam id's
View FriendCode.cs
using System;
using System.Buffers.Binary;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
namespace Csgo
{
public static class FriendCode
{
View visual-studio-extensions.txt
https://marketplace.visualstudio.com/items?itemName=josefpihrt.Roslynator2019
https://marketplace.visualstudio.com/items?itemName=SteveCadwallader.CodeMaid
https://marketplace.visualstudio.com/items?itemName=TeamXavalon.XAMLStyler
https://marketplace.visualstudio.com/items?itemName=MichaelKissBG8.Supercharger
https://marketplace.visualstudio.com/items?itemName=MadsKristensen.FileIcons
https://marketplace.visualstudio.com/items?itemName=EWoodruff.VisualStudioSpellCheckerVS2017andLater
https://marketplace.visualstudio.com/items?itemName=NikolayBalakin.Outputenhancer
https://marketplace.visualstudio.com/items?itemName=ironcev.sharpen
@michel-pi
michel-pi / open-recyclebin.cmd
Created Jan 11, 2021
opens the recycle bin in a new windows explorer window
View open-recyclebin.cmd
@echo off
start shell:RecycleBinFolder
exit
@michel-pi
michel-pi / cloudflare-dns.cmd
Created Jan 11, 2021
set cloudflare dns server with console
View cloudflare-dns.cmd
@echo off
netsh interface ipv4 set dnsservers name="Ethernet" validate=no static 1.1.1.1 primary > nul
netsh interface ipv4 add dnsservers name="Ethernet" validate=no 1.0.0.1 index=2 > nul
netsh interface ipv6 set dnsservers name="Ethernet" validate=no static 2606:4700:4700::1111 primary > nul
netsh interface ipv6 add dnsservers name="Ethernet" validate=no 2606:4700:4700::1001 index=2 > nul
ipconfig /flushdns > nul
View MemoryApi.cs
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
namespace ProcessMemoryTest.Native
{
[SuppressUnmanagedCodeSecurity]
public static unsafe class Kernel32
{
@michel-pi
michel-pi / wmi-events.txt
Created Jan 2, 2021
Windows 10 v2004 WMI Event Class List
View wmi-events.txt
__Event
__ExtrinsicEvent
Win32_DeviceChangeEvent
Win32_SystemConfigurationChangeEvent
Win32_VolumeChangeEvent
MSFT_WMI_GenericNonCOMEvent
MSFT_NCProvEvent
MSFT_NCProvCancelQuery
MSFT_NCProvClientConnected
MSFT_NCProvNewQuery
View ublock.txt
||consent.google.*
||www.gstatic.*/youtube/img/promos/growth/dmod_si_horizontal_ver1_240x400.png^
google.*##div#cnsw:remove()
google.*##div#swml:remove()
google.*##div#reviewDialog:remove()
google.*##div#lb:remove()
youtube.*##paper-dialog.ytd-consent-bump-lightbox:remove()
youtube.*##div#dialog.yt-upsell-dialog-renderer:remove()
@michel-pi
michel-pi / DateTimeFormat.php
Created Oct 12, 2020
Formats DateTime for usage in JSON and MySQL Databases
View DateTimeFormat.php
<?php
namespace MichelPi\Utils;
use DateTime;
class DateTimeFormat
{
private static $_jsonFormatString = 'Y-m-d\\TH:i:s.v\\Z';
private static $_mysqlFormatString = 'Y-m-d H:i:s';
@michel-pi
michel-pi / EnvironmentEx.cs
Created Apr 24, 2020
Retrieves all Environment Variables
View EnvironmentEx.cs
using System;
using System.Collections.Generic;
using System.Threading;
using System.Runtime.InteropServices;
namespace System
{
public static class EnvironmentEx
{
[DllImport("kernel32.dll", CharSet = CharSet.Ansi, SetLastError = true)]