Skip to content

Instantly share code, notes, and snippets.

#pragma comment(lib, "msvcrt.dll")
#pragma comment(lib, "SDL2.dll")
#pragma comment(lib, "SDL2_image.dll")
#pragma comment(lib, "opengl32.dll")
typedef struct
{
int type;
char rest[54];
} SDL_Event;
#pragma comment(lib, "/lib/i386-linux-gnu/libc.so.6")
#define STDOUT_FILENO 1
typedef struct
{
int out;
int in;
} filedes_t;
main()
{
typedef struct
{
unsigned short sin_family;
unsigned short sin_port;
unsigned int sin_addr; //long on x64
char sin_zero[8];
} sockaddr_in;
#define AF_INET 2
//thanks and credits to
//https://github.com/CptAsgard/CoD2Unity/blob/master/Assets/Scripts/IWILoader.cs
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <stdint.h>
//need to include DDS_header urself
@riicchhaarrd
riicchhaarrd / gist:2770cd9ae3b075bd4234
Created April 26, 2015 20:46
GSC GetArrayKeys/Scr_GetArray/Array contents [CoD2 1.2/1.3 - libcod]
#if COD2_VERSION == COD2_VERSION_1_2
unsigned short (*GetVariableName)(unsigned short) = (unsigned short(*)(unsigned short))0x807CFF6;
unsigned short (*GetNextVariable)(unsigned short) = (unsigned short(*)(unsigned short))0x807CF52; //idk original funcname
#elif COD2_VERSION == COD2_VERSION_1_3
unsigned short (*GetVariableName)(unsigned short) = (unsigned short(*)(unsigned short))0x807D0C2;
unsigned short (*GetNextVariable)(unsigned short) = (unsigned short(*)(unsigned short))0x807D01E; //idk original funcname
#else
unsigned short (*GetVariableName);
unsigned short (*GetNextVariable);
#endif
@riicchhaarrd
riicchhaarrd / gist:b87ef7c707e786cc9702
Last active August 29, 2015 14:18
GSC IsMantling [CoD2 - libcod]
void PlayerCmd_IsMantling(int self) {
/*
mantling m8 a1=fff9d750, a2=fff9d500, *(int*)a1 = 8705480
mantling m8 a1=fff9d750, a2=fff9d500, *(int*)a1 = 8705480 = unk_8705480
*/
#if COD_VERSION == COD2_1_2
int idk = 0x8705480 + 10404 * self + 0xc;