Skip to content

Instantly share code, notes, and snippets.

-- ComponentGetValue2 for FloatArrayInline and Vec2ArrayInline reads one element out of bounds.
-- Can't really do anything interesting with this but it's a bug that should probably get fixed.
-- ComponentSetValue2 for Vec2ArrayInline writes waaay out of bounds if you give
-- it a big enough table. We can use this to corrupt a component that's placed
-- after it in memory.
-- vtable pointers are an interesting target!
-- This function takes a floating point value, and turns it into a floating
-- point value whose binary representation matches the first floating point
-- value.
--
-- For instance, the floating point number (A) 305419896.0 (hex 0x12345680) is encoded like this: 0x4d91a2b4
-- The floating point number (B) 5.69046046576341273665e-28 is encoded like this: 0x12345680
--
-- The function takes the number A and turns it into the number B.
--
-- This is used to place specific binary values into memory.
dear_imgui_path="$HOME/NoitaMods/NoitaDearImGui"
mkdir linux-build
cd linux-build/
cmake "$dear_imgui_path" \
-DCMAKE_INSTALL_PREFIX="$HOME/.local/share/Steam/steamapps/common/Noita/mods" \
-DCMAKE_CXX_FLAGS="-static" \
-DCMAKE_TOOLCHAIN_FILE="$dear_imgui_path/TC-mingw.cmake" \
-DCMAKE_BUILD_TYPE=Release
@dextercd
dextercd / PhysBodySetTransform.cpp
Last active December 29, 2022 01:57
BlueAmulet's PhysBodySetTransform body function
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <iterator>
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <dbghelp.h>
local imgui = load_imgui({version="1.0.0", name="test"})
local valuea = 0
function OnWorldPreUpdate()
if imgui.Begin("Main Window Title") then
imgui.Button("Drag start element")
if imgui.BeginDragDropSource() then
imgui.SetDragDropPayload("TEST", valuea)
imgui.Text("Testing")
local imgui = load_imgui({version="1.0.0", name="test"})
function OnWorldPreUpdate()
if imgui.Begin("Main Window Title") then
local available_width, available_height = imgui.GetContentRegionAvail()
if imgui.BeginChild("TopLeft", 0.2 * available_width, 200, true) then
imgui.Text("TopLeft")
imgui.EndChild()
@dextercd
dextercd / load_material.c
Last active November 29, 2022 16:31
Noita Load materials
/* WARNING: Could not reconcile some variable overlaps */
void load_material_xml(CellData *param_1_00,CXmlFileSys *filesys)
{
void **ppvVar1;
uint8_t uVar2;
char cVar3;
uint16_t uVar4;
function OnWorldPostUpdate()
if connection == nil then
return
end
if os.getenv("ROLE") == "R" then
do_receive()
return
end
@dextercd
dextercd / migrate.sh
Created August 18, 2022 20:48
Script for merging two Git repositories
#!/bin/bash
set -e
base_commit=30b923863d1768121c1ffb95932977e4283eceea
config_tree=56ecfa52fa08335c44ebcc9a8749779b3b9a7ecc
make_tree() {
sway_config=$1
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")