Skip to content

Instantly share code, notes, and snippets.

View davispuh's full-sized avatar

Dāvis davispuh

  • Latvia
View GitHub Profile
@davispuh
davispuh / steam_console_params.txt
Last active April 23, 2024 22:51
Steam client parameters, consoles commands and variables
-480p - Run tenfoot in 480p rather than 1080p
-720p - Run tenfoot in 720p rather than 1080p
-accesscode -
-all_languages - show longest loc string from any language
-batterytestmode - rapidly cycle battery percentages for testing
-bigpicture - Start in Steam Big Picture mode
-blefw -
-cafeapplaunch - Launch apps in a cyber cafe context
-candidates - Show libjingle candidates for local connection as they are processed
-ccsyntax - Spew details about the localized strings we load
@davispuh
davispuh / threads.txt
Created April 3, 2024 19:00
D lang gc_query() bottleneck
Thread 10 (Thread 0x7790d18006c0 (LWP 145629) "prog"):
#0 0x00007790db99f335 in __GI___clock_nanosleep (clock_id=clock_id@entry=0, flags=flags@entry=0, req=0x7790d17fa010, rem=0x7790d17fa020) at ../sysdeps/unix/sysv/linux/clock_nanosleep.c:48
#1 0x00007790db9aa3e7 in __GI___nanosleep (req=<optimized out>, rem=<optimized out>) at ../sysdeps/unix/sysv/linux/nanosleep.c:25
#2 0x0000631608891a8c in core.thread.osthread.Thread.sleep(core.time.Duration) ()
#3 0x00006316088b87f0 in core.internal.spinlock.SpinLock.yield(ulong) shared ()
#4 0x00006316088b879a in core.internal.spinlock.SpinLock.lock() shared ()
#5 0x00006316088c4343 in core.internal.gc.impl.conservative.gc.ConservativeGC.runLocked!(core.internal.gc.impl.conservative.gc.ConservativeGC.mallocNoSync(ulong, uint, ref ulong, const(TypeInfo)), core.internal.gc.impl.conservative.gc.mallocTime, core.internal.gc.impl.conservative.gc.numMallocs, ulong, uint, ulong, const(TypeInfo)).runLocked(ref ulong, ref uint, ref ulong, ref const(TypeInfo)) ()
#6 0x000
@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,