Help🙁 Source SDK 2013 Setup for Skin Changer

Posts 1–13 of 13 · Page 1 of 1
🙁 Source SDK 2013 Setup for Skin Changer
Hey there! I've been trying to create an internal CS:GO skin changer, however I am having issues including the source sdk 2013 headers. I have looked around everywhere and everyone just talks about creating your own SDK. I have tried to compile multiple tutorials into one working skin changer as I have no idea how I would go about creating one. What do I need to include to get C_BaseCombatWeapon working?

HEADER:
#ifndef __MAIN_H__
#define __MAIN_H__

#include <windows.h>

#ifdef BUILD_DLL
#define DLL_EXPORT __declspec(dllexport)
#else
#define DLL_EXPORT __declspec(dllimport)
#endif


#ifdef __cplusplus
extern "C"
{
#endif

void DLL_EXPORT SomeFunction(const LPCSTR sometext);

#ifdef __cplusplus
}
#endif

#endif // __MAIN_H__

SOURCE:

#include "main.h"

//Netvars:
int weapon = 0x0030;
int iItemDefinitionIndex = 0x2F88;
int hOwnerEntity = 0x0148;
int m_iItemIDHigh = 0x2FA0;
int m_nFallbackPaintKit = 0x3170;
int m_flFallbackWear = 0x3178;
int m_nFallbackStatTrak = 0x317C;
int m_nFallbackSeed = 0x3174;

void fskin(C_BaseCombatWeapon* weapon, int skinid) {
int* idHigh = makeptr<int>(weapon, m_iItemIDHigh);
if (idHigh == nullptr)
return;
*idHigh = 1;

int* ptkit = makeptr<int>(weapon, m_nFallbackPaintKit);

*paintkit = skinid;

float* wear = makeptr<float>(weapon, m_flFallbackWear);

*wear = 0.0000000001f;
}

int getweaponid(C_BaseCombatWeapon* weapon){
return makeptr<int>(weapon, iItemDefinitionIndex);
}

void __fastcall FrameStageNotifyThink(void* ecx, void* edx, ClientFrameStage_t stage) {
if (stage == FRAME_NET_UPDATE_POSTDATAUPDATE_START) {
for (int i=0; i<cl::entlist->GetHighestEntityIndex(); i++) {
C_BaseCombatWeapon* weapon = (C_BaseCombatWeapon*)cl::entlist->GetClientEntity(i);
if (!weapon)
continue;
if (!cl::entlist->GetClientEntityFromHandle(*(int*)((DWORD)weapon , hOwnerEntity)))
continue;
if (cl::entlist->GetClientEntityFromHandle(*(int*)((DWORD)weapon , hOwnerEntity)) != localent)
continue;
std::string entname = weapon->GetClientClass()->GetName();
if (entname.empty())
continue;
bool isweapon = (entname[1] == 'W' && entname[2] == 'e' && entname[3] == 'a') || entname[3] == '4' || entname[2] == 'E';
if (isWeapon || entname.find("CKnife") != std::string::npos) {
if (weapon->getweaponid() == WEAPON_GLOCK)
util::fskin(weapon, 38);
if (weapon->getweaponid() == WEAPON_AK47)
util::fskin(weapon, 180);
}
}
}
origFSN(ecx, stage);
}

int origFSN() {
origFSN = (FrameStageNotify)VMTManager.Hook(Interfaces->ClientMode, 36, FrameStageNotifyThink);
typedef void(__thiscall *FrameStageNotify)(void*, ClientFrameStage);
FrameStageNotify origFSN = NULL;
}
Thanks, @certmemer! The orgFSN func is suppose to be void �� This was my first day of working on it, so it is still a bit wonky. I've got a small issue, however, I'm writing this in Code::Blocks because I'm a fucking pleb. Would I just add all the sources and header files to the project, or would I have to link the lib somehow?
Omg, don't worry about it at all man! You've been an amazing help so far! @certmemer What version of visual studio do you use?
2015, but you should probably download the newest one. it supports c++17 and other cool features.
no problem, hit me up if you need anything else.
Lol, in order to test and see if the code would work, I got the proper netvars offsets from a netvar grabber and I replaced those with the ones in the example you gave me. I have one issue. I created the DLL properly, but when I inject with extreme injector (regardless of settings whether standard or manual) my csgo.exe crashes and throws a win32 exception with a missing parameter. Would this be a specific problem with my DLL, or is the injection just the issue? (I thought it could be a DEP problem, but I dont come across them too often when injecting other things) @certmemer

Edit: Nvm, it crashed because I was scrambling the shit out of the dll and i should have just used a delay with manual mapping XD

Edit 2: Now it injects perfectly, but nothing happens and I have made sure all my offsets are correct and I have even checked online. Is there something im missing?
theres no need to scramble dlls unless youre using a public cheat, dont bother. have you tried setting breakpoints or at least doing some kind of ghetto debugging? i mean, place std::couts inside functions and see what doesnt get printed.
What's the best way to enable a console in the DLL @certmemer? I'll try debugging it today, I just need some console method implemented.
in case you havent found out yet, you can use AllocConsole(), its a winapi function.
Oh, sweet, that's nice to have in the winapi libs! Thank you! I won't have time to fix everything tonight because of school, however, I'll play around with it tomorrow. @certmemer
Posts 1–13 of 13 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us