libcod
libcod.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#include <execinfo.h>
#include "cracking.hpp"
#include "gsc.hpp"
#include "server.hpp"
#include "java_embed.h"
#include <pthread.h>
Include dependency graph for libcod.cpp:

Data Structures

struct  aTrace
 
class  cCallOfDuty2Pro
 

Macros

#define LEVEL_SPACE   do { for (int i=0; i<level; i++) printf(" "); }while(0);
 
#define __cdecl
 
#define _DWORD   int
 
#define __cdecl
 
#define TOSTRING2(str)   #str
 
#define TOSTRING1(str)   TOSTRING2(str)
 

Typedefs

typedef void(* xcommand_t) (void)
 
typedef void(* gametype_scripts_t) ()
 
typedef int(* codscript_load_function_t) (char *file, char *function, int isNeeded)
 

Functions

int cdecl_calc_hash_of_string (char *str, unsigned int len)
 
void cdecl_sub_807F840 (char *str)
 
bool cdecl_gsc_cast_to_bool (aStackElement *element)
 
void init_native_interface ()
 
int16_t cdecl_gsc_set_field_of_struct (int a1, int a2)
 
int gsc_new_variable_807AB64 (int a1, int a2, int a_1_plus_b_mod_fffd_plus_1)
 
void printStackTrace ()
 
int trace_calc_fraction_805B894 (aTrace *trace, float *vectorFrom, float *vectorTo, float *nullVector0, float *nullVector1, int isZero, int mask)
 
void sub_809D884 (aTrace *trace, float *vectorFrom, float *mins, float *maxs, float *vectorTo, int ignoreEntity, int mask, int isOne1, int isZero, int isOne2)
 
unsigned int hook_str2hash_8078EE6 (char *functionLower, int len)
 
int hook_807C0B8 (int a1, int a2)
 
bool __cdecl hook_8075D48 (int a1)
 
int hook_codscript_load_label_8075DEA (char *file, char *function)
 
int codscript_load_function_custom (char *file, char *function, int isNeeded)
 
void hook_codscript_gametype_scripts ()
 
int hook_ClientCommand (int clientNum)
 
void stupidTestFunction ()
 
void Cmd_AddCommand (const char *cmd_name, xcommand_t function)
 
ssize_t hook_sendto (int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen)
 
ssize_t hook_recvfrom (int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen)
 
int hook_pthread_create (pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
 
pthread_t hook_pthread_self (void)
 
int hook_pthread_mutex_lock (pthread_mutex_t *mutex)
 
int hook_pthread_mutex_trylock (pthread_mutex_t *mutex)
 
int hook_pthread_mutex_unlock (pthread_mutex_t *mutex)
 
size_t hook_fread (void *ptr, size_t size, size_t count, FILE *stream)
 
int hook_player_eject (int player)
 
int SV_AddServerCommand (int *client,...)
 
void SV_SendServerCommand (int *client, int bla, const char *fmt,...)
 
void parent_of_SV_SendServerCommand (signed int nr, const char *fmt,...)
 
int hook_RemoteCommandTime (void)
 
char * hook_AuthorizeState (int arg)
 
int hook_StateCompare (char *state, char *base)
 
int hook_BadKeyCompare (char *s1, char *s2)
 
void hook_SV_BeginDownload_f (int a1)
 
int hook_ClientUserinfoChanged (int clientNum)
 
char * hook_beginDownloadCopy (char *a1, char *a2, int a3)
 
void hook_SV_WriteDownloadToClient (int cl, int msg)
 
void manymaps_prepare (char *mapname, int read)
 
int hook_findMap (const char *qpath, void **buffer)
 
int BG_AnimationIndexForString (char *string)
 
int BG_PlayAnimName (int ps, const char *animName, int bodyPart, int setTimer, int isContinue, int force)
 
int BG_PlayAnim (int ps, int animIndex, int bodyPart, int is_0, int setTimer, int isContinue, int force)
 
int FS_AddGameDirectory (char *path, char *dir)
 
int FS_LoadIWD (char *a, char *b)
 
void MSG_WriteBigString (int *MSG, char *s)
 
int cmd_map ()
 
int hook_dummytrue (const char *src)
 
void __attribute__ ((constructor)) lib_load(void)
 
void __attribute__ ((destructor)) lib_unload(void)
 

Variables

int16_t * stack
 
int(* sub_807B276 )(int, int)
 
int level
 
int codecallback_playercommand = 0
 
int codecallback_userinfochanged = 0
 
gametype_scripts_t gametype_scripts = (gametype_scripts_t)NULL
 
codscript_load_function_t codscript_load_function = (codscript_load_function_t)NULL
 
cHook * hook_parent_of_SV_SendServerCommand
 
cHook * hook_MSG_WriteBigString
 
cHook * hook_cmd_map
 
cCallOfDuty2Propro
 

Macro Definition Documentation

#define __cdecl
#define __cdecl
#define _DWORD   int
#define LEVEL_SPACE   do { for (int i=0; i<level; i++) printf(" "); }while(0);
#define TOSTRING1 (   str)    TOSTRING2(str)
#define TOSTRING2 (   str)    #str

Typedef Documentation

typedef int(* codscript_load_function_t) (char *file, char *function, int isNeeded)
typedef void(* gametype_scripts_t) ()
typedef void( * xcommand_t) (void)

Function Documentation

void __attribute__ ( (constructor)  )
void __attribute__ ( (destructor)  )
int BG_AnimationIndexForString ( char *  string)
int BG_PlayAnim ( int  ps,
int  animIndex,
int  bodyPart,
int  is_0,
int  setTimer,
int  isContinue,
int  force 
)

Here is the caller graph for this function:

int BG_PlayAnimName ( int  ps,
const char *  animName,
int  bodyPart,
int  setTimer,
int  isContinue,
int  force 
)
int cdecl_calc_hash_of_string ( char *  str,
unsigned int  len 
)

Here is the caller graph for this function:

bool cdecl_gsc_cast_to_bool ( aStackElement element)

Here is the caller graph for this function:

int16_t cdecl_gsc_set_field_of_struct ( int  a1,
int  a2 
)

Here is the caller graph for this function:

void cdecl_sub_807F840 ( char *  str)

Here is the caller graph for this function:

void Cmd_AddCommand ( const char *  cmd_name,
xcommand_t  function 
)

Here is the caller graph for this function:

int cmd_map ( )
int codscript_load_function_custom ( char *  file,
char *  function,
int  isNeeded 
)

Here is the caller graph for this function:

int FS_AddGameDirectory ( char *  path,
char *  dir 
)

Here is the caller graph for this function:

int FS_LoadIWD ( char *  a,
char *  b 
)
int gsc_new_variable_807AB64 ( int  a1,
int  a2,
int  a_1_plus_b_mod_fffd_plus_1 
)

Here is the caller graph for this function:

bool __cdecl hook_8075D48 ( int  a1)

Here is the caller graph for this function:

int hook_807C0B8 ( int  a1,
int  a2 
)
char* hook_AuthorizeState ( int  arg)

Here is the caller graph for this function:

int hook_BadKeyCompare ( char *  s1,
char *  s2 
)

Here is the caller graph for this function:

char* hook_beginDownloadCopy ( char *  a1,
char *  a2,
int  a3 
)

Here is the caller graph for this function:

int hook_ClientCommand ( int  clientNum)

Here is the call graph for this function:

Here is the caller graph for this function:

int hook_ClientUserinfoChanged ( int  clientNum)

Here is the call graph for this function:

Here is the caller graph for this function:

void hook_codscript_gametype_scripts ( )

Here is the call graph for this function:

Here is the caller graph for this function:

int hook_codscript_load_label_8075DEA ( char *  file,
char *  function 
)

Here is the call graph for this function:

int hook_dummytrue ( const char *  src)

Here is the caller graph for this function:

int hook_findMap ( const char *  qpath,
void **  buffer 
)

Here is the call graph for this function:

Here is the caller graph for this function:

size_t hook_fread ( void *  ptr,
size_t  size,
size_t  count,
FILE *  stream 
)
int hook_player_eject ( int  player)
int hook_pthread_create ( pthread_t *  thread,
const pthread_attr_t *  attr,
void *(*)(void *)  start_routine,
void *  arg 
)
int hook_pthread_mutex_lock ( pthread_mutex_t *  mutex)
int hook_pthread_mutex_trylock ( pthread_mutex_t *  mutex)
int hook_pthread_mutex_unlock ( pthread_mutex_t *  mutex)
pthread_t hook_pthread_self ( void  )
ssize_t hook_recvfrom ( int  sockfd,
void *  buf,
size_t  len,
int  flags,
struct sockaddr *  src_addr,
socklen_t *  addrlen 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int hook_RemoteCommandTime ( void  )

Here is the caller graph for this function:

ssize_t hook_sendto ( int  sockfd,
const void *  buf,
size_t  len,
int  flags,
const struct sockaddr *  dest_addr,
socklen_t  addrlen 
)
int hook_StateCompare ( char *  state,
char *  base 
)

Here is the caller graph for this function:

unsigned int hook_str2hash_8078EE6 ( char *  functionLower,
int  len 
)
void hook_SV_BeginDownload_f ( int  a1)

Here is the caller graph for this function:

void hook_SV_WriteDownloadToClient ( int  cl,
int  msg 
)

Here is the caller graph for this function:

void init_native_interface ( )
void manymaps_prepare ( char *  mapname,
int  read 
)

Here is the caller graph for this function:

void MSG_WriteBigString ( int *  MSG,
char *  s 
)

Here is the caller graph for this function:

void parent_of_SV_SendServerCommand ( signed int  nr,
const char *  fmt,
  ... 
)

Here is the caller graph for this function:

void printStackTrace ( )

Here is the caller graph for this function:

void stupidTestFunction ( )

Here is the caller graph for this function:

void sub_809D884 ( aTrace trace,
float *  vectorFrom,
float *  mins,
float *  maxs,
float *  vectorTo,
int  ignoreEntity,
int  mask,
int  isOne1,
int  isZero,
int  isOne2 
)

Here is the call graph for this function:

int SV_AddServerCommand ( int *  client,
  ... 
)

Here is the caller graph for this function:

void SV_SendServerCommand ( int *  client,
int  bla,
const char *  fmt,
  ... 
)

Here is the caller graph for this function:

int trace_calc_fraction_805B894 ( aTrace trace,
float *  vectorFrom,
float *  vectorTo,
float *  nullVector0,
float *  nullVector1,
int  isZero,
int  mask 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int codecallback_playercommand = 0
int codecallback_userinfochanged = 0
codscript_load_function_t codscript_load_function = (codscript_load_function_t)NULL
gametype_scripts_t gametype_scripts = (gametype_scripts_t)NULL
cHook* hook_cmd_map
cHook* hook_MSG_WriteBigString
cHook* hook_parent_of_SV_SendServerCommand
int level
int16_t* stack
int(* sub_807B276) (int, int)