Skip to content

Instantly share code, notes, and snippets.

@NeKzor
NeKzor / lib.rs
Last active April 17, 2024 11:25
LiveSplitOne + ASR + SAR
#![no_std]
use asr::{
future::{next_tick, retry},
signature::Signature,
time::Duration,
timer::{self},
watcher::Watcher,
Process,
};
@NeKzor
NeKzor / libc_ffi.ts
Last active December 29, 2023 18:35
Deno FFI feat. libc.
export const libc = Deno.dlopen(
"libc.so.6",
{
dl_iterate_phdr: {
parameters: ["function", "pointer"],
result: "i32",
},
readlink: {
parameters: ["buffer", "buffer", "isize"],
result: "isize",
  • Install SAR

  • Get SAR.asl (Right click -> Save as -> SAR.asl)

  • Add Scriptable Auto Splitter to layout

  • Browse and add SAR.asl as Script Path

@NeKzor
NeKzor / mastodon.js
Created November 9, 2022 16:19
Simple Mastodon bot in 100 lines.
const fetch = require('node-fetch');
const createHiddenField = (obj, fieldName, value) => {
Object.defineProperty(obj, fieldName, {
enumerable: false,
writable: true,
value: value,
});
};
@NeKzor
NeKzor / sixense_patch.js
Created November 29, 2019 21:28
Play Portal 2 Sixense Perceptual Pack without Senz3D camera.
const fs = require('fs');
const client_sixense = process.argv[2] || './portal2_sixense/bin/client_sixense.dll';
const module = fs.readFileSync(client_sixense);
const patch = [
[
// Fix crash in init
// cmp ecx 69
@NeKzor
NeKzor / dllmain.cpp
Last active March 1, 2023 05:36
Really simple hack that enables jumping in The Stanley Parable.
// cl /O2 /MD /LD dllmain.cpp /Fe:tsp-bhop
#include <cstring>
#include <memory>
#include <Windows.h>
#include <Psapi.h>
// client.dll Build 5454
#define IN_JUMP_OFFSET 0xF52670 // /src/game/client/in_main.cpp
#define KEYDOWN_OFFSET 0x165EF // /src/game/client/in_main.cpp
@NeKzor
NeKzor / efte_level_name.asl
Last active February 18, 2023 23:11
Read Lua 5.1 strings with Auto Splitting Language feat. Exodus from the Earth. Credits: @Skyrimfus
// Credits:
// Skyrimfus (original lua CE script, hash function)
// NeKz (conversion)
state("efte")
{
}
startup
{
@NeKzor
NeKzor / efte_console_commands.md
Last active February 1, 2023 16:26
Exodus from the Earth console commands. Dumped directly from memory.
Name Default Flags Help String
a_actorStats cmd - Print statistics on all actors
a_animMeshObb 1 N Make obb for animation
a_bladeUseContinuousInteraction 0 N use continuous interaction for blade effects
a_chaseCameraFixedAngles 1 N Camera angles are synchronized with vehicle angles
a_chaseCameraPitchLocal 1 N Chase camera pitch mode
a_chaseCameraRangeStep 1.0 N Chase camera range step
a_chaseCameraReactionTime 0.5 N Chase camera reaction time
a_chaseCameraTestHack 0 N Enable control of chase camera and vehicle at the same time
@NeKzor
NeKzor / fetch.js
Created August 31, 2020 17:16
One-liner fetch API for NodeJs. Fuck axios & co.
const fetch=(u)=>new Promise((x)=>require('https').request(u,{headers:{'User-Agent':'n^'}},(r)=>{let b='';r.on('data',(d)=>b+=d);r.on('end',()=>x(b));}).end());
// Example:
fetch('https://api.github.com/users/NeKzor/followers')
.then(JSON.parse)
.then((followers) => console.log(followers.length));
// > 15