Closed eeioruewo0iruwe closed 7 years ago
Skins1.h
extern RecvVarProxyFn fnSequenceProxyFn;
extern void SetViewModelSequence(const CRecvProxyData pDataConst, void pStruct, void *pOut);
AntiAntiAim.cpp
void ApplyAAAHooks() { ClientClass pClass = Interfaces::Client->GetAllClasses(); while (pClass) { const char pszName = pClass->m_pRecvTable->m_pNetTableName; if (!strcmp(pszName, "DT_CSPlayer")) { for (int i = 0; i < pClass->m_pRecvTable->m_nProps; i++) { RecvProp pProp = &(pClass->m_pRecvTable->m_pProps[i]); const char name = pProp->m_pVarName;
// Pitch Fix
if (!strcmp(name, "m_angEyeAngles[0]"))
{
pProp->m_ProxyFn = FixX;
}
// Yaw Fix
if (!strcmp(name, "m_angEyeAngles[1]"))
{
Utilities::Log("Yaw Fix Applied");
pProp->m_ProxyFn = FixY;
}
}
}
else if (!strcmp(pszName, "DT_BaseViewModel"))
{
for (int i = 0; i < pClass->m_pRecvTable->m_nProps; i++)
{
RecvProp *pProp = &(pClass->m_pRecvTable->m_pProps[i]);
const char *name = pProp->m_pVarName;
// Knives
if (!strcmp(name, "m_nModelIndex"))
{
oRecvnModelIndex = (RecvVarProxyFn)pProp->m_ProxyFn;
pProp->m_ProxyFn = Hooked_RecvProxy_Viewmodel;
}
}
for (ClientClass* pClass = Interfaces::Client->GetAllClasses(); pClass; pClass = pClass->m_pNext) {
if (!strcmp(pClass->m_pNetworkName, "CBaseViewModel")) {
// Search for the 'm_nModelIndex' property.
RecvTable* pClassTable = pClass->m_pRecvTable;
for (int nIndex = 0; nIndex < pClassTable->m_nProps; nIndex++) {
RecvProp* pProp = &pClassTable->m_pProps[nIndex];
if (!pProp || strcmp(pProp->m_pVarName, "m_nSequence"))
continue;
// Store the original proxy function.
fnSequenceProxyFn = (RecvVarProxyFn)pProp->m_ProxyFn;
// Replace the proxy function with our sequence changer.
pProp->m_ProxyFn = SetViewModelSequence;
break;
}
break;
}
}
}
pClass = pClass->m_pNext;
}
}w
Add at the end of Entities.h
class CBaseViewModel : public IClientUnknown, public IClientRenderable, public IClientNetworkable { public: inline int GetModelIndex() { // DT_BaseViewModel -> m_nModelIndex return (int)((DWORD)this + 0x254); } inline DWORD GetOwner() { // DT_BaseViewModel -> m_hOwner return (PDWORD)((DWORD)this + 0x29BC); } inline DWORD GetWeapon() { // DT_BaseViewModel -> m_hWeapon return (PDWORD)((DWORD)this + 0x29B8); } inline void SetWeaponModel(const char Filename, IClientUnknown Weapon) { return call_vfunc<void(__thiscall)(void, const char, IClientUnknown)>(this, 242)(this, Filename, Weapon); } };
Replace CModelInfo in Materials.h with this:
template
class CModelInfo { public: inline void GetModel(int Index) { return GetVirtualFunction<void(__thiscall )(void, int)>(this, 1)(this, Index); }
int GetModelIndex(const char *name)
{
typedef int(__thiscall* oGetModelName)(PVOID, const char *);
return call_vfunc< oGetModelName >(this, 2)(this, name);
}
inline const char* GetModelName(const void* Model) {
return GetVirtualFunction<const char*(__thiscall *)(void*, const void*)>(this, 3)(this, Model);
}
studiohdr_t *GetStudiomodel(const model_t *mod)
{
typedef studiohdr_t *(__stdcall* oGetStudiomodel)(const model_t*);
return call_vfunc< oGetStudiomodel >(this, Offsets::VMT::ModelInfo_GetStudiomodel)(mod);
}
void GetModelMaterials(const model_t *model, int count, IMaterial** ppMaterial)
{
typedef studiohdr_t* (*oGetModelMaterials)(void*, const model_t*, int, IMaterial**);
call_vfunc<oGetModelMaterials>(this, 18)(this, model, count, ppMaterial);
}
};
have any errors?
just comment back on this. I'll be checking on this frequently. so expect a response 5-30 min after ur comment.
http://prntscr.com/fnxot7 http://prntscr.com/fnxowe http://prntscr.com/fnxp06 http://prntscr.com/fnxp2o http://prntscr.com/fnxp5p http://prntscr.com/fnxp84 Yeah these are my errors. My Base is MotionSense
Mind showing full code? ie: where the errors are in the code
edit:: I'm going to try to paste the anim fix, if im successful ill link you or whatever
forgot to add this lol:
template
put that above the GetModel shit
also here is proof
https://gyazo.com/ea0432e01a0c328b5a9ef81e36ee06a9
if you need further help, just let me know and ill upload fixed source :P
no, above, idk if i wasn't specific enough... sorry if I wasn't
when i paste this template __forceinline Fn GetVirtualFunction(void* pClassBase, int nFunctionIndex) { return (Fn)((PDWORD)(PDWORD)pClassBase)[nFunctionIndex]; } where you said, i got this identifier Fn is undefinited
template
? shouldnt have to be defined/autodefined. mind sharing a gyazo?
nvm github is the one being stupid
github is changing the code and i didn't realize :( sorry about that...
Im just gunna upload the source... i dont even know where to start on fixing that sorry :\
tbh i feel like git kinda messed up some of the code i posted above so I'm just gunna leave you with the source... HOPEFULLY that will clear some things up.
A pull request would be more easier than uploading the entire source code. But thanks anyways!
yeah, iFloody is right
wouldn't let me do a pull request https://gyazo.com/7d17dc8f4cdc59da803e4b004a63ad53
i'll let you pull a request wtf?
well i made it harder than it had to be so I apologize...
so here is a kitten playing with a feather toy: https://media.giphy.com/media/RQgzLsPYlzrBC/giphy.gif
Still not getting it to work. Cannot convert PDWord to DWORD
same
just pull a request and ill accept it
I pasted all the shit from the source-code that @eeioruewo0iruwe provided and it's working fine here. I think that I can do a pull request if you want.
yeah, would be nice, i have some probs with it, lemme update it then pull the request okay?
K.
Lemme just do some testings and I'll make the request.
ok, pull that request now
ill be here if anyone needs me...
@XBoom31 Wait a sec, I need to fork your repo.
the community needed you for that, and will need you for future updates if you want
:D yes
Done, pull request created.
done, thanks @eeioruewo0iruwe and @iFloody
:P
yeah, you have credits
Proxies.h
pragma once
include "Skins1.h"
include "Entities.h"
include "Interfaces.h"
include "ClientRecvProps.h"
// Store the original proxy functions. RecvVarProxyFn fnSequenceProxyFn = NULL;
// Function to fix sequences for certain models. void SetViewModelSequence(const CRecvProxyData pDataConst, void pStruct, void pOut) { // Make the incoming data editable. CRecvProxyData pData = const_cast<CRecvProxyData*>(pDataConst);
}