LocHelper.cs
/// <summary>
/// Returns the position of the given string id.
/// </summary>
/// <param name="hashId"></param>
/// <param name="target_occurance">1 for the first occurance</param>
/// <returns></returns>
Returns the position of the given string id.
Returns the position of the given string id .
public int GetStringLoc(UInt32 hashId, int target_occurance)
        {
            int stringLoc = (int)BodyStart;
            int occurance = 0;
            UInt32 currentHash = 0;
            while (true)
            {
                currentHash = BinUtils.GetNumberAtLocation(stringLoc, mData);
                if (currentHash == hashId)
                {
                    occurance++;
                    if (occurance == target_occurance)
                        break;
                }
                stringLoc = NextStringLoc(stringLoc);
                if (stringLoc + 10 > mData.Count)
                    return -1;
            }
            return stringLoc;
        }
public int GetStringLoc ( UInt32 hashId , int target_occurance ) { int stringLoc = ( int ) BodyStart ; int occurance = 0 ; UInt32 currentHash = 0 ; while ( true ) { currentHash = BinUtils . GetNumberAtLocation ( stringLoc , mData ) ; if ( currentHash == hashId ) { occurance ++ ; if ( occurance == target_occurance ) break ; } stringLoc = NextStringLoc ( stringLoc ) ; if ( stringLoc + 10 > mData . Count ) return - 1 ; } return stringLoc ; }
Returns the position of the given string id.
Returns the position of the given string id .
None
hashId
UInt32
None
target_occurance
int
1 for the first occurance
1 for the first occurance