MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / ServerCreateModuleProbe

Method ServerCreateModuleProbe

CryNetwork/DefenceWall.cpp:162–201  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

160
161//////////////////////////////////////////////////////////////////////////
162bool CDefenceWall::ServerCreateModuleProbe( const char *sFilename,SClientCheckContext &ctx )
163{
164 char sModule[_MAX_PATH];
165 char fname[_MAX_FNAME];
166 char ext[_MAX_EXT];
167 _splitpath( sFilename,0,0,fname,ext );
168 _makepath( sModule,0,0,fname,ext );
169 strlwr( sModule );
170
171 // Skip comparing render dll code. (Can be OGL,D3D or NULL)
172 if (strstr(sModule,"render"))
173 return false;
174
175 AddProtectedFile( (string("b")+"i"+"n"+"3"+"2"+"/"+sFilename).c_str() );
176
177 if (m_pNetwork->GetCheatProtectionLevel() >= CHEAT_LEVEL_CODE)
178 {
179 ctx.nRequestCode = DEFWALL_CHECK_DLL_CODE;
180 ctx.bExecutableCode = true;
181 ctx.probe.sFilename = sModule;
182#if !defined(LINUX)
183 ctx.nFilenameHash = m_pSystem->GetIDataProbe()->GetHash( sModule );
184 ctx.probe.nCodeInfo = rand()%3;
185 if (!m_pSystem->GetIDataProbe()->GetRandomModuleProbe( ctx.probe ))
186 return false;
187 if (!m_pSystem->GetIDataProbe()->GetCode( ctx.probe ))
188 return false;
189#endif
190#ifdef LOGEVENTS
191 if (m_bLog) CryLog( "<DefenceWall> CreatedExeProbe[%d] %s %I64x",ctx.nRequestId,ctx.probe.sFilename.c_str(),ctx.probe.nCode );
192#endif
193 }
194 else
195 {
196 return false;
197 }
198
199
200 return true;
201}
202
203//////////////////////////////////////////////////////////////////////////
204bool CDefenceWall::ServerCreateFileProbe( const char *sFilename,SClientCheckContext &ctx,bool bRandomPart )

Callers

nothing calls this directly

Calls 9

CryLogFunction · 0.85
GetIDataProbeMethod · 0.80
GetRandomModuleProbeMethod · 0.80
GetCodeMethod · 0.80
strlwrFunction · 0.50
stringClass · 0.50
c_strMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected