Skip to content

Instantly share code, notes, and snippets.

View es3n1n's full-sized avatar
:shipit:
the voices are getting louder

Arsenii es3n1n es3n1n

:shipit:
the voices are getting louder
View GitHub Profile
@es3n1n
es3n1n / donut.cpp
Created March 14, 2021 23:18
donut.cpp
// yes.
#include <algorithm>
#define MAX_SIZE 1760
#define CHARS_MAP ".,-~:;=!*#$@"
float step_x = 0;
@es3n1n
es3n1n / math.h
Last active April 24, 2021 16:58
cpp inline asm math
namespace util {
namespace math {
constexpr auto e = 2.71828182845904523536f;
constexpr auto pi = 3.14159265358979323846f;
constexpr auto radpi = 180.f / pi;
constexpr auto sqrpi = pi * pi;
constexpr auto round_error = 0.5;
double __forceinline deg2rad( double x ) {
return x * ( static_cast< double >( pi ) / 180.0 );
@es3n1n
es3n1n / idadefs.h
Last active August 21, 2024 19:42
latest definitions for hexrays decompiler output
/*
This file contains definitions used in the Hex-Rays decompiler output.
It has type definitions and convenience macros to make the
output more readable.
Copyright (c) 2007-2022 Hex-Rays
*/
@es3n1n
es3n1n / e_cvar_flags.cpp
Created May 13, 2021 18:06
csgo convar flags
#include <cstdint>
enum e_cvar_flags : uint32_t {
none = 0,
unregistered = (1<<0), // If this is set, don't add to linked list, etc.
developmentonly = (1<<1), // Hidden in released products. Flag is removed automatically if ALLOW_DEVELOPMENT_CVARS is defined.
gamedll = (1<<2), // defined by the game DLL
clientdll = (1<<3), // defined by the client DLL
hidden = (1<<4), // Hidden. Doesn't appear in find or auto complete. Like DEVELOPMENTONLY, but can't be compiled out.
priv /* protected */ = (1<<5) , // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value
@es3n1n
es3n1n / virt2phys.cpp
Last active February 20, 2022 09:19
virt2phys
// @note: es3n1n: this is never meant to be useful
// posting cz maybe i'll use it later in my projs
// i hate those pasted c stuff, that's why i
// made my own version, please don't blame me :(
//
uintptr_t virt2phys( uintptr_t virt_addr ) {
auto read_phys = [ ] ( uintptr_t addr, void* buffer, size_t size ) -> NTSTATUS {
size_t dummy = 0;
MM_COPY_ADDRESS copy_addr = { .PhysicalAddress = {.QuadPart = static_cast< LONGLONG >( addr ) } };
@es3n1n
es3n1n / uploadthing.py
Last active April 15, 2024 18:13
UploadThing upload wrapper for python3 using requests
from requests import Session, Response
from urllib.parse import quote
from typing import Tuple
from functools import lru_cache
class UploadThing:
def __init__(self, api_key: str, base_url: str = 'https://uploadthing.com/api') -> None:
self.session = Session()
self.session.headers = {
@es3n1n
es3n1n / meme.hpp
Created August 20, 2024 20:48
unfinished uniform_init_distribution drop-in replacement that utilizes https://arxiv.org/pdf/1805.10941
/// \brief A drop-in replacement for `std::uniform_int_distribution`.
///
/// We are using a replacement because the uniform_int_distribution implementation is different in libc and libstdc++.
/// This is important because otherwise we can't reproduce random values across multiple platforms.
///
/// \tparam IntType The integer type to be used for the distribution. Defaults to `int`.
template <typename IntType = int>
class UniformIntDistribution {
public:
using ResultTy = IntType;
@es3n1n
es3n1n / soundcloud_auth.py
Created October 15, 2024 23:43
Unfinished soundcloud authorization
from requests import Session
import re
import json
from base64 import b64encode
from urllib.parse import quote, urlparse
session = Session()
session.headers = {
'Accept': '*/*',
@es3n1n
es3n1n / letopis.js
Created November 14, 2024 20:48
Discord stuff
class LetopisUtilities {
constructor() {
this.updateInterval = null
this.eventListenersAdded = false
this.videoFrame = null
this.handleMouseDown = this.handleMouseDown.bind(this)
this.handleMouseWheel = this.handleMouseWheel.bind(this)
this.onStart()
}
onStart() {