Skip to content

Instantly share code, notes, and snippets.

@codenulls
codenulls / trace_execution_x64dbg.py
Last active November 10, 2023 01:14
Stops the execution at conditional jumps. The output is printed to the log file in x64dbg.
# taken from https://gist.github.com/deeso/44e6dc40ea7a4d77fc458742eb96f4c1
from x64dbgpy import pluginsdk
import x64dbgpy.pluginsdk._scriptapi as script
def loadBytes(va, count):
return list(script.Read(va, count))
def disasm_at(addr):
@codenulls
codenulls / _jmp_deobfuscator.md
Created November 9, 2023 11:09 — forked from oopsmishap/_jmp_deobfuscator.md
IDA Jmp Deobfuscation Script
@codenulls
codenulls / smtpenum.py
Created October 6, 2023 20:02 — forked from tommelo/smtpenum.py
SMTP User Enumeration
#!/usr/bin/env python
import socket, getopt, sys, os.path
SMTP_PORT = 25
BUFFER_SIZE = 1024
OK_STATUS = 252
APP_NAME = "smtpenum"
VERSION = "1.0.0"
@codenulls
codenulls / SimpleAsmExample.cpp
Created March 4, 2021 19:30
prints: 0 2 4 6 8 10 12 14 16 18
#include <stdio.h>
#include <stdint.h>
#include <Windows.h>
#include <iostream>
void __cdecl PrintNumber(int i)
{
printf("%d ", i);
}
@codenulls
codenulls / gist:465375556cb282892b8b76eee3e09b15
Last active February 27, 2021 22:17
ubuntu ffmepg build with openssl
export CFLAGS="-I/usr/local/ssl/include -L/usr/local/ssl/lib -Wl,-rpath=/usr/local/ssl/lib"
CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" ./configure \
--pkg-config=pkg-config \
--prefix=$PWD/../ffmpeg-win32-sdk \
--enable-static \
--enable-shared \
--enable-small \
--disable-symver \
--disable-debug \
--disable-doc \
@codenulls
codenulls / PrintAllGroupsGTA3_pluginSDK.cpp
Last active January 14, 2019 10:20
Print all GTA III animation groups by pressing 1.
#include "plugin.h"
#include "common.h"
#include "CTimer.h"
#include "InputManager.h"
#include "CAnimManager.h"
using namespace plugin;
class GTA3Animation {
public:
@codenulls
codenulls / main.scm
Created January 1, 2019 10:47 — forked from wodim/main.scm
main.scm from GTA: Vice City
This file has been truncated, but you can view the full file.
DEFINE OBJECTS 204
DEFINE OBJECT (noname)
DEFINE OBJECT DTN_STADDOORA // Object number -1
DEFINE OBJECT DTN_STADDOORB // Object number -2
DEFINE OBJECT DTHOTRING_A // Object number -3
DEFINE OBJECT BRIBE // Object number -4
DEFINE OBJECT CI_GATESCLOSED // Object number -5
DEFINE OBJECT CI_BACKGATECLOSE // Object number -6
DEFINE OBJECT INFO // Object number -7
@codenulls
codenulls / GetAllTaskNames.cpp
Created December 26, 2018 18:20
Function for getting all task names for MTA SA.
bool CClientGame::GetLocalPlayerTaskNames(SString& strConcatenatedTaskNames, bool bPrimary)
{
CClientPed* pLocalPlayer = static_cast<CClientPed*>(GetLocalPlayer());
if (pLocalPlayer)
{
int cTaskTypes = bPrimary ? 5 : 6;
for (int iTaskType = 0; iTaskType < cTaskTypes; iTaskType++)
{
std::vector<SString> taskHierarchy;
if (CStaticFunctionDefinitions::GetPedTask(*pLocalPlayer, bPrimary, iTaskType, taskHierarchy))
@codenulls
codenulls / PlayerClassMemoryLayout.cpp
Created November 23, 2018 14:21
Shows how the `Player` class looks in memory, and how to access it.
// GTA_test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <cstdio>
#include <cstdint>
class Player
{
public:
@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);