Skip to content

Instantly share code, notes, and snippets.

View StarrFox's full-sized avatar
🦦

StarrFox

🦦
View GitHub Profile
import time
import ctypes
from enum import Enum
user32 = ctypes.windll.user32
def send_key(window_handle: int, key: Keycode):
user32.SendMessageW(window_handle, 0x100, key.value, 0)
user32.SendMessageW(window_handle, 0x101, key.value, 0)
@StarrFox
StarrFox / olaf.nim
Last active February 4, 2024 01:14
the Pointer problem
type
Obj = object
objField: int
Property = object
propField: float
RawType[T] = object
Pointer[T, Z] = object
when T is RawType[Z]:
An internal error occurred while type checking file "/home/starr/tmp/zz_Garbage/a.py": TypeError: Cannot read properties of undefined (reading 'category')
at isVariadicTypeVar (/nix/store/f0fzac5zfdnpiqk1ixd1m4pyyqcsy5jq-pyright-1.1.335/lib/node_modules/pyright/dist/pyright-internal/src/analyzer/types.ts:2703:17)
at forEach (/nix/store/f0fzac5zfdnpiqk1ixd1m4pyyqcsy5jq-pyright-1.1.335/lib/node_modules/pyright/dist/pyright-internal/src/analyzer/typePrinter.ts:254:37)
at Array.forEach (<anonymous>)
at printTypeInternal (/nix/store/f0fzac5zfdnpiqk1ixd1m4pyyqcsy5jq-pyright-1.1.335/lib/node_modules/pyright/dist/pyright-internal/src/analyzer/typePrinter.ts:247:62)
at Object.printType (/nix/store/f0fzac5zfdnpiqk1ixd1m4pyyqcsy5jq-pyright-1.1.335/lib/node_modules/pyright/dist/pyright-internal/src/analyzer/typePrinter.ts:100:12)
at printType (/nix/store/f0fzac5zfdnpiqk1ixd1m4pyyqcsy5jq-pyright-1.1.335/lib/node_modules/pyright/dist/pyright-internal/src/analyzer/typeEvaluator.ts:25810:28)
at ca
from b import A, B
type A = A[B]
#include <stdio.h>
int main() {int tape[30000];int position = 0;tape[position] += 13;while (tape[position] != 0){tape[position] -= 1;position += 1;tape[position] += 1;tape[position] += 1;position += 1;position += 1;position += 1;tape[position] += 1;tape[position] += 2;tape[position] += 2;position += 1;tape[position] += 2;position += 1;tape[position] += 1;position -= 1;position -= 5;}position += 2;position += 3;tape[position] += 4;tape[position] += 2;position += 1;tape[position] -= 3;position += 2;position += 6;position += 2;tape[position] += 5;tape[position] += 1;tape[position] += 1;tape[position] += 2;tape[position] += 6;while (tape[position] != 0){while (tape[position] != 0){position += 9;}tape[position] += 1;while (tape[position] != 0){position -= 9;}position += 1;position += 1;position += 1;position += 1;position += 5;tape[position] -= 1;}tape[position] += 1;while (tape[position] != 0){position += 8;while (tape[position] != 0){tape[position] -= 1;}position += 1;}position -= 2;position -= 4;position -= 1
[dependencies]
aes = "0.8"
ghash = "0.5"
vale didnt give entire cargo.toml bc trolling
attempted vale untrolling:
[package]
name = "aes_test"
version = "0.1.0"
def scramble_buffer(data: bytes, key: int):
buf = bytearray()
key_bytes = key.to_bytes(4, "little")
step = (((((key >> 3 & 0x8000 | key & 0x4000) >> 6 | key & 0x80) >> 1 | key & 0x20) >> 1 | key & 8) >> 3)
for b in data:
if ((step != 0) and (len(buf) != 0)) and (len(buf) % step == 0):
buf.append(buf[-1])
nim cpp --app:lib -d:release --threads:on imhex_plugin_test.nim
Hint: used config file '/home/starr/.choosenim/toolchains/nim-1.6.2/config/nim.cfg' [Conf]
Hint: used config file '/home/starr/.choosenim/toolchains/nim-1.6.2/config/config.nims' [Conf]
................................................................
CC: imhex_plugin_test.nim
/home/starr/.cache/nim/imhex_plugin_test_r/@mimhex_plugin_test.nim.cpp: In function ‘void initializePlugin()’:
/home/starr/.cache/nim/imhex_plugin_test_r/@mimhex_plugin_test.nim.cpp:90:18: error: request for member ‘Dl_469762049_’ in ‘true’, which is of non-class type ‘bool’
90 | NIM_TRUE.Dl_469762049_();
| ^~~~~~~~~~~~~
Error: execution of an external compiler program 'g++ -c -std=gnu++14 -funsigned-char -w -fmax-errors=3 -fpermissive -pthread -O3 -fno-strict-aliasing -fno-ident -fPIC -I/home/starr/.choosenim/toolchains/nim-1.6.2/lib -I/home/starr/code/nim/imhex_plugin_test -o /home/starr/.cache/nim/imhex_plugin_test_r/@mimhex_plugin_tes
❯ nix log /nix/store/yk7abvnisgnr9dyqsczqa0bz8980pw0b-imhex.drv
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/i0zq5hh6x85mjvd4i36cd2m3vyn3p8h6-mf301xichilkphgj6nrxwyrnaj5l4vnm-source
source root is mf301xichilkphgj6nrxwyrnaj5l4vnm-source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
fixing cmake files...
❯ nix build '.?submodules=1'
warning: Git tree '/home/starr/github.com/StarrFox/ImHex' is dirty
error: builder for '/nix/store/yk7abvnisgnr9dyqsczqa0bz8980pw0b-imhex.drv' failed with exit code 1;
last 10 log lines:
> -- libpl static library is being created
> CMake Error at lib/external/pattern_language/cli/CMakeLists.txt:14 (add_subdirectory):
> add_subdirectory given source "../external/cli11" which is not an existing
> directory.
>
>