Skip to content

Instantly share code, notes, and snippets.

View ahmed605's full-sized avatar
🔬
RE'ing stuff

Ahmed Walid ahmed605

🔬
RE'ing stuff
View GitHub Profile
#include <windows.h>
#include <Psapi.h>
#include <stdio.h>
#define OLS_TYPE 40000
#define IOCTL_OLS_GET_DRIVER_VERSION \
CTL_CODE(OLS_TYPE, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_OLS_READ_MSR \
CTL_CODE(OLS_TYPE, 0x821, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_OLS_WRITE_MSR \
@Orangera1n
Orangera1n / Windows build repo.md
Last active April 23, 2025 02:03
Orangera1n's Windows Build Repo

Notice:

This project is being formally deprecated (informally, it was a while ago) as of today due to various factors:

  • builds being corrupted, likely due to rclone vfs cache mounts messing with them, and due to the nature of onedrive, there being no way to collect hashes in bulk without ugly hacks
  • me being busy and lack of time to work on this often
  • onedrive being a pain to download from
  • having to split shit accorss many accounts, making management painful
  • less control
  • me getting a new ISP thats fast enough for hosting this on a proper server (with dedup) (about that: join here for updates: https://discord.gg/rFNeu7ZyQ2)
@ThioJoe
ThioJoe / Copy-GPU-Drivers-VM.ps1
Last active April 20, 2025 04:34
PowerShell script to copy GPU drivers to Hyper-V Virtual Machine for passthrough.
# Description: This script will automatically copy the necessary GPU drivers from your current host machine into a Hyper-V Virtual Machine
# so you can pass through the GPU to the VM. You should run this whenever you update your graphics drivers on the host.
#
# Author: ThioJoe -- https://github.com/ThioJoe
#
# Note: Currently this only works for Nvidia GPUs. But it does support if you have multiple GPUs.
#
# OPTIONAL ARGUMENTS:
# -debug | Enables debug messages that pause the script for each step (No additional string required, just add -debug)
# -name | Sets the virtual machine name so it doesn't need to ask
@ThioJoe
ThioJoe / Allocate-GPUs-VM.ps1
Last active April 20, 2025 04:35
PowerShell script to allocate and pass through GPU to Hyper-V Virtual Machine
# Script to easily set resource allocation for GPUs to be passed through into a Hyper-V VM
#
# Author: ThioJoe / https://github.com/thiojoe
#
### Instructions for copying drivers to VM - Will likely need to do this before running this script
# NOTE: Instead of manually copying the files, if you have an Nvidia GPU you can use my other script called "Copy-GPU-Drivers-VM.ps1" to do it automatically
# 1. Open C:\Windows\System32 on host machine and copy any files beginning with "nv" (Except nvspinfo.exe and NvAgent.dll , which are unrelated)
# 2. Place those files into the System32 folder on the VM
# 3. On the VM, create the following directory: C:\Windows\System32\HostDriverStore\FileRepository
# 4. For Nvidia GPUs, open C:\Windows\System32\DriverStore\FileRepository, copy any folders beginning with "nv_" (The number of folders should match the number of GPUs, or at least number of different models of GPU)
// ==UserScript==
// @name Powerful Bing Chat/AI
// @name:zh-CN 强大的 Bing Chat/AI
// @version 1.0.0
// @description To bypass the turns limit per session. To bypass the restrictions of Bing Chat/AI or restore the old Sydney by appending presets to your messages. And also a presets manager.
// @description:zh-CN 绕过每回合条数限制,无限制的BingChat,找回Sydney,prompt 预设管理器
// @author make-safe-ai
// @namespace make-safe-ai.com
// @homepage https://www.make-safe-ai.com/is-bing-chat-safe/
// @match *://www.bing.com/search*
Product Code Product Name Expanded Code
OEM0 Surface Mini
OEMB Surface_3
OEMC Surface_Pro_3
OEMS Surface_2 Covington
OEMA0 Andromeda
OEMAL Surface_Go_3_1901 Alishan
OEMAP Surface_Pro_4
OEMB1 Surface Duo
@NSG650
NSG650 / NtGdiGetCharWidthInfo_DoS_PoC.c
Last active February 8, 2023 10:21
Denial of Service bug in Windows Insider build 25284.1000 NtGdiGetCharWidthInfo
// This works on Windows 11 Build 25290.1010 as well
#include <stdio.h>
#include <windows.h>
// Ripped out from ReactOS
typedef struct _CHWIDTHINFO // Based on FD_DEVICEMETRICS
{
LONG lMinA;
LONG lMinC;
@jaigak
jaigak / AppWindowHwnd.cpp
Last active October 30, 2022 10:05
Showcases how to get the handle (HWND) of an UWP app window
__interface __declspec(uuid("b74ea3bc-43c1-521f-9c75-e5c15054d78c")) IApplicationWindow_HwndInterop : IInspectable
{
// <summary>
// Gets the window handle of this AppWindow instance as a bit-blitted WindowId.
// </summary>
// <remarks>To get the actual ID, use [CoreAppWindowPreview::GetIdFromWindow](https://docs.microsoft.com/en-us/uwp/api/windows.ui.core.preview.coreappwindowpreview.getidfromwindow?view=winrt-22621). This method returns the handle (HWND) of the window.
HRESULT __stdcall get_WindowHandle(Windows::UI::WindowId* windowId) noexcept;
};
using IsWindow = int(__stdcall*)(HWND hwnd);
@dongle-the-gadget
dongle-the-gadget / MainWindow.xaml
Last active May 29, 2024 17:08
WinUI 3 + Windows.UI.Composition
<Window
x:Class="WinUIThreeTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WinUIThreeTest"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<SwapChainPanel Name="SwapChainPanel">
@dongle-the-gadget
dongle-the-gadget / WinUI-2.8-prerelease-activatable-classes.xml
Created January 2, 2022 15:36
List of activatable classes from WinUI 2.8 prerelease
<asmv3:file name="Microsoft.UI.Xaml.dll">
<activatableClass name="Microsoft.UI.Xaml.XamlTypeInfo.XamlControlsXamlMetaDataProvider" threadingModel="both" xmlns="urn:schemas-microsoft-com:winrt.v1"></activatableClass>
<activatableClass name="Microsoft.UI.Xaml.Media.RevealBorderBrush" threadingModel="both" xmlns="urn:schemas-microsoft-com:winrt.v1"></activatableClass>
<activatableClass name="Microsoft.UI.Xaml.Media.RevealBackgroundBrush" threadingModel="both" xmlns="urn:schemas-microsoft-com:winrt.v1"></activatableClass>
<activatableClass name="Microsoft.UI.Xaml.Media.AcrylicBrush" threadingModel="both" xmlns="urn:schemas-microsoft-com:winrt.v1"></activatableClass>
<activatableClass name="Microsoft.UI.Xaml.Media.RevealBrush" threadingModel="both" xmlns="urn:schemas-microsoft-com:winrt.v1"></activatableClass>
<activatableClass name="Microsoft.UI.Xaml.Media.RadialGradientBrush" threadingModel="both" xmlns="urn:schemas-microsoft-com:winrt.v1"></activatableClass>
<activatableClass name="M