Ares
Functions

IniIteratorChar.cpp File Reference

#include "IniIteratorChar.h"

Functions

 DEFINE_HOOK (5260A2, IteratorChar_Process_Method1, 6)
 DEFINE_HOOK (525D23, IteratorChar_Process_Method2, 5)

Function Documentation

DEFINE_HOOK ( 5260A2  ,
IteratorChar_Process_Method1  ,
 
)
{
        GET(CCINIClass*, ini, EBP);
        GET(CCINIClass::INIEntry*, entry, ESI);
        GET_STACK(CCINIClass::INISection*, section, 0x40);

        if(strcmp(entry->Key, IniIteratorChar::iteratorChar) == 0) {
                sprintf(IniIteratorChar::buffer, "%d", IniIteratorChar::iteratorValue++);

                CRT::free(entry->Key);
                entry->Key = CRT::strdup(IniIteratorChar::buffer);
        }

        //debug
        //Debug::Log("[%s] %s = %s (Method 1)\n", section->Name, entry->Key, entry->Value);

        return 0;
}
DEFINE_HOOK ( 525D23  ,
IteratorChar_Process_Method2  ,
 
)
{
        GET(char*, value, ESI);
        LEA_STACK(char*, key, 0x78)
        LEA_STACK(char*, section, 0x278);

        if(strcmp(key, IniIteratorChar::iteratorChar) == 0) {
                strcpy(IniIteratorChar::buffer, value);
                sprintf(key, "%d", IniIteratorChar::iteratorValue++);

                char* newValue = key + strlen(key) + 1;
                strcpy(newValue, IniIteratorChar::buffer);
                R->ESI<char*>(newValue);
                value = newValue; //for correct debug display
        }

        //Debug::Log("[%s] %s = %s (Method 2)\n", section, key, value);
        return 0;
}
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines