BratokHR

Untitled

Jan 10th, 2021 (edited)
1,042
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.78 KB | None | 0 0
  1. /*
  2. libcod.cpp
  3. ----------
  4. */
  5.  
  6. class cCallOfDuty2Pro
  7. {
  8. public:
  9.     cCallOfDuty2Pro()
  10.     {
  11. ......
  12. #elif COD_VERSION == COD2_1_0
  13. .....
  14. #if COMPILE_UTILS == 1
  15.         memcpy((void *)(0x0808FB4F), &connect_string, 4); // 1.0
  16. #endif
  17. .....
  18. #elif COD_VERSION == COD2_1_3
  19. .....
  20. #if COMPILE_UTILS == 1
  21.     memcpy((void *)(0x08091463), &connect_string, 4); // 1.3
  22. #endif
  23. .....
  24.     }
  25. }
  26.  
  27. /*
  28. gsc_utils.hpp
  29. -------------
  30. */
  31. void gsc_utils_settestclientname();
  32. extern char *connect_string;
  33.  
  34. /*
  35. gsc_utils.cpp
  36. -------------
  37. */
  38. #if COD_VERSION == COD2_1_0
  39. static char connect_string_st[256] = "connect \"\\cg_predictItems\\1\\cl_anonymous\\0\\color\\4\\head\\default\\model\\multi\\snaps\\20\\rate\\5000\\name\\bot%d\\protocol\\%d\"";
  40. char *connect_string = &connect_string_st[0];
  41. char connect_string_p1[] = "connect \"\\cg_predictItems\\1\\cl_anonymous\\0\\color\\4\\head\\default\\model\\multi\\snaps\\20\\rate\\5000\\name\\";
  42. char connect_string_p2[] = "\\protocol\\115\"";
  43. #elif COD_VERSION == COD2_1_3
  44. static char connect_string_st[256] = "connect \"\\cg_predictItems\\1\\cl_punkbuster\\0\\cl_anonymous\\0\\color\\4\\head\\default\\model\\multi\\snaps\\20\\rate\\5000\\name\\bot%d\\protocol\\%d\""
  45. char *connect_string = &connect_string_st[0];
  46. char connect_string_p1[] = "connect \"\\cg_predictItems\\1\\cl_punkbuster\\0\\cl_anonymous\\0\\color\\4\\head\\default\\model\\multi\\snaps\\20\\rate\\5000\\name\\";
  47. char connect_string_p2[] = "\\protocol\\117\"";
  48. #endif
  49.  
  50. void gsc_utils_settestclientname()
  51. {
  52.     char *name;
  53.  
  54.     if ( ! stackGetParams("s", &name))
  55.     {
  56.         stackError("gsc_utils_setbotname() argument is undefined or has a wrong type");
  57.         stackPushUndefined();
  58.         return;
  59.     }
  60.  
  61.     strcpy(connect_string, connect_string_p1);
  62.     strcat(connect_string, name);
  63.     strcat(connect_string, connect_string_p2);
  64. }
Add Comment
Please, Sign In to add comment