Skip to content

Instantly share code, notes, and snippets.

View codenulls's full-sized avatar

Danish AKA codenulls codenulls

View GitHub Profile
@codenulls
codenulls / IntMemoryLayout.cpp
Created November 21, 2018 13:55
Shows how an `int` type variable looks like in memory.
#include "stdafx.h"
#include <cstdio>
#include <cstdint>
int main()
{
int amount = 9000;
std::printf("Address of amount: %p\nValue of amount in decimal: %d\nValue of amount in hexadecimal: %#.8x\n", &amount, amount, amount);
std::uint8_t* amountAddress = reinterpret_cast<std::uint8_t*> (&amount);
@codenulls
codenulls / main.cpp
Created August 17, 2018 14:53
A simple GTA:SA ASI mod to restore health of local player by pressing the R key on keyboard.
#include "plugin.h"
#include "common.h"
#include "CHud.h"
#include "CTimer.h"
using namespace plugin;
class RestoreHealthGTASA {
public:
RestoreHealthGTASA() {