Skip to content

Instantly share code, notes, and snippets.

View davispuh's full-sized avatar

Dāvis davispuh

  • Latvia
View GitHub Profile
@davispuh
davispuh / fastRemove.d
Last active March 6, 2024 17:44
Remove items from sorted array fast!
import std.algorithm : remove, sort;
import std.range : SortedRange;
void fastRemove(ref SortedRange!(int[]) list, const int[] itemsToRemove)
{
foreach (removeItem; itemsToRemove)
{
ulong index = list.lowerBound(removeItem).length;
if (index < hashes.length && list[index] == removeItem)
{
@davispuh
davispuh / deadlock_wine.c
Created December 4, 2023 01:03
Deadlock Wine
#include <windows.h>
CRITICAL_SECTION criticalSection;
LONG ExceptionHandler(EXCEPTION_POINTERS *ExceptionInfo) {
asm("int $0x03");
return EXCEPTION_CONTINUE_SEARCH;
}
DWORD ThreadFunction(void*) {
@davispuh
davispuh / ntdll_win.diff
Created November 28, 2023 18:05
LoL patching Windows ntdll.dll
7ff88aec4bdd: cc int3
7ff88aec4bde: cc int3
7ff88aec4bdf: cc int3
- 7ff88aec4be0: 40 53 rex push rbx
- 7ff88aec4be2: 48 83 ec 20 sub rsp,0x20
+ 7ff88aec4be0: 40 e9 5a 01 0d b6 rex jmp 0x7ff840f94d40
7ff88aec4be6: 48 8b d9 mov rbx,rcx
7ff88aec4be9: e8 1a 00 00 00 call 0x7ff88aec4c08
7ff88aec4bee: b2 01 mov dl,0x1
@@ -154985,8 +154984,8 @@ Disassembly of section .text:
@davispuh
davispuh / ntdll.diff
Created November 28, 2023 03:47
LoL patching ntdll.dll
@@ -43860,8 +43860,8 @@ Disassembly of section .data:
2368d: cc int3
2368e: cc int3
2368f: cc int3
- 23690: 48 8d a4 24 00 00 00 lea rsp,[rsp+0x0]
- 23697: 00
+ 23690: 40 e9 da 22 b8 f6 rex jmp 0xf6ba5970
+ 23696: 00 00 add BYTE PTR [rax],al
23698: 49 89 d0 mov r8,rdx
2369b: 89 ca mov edx,ecx
@davispuh
davispuh / stub.diff
Created November 23, 2023 21:00
LoL stub.dll 13.22 vs 13.23 changes
+imp.AcquireSRWLockExclusive
+imp.AcquireSRWLockShared
+imp.ChangeTimerQueueTimer
+imp.CheckRemoteDebuggerPresent
+imp.CloseClipboard
+imp.CloseHandle
imp.CoInitialize
imp.CompareStringEx
imp.CreateEventExW
+imp.CreateEventW
;void FileMetaDataProvider::setFileItem()
;{
1e220: push r15
1e222: push r14
1e224: push r13
1e226: push r12
1e228: push rbp
1e229: push rbx
1e22a: mov rbx,rdi
1e22d: sub rsp,0xa8
;void FileMetaDataProvider::setFileItem()
;{
1e220: push r15
1e222: push r14
1e224: push r13
1e226: push r12
1e228: push rbp
1e229: push rbx
1e22a: mov rbx,rdi
1e22d: sub rsp,0xa8
@davispuh
davispuh / experiments.patch
Created November 16, 2022 20:11
React Naviagtion patch experimenting
diff --git a/packages/drawer/src/views/DrawerView.tsx b/packages/drawer/src/views/DrawerView.tsx
index 19363aad..f53897c4 100644
--- a/packages/drawer/src/views/DrawerView.tsx
+++ b/packages/drawer/src/views/DrawerView.tsx
@@ -343,5 +343,7 @@ export default function DrawerView({ navigation, ...rest }: Props) {
const styles = StyleSheet.create({
content: {
flex: 1,
+ maxHeight: '100%',
+ overflow: 'clip' as any,
670530
690230
697990
832440
984700
1066560
1079080
1164900
1193480
1205280
@davispuh
davispuh / virtVM.rb
Last active February 17, 2022 03:21
Script to automaticaly unbind devices from host for PCI passthrough, also will bind back after VM is turned off
#!/usr/bin/env ruby
require 'pathname'
require 'open3'
require 'nokogiri'
require 'ostruct'
require 'shellwords'
require 'timeout'
VM_NAME = 'WindowsVM'