Skip to content

Instantly share code, notes, and snippets.

View twist84's full-sized avatar
🏴‍☠️
Finding buried treasure

Twister twist84

🏴‍☠️
Finding buried treasure
View GitHub Profile
// ==UserScript==
// @name YouTube Grid Items Fixer
// @version 0.1
// @description fix grid item count
// @author Twister (https://github.com/twist84)
// @match *://*.youtube.com/*
// @run-at document-start
// @grant none
// ==/UserScript==
@twist84
twist84 / port_mapper.cpp
Created March 18, 2025 21:45
C++ Port Mapper Written With Grok AI
#include "port_mapper.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#ifdef _WIN32
#pragma comment(lib, "ws2_32.lib")
#else
#include <sys/select.h>
#endif
class ptr32_void_t
{
public:
uint64_t operator uint64_t() const;
int8_t* operator int8_t*() const;
uint8_t* operator uint8_t*() const;
const int8_t* operator const int8_t*() const;
const uint8_t* operator const uint8_t*() const;
bool __cdecl multiplayer_game_hopper_set_active_hopper_and_request_game_set(word hopper_identifier, bool a2, c_network_session_membership const* session_membership)
{
c_url_string game_set_url{};
c_hopper_configuration* hopper_configuration = multiplayer_game_hoppers_get_hopper_configuration(hopper_identifier);
if (!hopper_configuration && a2)
{
ASSERT(session_membership);
long hopper_configuration_index;
@twist84
twist84 / console.cpp
Created May 3, 2024 21:30
WIP `c_status_line_string_cache` Implementation
#include "console.hpp"
c_status_line_string_cache::c_status_line_string_cache() :
m_font_cache(),
m_string(),
m_alpha(),
m_color(),
m_text_justification()
{
m_text_justifications8.set_all(0);
@twist84
twist84 / strings_ids.cpp
Created March 17, 2024 22:33
strings ids
#include "strings_ids.hpp"
#include <cassert>
#include <cstdio>
#include <string>
#define IN_RANGE_INCLUSIVE(value, begin, end) (((value) >= (begin)) && ((value) <= (end)))
#define VALID_INDEX(index, count) ((index) >= 0 && (index) < (count))
#define ASSERT_STRING_ID(NAMESPACE, STRING) string_id_get_string_const(STRING_ID(NAMESPACE, STRING)); assert(strcmp(NAMESPACE##_##STRING, #STRING) == 0)
@twist84
twist84 / XeCrypt.cpp
Last active March 11, 2024 20:47
Statically compiled external lib addresses in Halo Online MS23
//.text:00D4A156 ; XeCryptShaInit
//.text:00D4A183 ; XeCryptShaUpdate
//.text:00D4A26E ; XeCryptShaFinal
//.text:00D4A31C ; XeCryptSha
//.text:00D4A37D ; XeCryptHmacShaInit
//.text:00D4A42F ;
//.text:00D4A434 ; XeCryptHmacShaFinal
//.text:00D4A466 ; XeCryptHmacSha
//.text:00D4A4D5 ; XeCryptHmacShaVerify
//.text:00D4A51F ;
powershell -ExecutionPolicy Bypass -File something.ps1
#define IDD_CHOOSE_RASTERIZER_DIALOG 101
#define ID_CHOOSE_RASTERIZER_BUTTON_OK IDOK
#define ID_CHOOSE_RASTERIZER_BUTTON_CANCEL IDCANCEL
#define ID_CHOOSE_RASTERIZER_LISTBOX_RENDERER 1001
#define ID_CHOOSE_RASTERIZER_LISTBOX_SELECTED_DEVICE_CHARACTERISTICS 1002
#define ID_CHOOSE_RASTERIZER_LISTBOX_SELECTED_DEVICE_DISPLAY_MODES 1003
#define ID_CHOOSE_RASTERIZER_LISTBOX_DEVICE 1004
#define ID_CHOOSE_RASTERIZER_BUTTON_RUN_WINDOWED 1005
#define ID_CHOOSE_RASTERIZER_BUTTON_DO_NOT_SHOW_THIS_AGAIN 1007
#define ID_CHOOSE_RASTERIZER_BUTTON_DISABLE_MULTITEXTURING_D3D_ONLY 1008
void apply_bubble_fix()
{
if (pixel_shader* shader = static_cast<pixel_shader*>tag_get('pixl', "shaders\particle_templates\_0_8_1_0_0_1_1_0_0_0")))
{
if (shader->compiled_shaders.count() >= 1)
{
compiled_pixel_shader& compiled_shader = shader->compiled_shaders[0];
csmemcpy(compiled_shader.compiled_shader_splut.dx9_compiled_shader.address, bubble_fix_compiled_shader_splut0, sizeof(bubble_fix_compiled_shader_splut0));
}