Make IGameConfig::GetMemSig return value clearer (bug 6081, r=asherkin).
This commit is contained in:
parent
00b06313c9
commit
2f6b64e92e
@ -559,7 +559,9 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
|
|||||||
smcore.LogError("[SM] Unrecognized library \"%s\" (gameconf \"%s\")",
|
smcore.LogError("[SM] Unrecognized library \"%s\" (gameconf \"%s\")",
|
||||||
s_TempSig.library,
|
s_TempSig.library,
|
||||||
m_CurFile);
|
m_CurFile);
|
||||||
} else {
|
}
|
||||||
|
else if (s_TempSig.sig[0])
|
||||||
|
{
|
||||||
if (s_TempSig.sig[0] == '@')
|
if (s_TempSig.sig[0] == '@')
|
||||||
{
|
{
|
||||||
#if defined PLATFORM_WINDOWS
|
#if defined PLATFORM_WINDOWS
|
||||||
@ -594,10 +596,9 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (final_addr)
|
|
||||||
|
if (!final_addr)
|
||||||
{
|
{
|
||||||
goto skip_find;
|
|
||||||
}
|
|
||||||
/* First, preprocess the signature */
|
/* First, preprocess the signature */
|
||||||
unsigned char real_sig[511];
|
unsigned char real_sig[511];
|
||||||
size_t real_bytes;
|
size_t real_bytes;
|
||||||
@ -610,12 +611,13 @@ SMCResult CGameConfig::ReadSMC_LeavingSection(const SMCStates *states)
|
|||||||
|
|
||||||
if (real_bytes >= 1)
|
if (real_bytes >= 1)
|
||||||
{
|
{
|
||||||
final_addr = g_MemUtils.FindPattern(addrInBase, (char*)real_sig, real_bytes);
|
final_addr = g_MemUtils.FindPattern(addrInBase, (char*) real_sig, real_bytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
skip_find:
|
|
||||||
m_Sigs.replace(m_offset, final_addr);
|
m_Sigs.replace(m_offset, final_addr);
|
||||||
|
}
|
||||||
|
|
||||||
m_ParseState = PSTATE_GAMEDEFS_SIGNATURES;
|
m_ParseState = PSTATE_GAMEDEFS_SIGNATURES;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -84,9 +84,9 @@ namespace SourceMod
|
|||||||
*
|
*
|
||||||
* @param key Name of the signature.
|
* @param key Name of the signature.
|
||||||
* @param addr Pointer to store the memory address in.
|
* @param addr Pointer to store the memory address in.
|
||||||
* @return True if the key was found, false otherwise.
|
* (NULL is copied if signature is not found in binary).
|
||||||
* Note that true is a valid return even if the
|
* @return True if the section exists and key for current
|
||||||
* address is NULL.
|
* platform was found, false otherwise.
|
||||||
*/
|
*/
|
||||||
virtual bool GetMemSig(const char *key, void **addr) =0;
|
virtual bool GetMemSig(const char *key, void **addr) =0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user