Skip to content

Instantly share code, notes, and snippets.

@qsniyg
qsniyg / savetool.py
Created January 19, 2024 08:53
Wasteland 3 Save Editor
import lzf
import sys
import re
header_rgx = re.compile("^((?:(?:XLZF|[A-Za-z]+:=.*?)\n)+)".encode('utf-8'))
datasize_rgx = re.compile("(\nDataSize:=)([0-9]+)\n".encode('utf-8'))
savedatasize_rgx = re.compile("(\nSaveDataSize:=)([0-9]+)\n".encode('utf-8'))
def loadfile(filename):
with open(filename, mode='rb') as f:
@qsniyg
qsniyg / topdown.patch
Last active January 9, 2023 16:38
[PATCH] ntdll: Map top-down if DllCharacteristics include DYNAMIC_BASE.
---
dlls/ntdll/loader.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index a7e6d712df1..5f4b78e133c 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2279,8 +2279,9 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, const UNICODE_STRING *nt_nam
{
@qsniyg
qsniyg / gist:ee81ac05117e0f1edbce39a17ed4b85b
Created September 10, 2020 13:10
deobfuscator for protondb report ids
// https://www.protondb.com/data/counts.json
var get_token_from_counts = function(counts) {
return [counts.reports, counts.timestamp];
};
var token = [..., ...];
var deobfuscate = function(appid, token) {
return deobfuscate_sub(appid, token[0], token[1]);
};
@qsniyg
qsniyg / dxgi16.patch
Created July 15, 2020 23:01
DXGI 1.6 stubbing patch
diff --git a/dlls/dxgi/adapter.c b/dlls/dxgi/adapter.c
index ad4e4b1305..72f1a2df6b 100644
--- a/dlls/dxgi/adapter.c
+++ b/dlls/dxgi/adapter.c
@@ -145,7 +145,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *ifac
return hr;
}
- *output = (IDXGIOutput *)&output_object->IDXGIOutput4_iface;
+ *output = (IDXGIOutput *)&output_object->IDXGIOutput6_iface;
@qsniyg
qsniyg / getmousemovepointsex.patch
Last active March 31, 2020 19:00
Various experimental/untested patches for Mount & Blade
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 97a5ada922..aefce6b0c4 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -1310,7 +1310,18 @@ int WINAPI GetMouseMovePointsEx(UINT size, LPMOUSEMOVEPOINT ptin, LPMOUSEMOVEPOI
return -1;
}
- FIXME("(%d %p %p %d %d) stub\n", size, ptin, ptout, count, res);
+ FIXME("(%d %p %p %d %d) hack\n", size, ptin, ptout, count, res);
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 1b641f1b9d..a8f3470962 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -119,6 +119,7 @@ static const WCHAR dllW[] = {'.','d','l','l',0};
typedef struct _wine_modref
{
LDR_MODULE ldr;
+ ULONG initial_flags;
dev_t dev;
@qsniyg
qsniyg / nullvidc.patch
Created March 18, 2020 13:51
Null video codec driver
diff --git a/configure.ac b/configure.ac
index 7096e2fb66..90adbb9f92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3549,6 +3549,7 @@ WINE_CONFIG_MAKEFILE(dlls/ntoskrnl.exe)
WINE_CONFIG_MAKEFILE(dlls/ntoskrnl.exe/tests)
WINE_CONFIG_MAKEFILE(dlls/ntprint)
WINE_CONFIG_MAKEFILE(dlls/ntprint/tests)
+WINE_CONFIG_MAKEFILE(dlls/nullvidc)
This file has been truncated, but you can view the full file.
// @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
// ^ for LibreJS (this has to be the first comment in the file)
// ==UserScript==
// @name Image Max URL
// @namespace http://tampermonkey.net/
// @version 0.12.6
// @description Finds larger or original versions of images for 6100+ websites
// @description:ko 6100개 이상의 사이트에 대해 더 크거나 원본 이미지 찾는 스크립트
// @description:fr Trouve des images plus grandes ou originales pour plus de 6100 sites
This file has been truncated, but you can view the full file.
// @license http://www.apache.org/licenses/LICENSE-2.0 Apache-2.0
// ^ for LibreJS (this has to be the first comment in the file)
// ==UserScript==
// @name Image Max URL
// @namespace http://tampermonkey.net/
// @version 0.12.6
// @description Finds larger or original versions of images for 6100+ websites
// @description:ko 6100개 이상의 사이트에 대해 더 크거나 원본 이미지 찾는 스크립트
// @description:fr Trouve des images plus grandes ou originales pour plus de 6100 sites
@qsniyg
qsniyg / patch
Last active June 24, 2021 01:22
USVFS wine patch (included in wine 4.21+)
diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c
index 2b6a13fc0d..6798ecc8ff 100644
--- a/dlls/kernel32/file.c
+++ b/dlls/kernel32/file.c
@@ -754,7 +754,7 @@ HANDLE WINAPI FindFirstFileExW( LPCWSTR filename, FINDEX_INFO_LEVELS level,
status = NtOpenFile( &info->handle, GENERIC_READ | SYNCHRONIZE, &attr, &io,
FILE_SHARE_READ | FILE_SHARE_WRITE,
- FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT );
+ FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT );