Skip to content

Instantly share code, notes, and snippets.

View lyf-is-coding's full-sized avatar
💓
Live Laugh Love

lyf-is-coding

💓
Live Laugh Love
View GitHub Profile
@lyf-is-coding
lyf-is-coding / VirtualKeyCodes.h
Created July 23, 2022 06:37
C++ Enum Windows Virtual-Key Codes
#pragma once
#ifndef _VIRTUALKEYCODES_H_
#define _VIRTUALKEYCODES_H_
enum VK
{
LBUTTON = 0x01, // Left mouse button
RBUTTON = 0x02, // Right mouse button
CANCEL = 0x03, // Control-break processing
@lyf-is-coding
lyf-is-coding / parse_virtual_key_code.py
Created July 27, 2022 08:36
Python parse Windows Virtual-Key Codes
import re
input = open("vk.txt", 'r')
Lines = input.readlines()
output = open("virtual_key_code.h", 'w')
output.writelines("#pragma once\n\n")
output.writelines("#ifndef _VIRTUALKEYCODE_H_\n")
@lyf-is-coding
lyf-is-coding / cheat_engine_create_group_header.lua
Created August 1, 2022 10:43
Lua Cheat Engine create group header with script option
local al = getAddressList()
local header = al.createMemoryRecord()
-- https://wiki.cheatengine.org/index.php?title=Lua:Class:MemoryRecord
header.Description = "Group 1"
header.isGroupHeader = true
header.type = 11 -- vtAutoAssembler
@lyf-is-coding
lyf-is-coding / MonoMemRecordAppendFields.lua
Created August 4, 2022 15:52
Cheat Engine Lua Mono append fields to class memory record
local LAST_OFFSET_INDEX = 0
function MonoMemRecordAppendFields(parent_memrc, classID, is_include_parents, is_debug)
if parent_memrc == nil or parent_memrc == 0 or classID == nil or classID == 0 then
return false
end
LaunchMonoDataCollector()
local addressList = getAddressList()
@lyf-is-coding
lyf-is-coding / Get Documents folder path.cpp
Created August 20, 2022 07:03
C++ Get Documents directory path using Window Shell
#include <shlobj.h>
PWSTR documentsDirPath{};
if (HRESULT ret = SHGetKnownFolderPath(FOLDERID_Documents, KF_FLAG_DEFAULT, 0, &documentsDirPath); ret == S_OK)
{
std::wcout << L"Documents directory path: " << documentsDirPath << '\n';
}
else
{
std::wcout << L"[SHGetKnownFolderPath] " << ret << '\n';
@lyf-is-coding
lyf-is-coding / C# UnmanagedType example.cs
Last active August 21, 2022 05:07
C# UnmanagedType example
public struct Vector3
{
public float X { get; set; }
public float Y { get; set; }
public float Z { get; set; }
public Vector3(float x, float y, float z)
{
X = x;
Y = y;
@lyf-is-coding
lyf-is-coding / C# Convert string to type T.cs
Created August 22, 2022 04:01
C# Convert string to type T
(T)Convert.ChangeType(value, typeof(T))
@lyf-is-coding
lyf-is-coding / get_window_width_height.cpp
Created September 8, 2022 12:38
C++ Getting window width and height using GetClientRect
#include <Windows.h>
bool GetWndWidthHeight(const HWND& hwnd, long* wnd_width, long* wnd_height)
{
RECT rct;
if (!GetClientRect(hwnd, &rct))
{
return false;
}
@lyf-is-coding
lyf-is-coding / GetInstalledSteamGames.cpp
Last active October 10, 2022 16:30
C++ Get installed steam games using WinReg library
std::vector<Game> GetInstalledSteamGames()
{
try
{
const std::wstring STEAM_INSTALLED_GAMES_KEY = L"Software\\Valve\\Steam\\Apps\\";
// Get list of user's steam games
winreg::RegKey installed_games_key{ HKEY_CURRENT_USER, STEAM_INSTALLED_GAMES_KEY };
std::vector<std::wstring> subKeyNames = installed_games_key.EnumSubKeys();
installed_games_key.Close();
@lyf-is-coding
lyf-is-coding / LinkneverdieAntiAnti-Adblocker.js
Created October 15, 2022 12:37
Linkneverdie Anti Anti-Adblocker
// ==UserScript==
// @name Anti Anti-Adblocker - linkneverdie.net
// @namespace Violentmonkey Scripts
// @match https://linkneverdie.net/*
// @grant none
// @version 1.0
// @author -
// @description 10/14/2022, 3:23:08 PM
// ==/UserScript==