Results 1 to 10 of 10

Threaded View

  1. #1
    Departure's Avatar
    Join Date
    Nov 2010
    Gender
    male
    Posts
    805
    Reputation
    125
    Thanks
    1,794
    My Mood
    Doh

    [Release] Super Fast Search Pattern

    Haven't been here for awhile, Thought I would release a boyermore implementation search in Delphi, super fast.. just change the Chars to byte and your set or modify it for wild cards by changing

    Orginal(Find this)
    Code:
    While pTarget[i] = pPattern[j] Do
    WildCard(Replace With)
    Code:
    While (pTarget[i] = pPattern[j]) or (pPattern[j] = '*') Do
    ^ Ofcause "*" can be any char or byte you want...



    BoyerMore Search Pattern:
    Code:
    (*
     ByerMore Search Pattern Coded By Departure
    *)
    
    Function SearchPattern(Const pTarget, pPattern: PChar): DWORD;
    Var
      i             :Integer;
      j             :Integer;
      k             :Integer;
      iTargetLen    :Integer;
      iPatternLen   :Integer;
      baStep: Array[0..255] Of Byte;
    Begin
        Result := 0;
        iTargetLen  := Length(pTarget);
        iPatternLen := Length(pPattern);
        If iTargetLen * iPatternLen = 0 Then Exit;
        FillChar(baStep,SizeOf(baStep), iPatternLen);
    
        For K := 0 to iPatternLen -1 do baStep[Ord(pPattern[k])]:= iPatternLen - K;
    
        While K <= iTargetLen Do
        Begin
          i := k - 1;
          j := iPatternLen - 1;
          While pTarget[i] = pPattern[j] Do
          Begin
            Dec(i);
            Dec(j);
          End;
          If j = -1 Then
          Begin
            Result := i + 2;
            Exit;
          End;
          Inc(K, baStep[Ord(pTarget[k])]);
        End;
    End;

  2. The Following 2 Users Say Thank You to Departure For This Useful Post:

    pDevice (09-02-2012),Saltine (10-24-2011)

Similar Threads

  1. [RELEASE] SUPER KNIFE, NO RECOIL, INSTA-SPAWN, INSTA-CLIP, AND MORE
    By NeverBorn in forum Combat Arms Europe Hacks
    Replies: 30
    Last Post: 08-21-2009, 08:42 AM
  2. [TUT][How-To] Super-Fast Speedhack
    By cyanmage in forum Combat Arms Hacks & Cheats
    Replies: 63
    Last Post: 08-14-2009, 01:11 AM
  3. [Release] SUPER JUMP HACK!!
    By FatEmoLLaMa in forum Combat Arms Hacks & Cheats
    Replies: 38
    Last Post: 10-07-2008, 08:26 PM
  4. [Release] Super TuT Package
    By 9Lives CatsEyes in forum Programming Tutorials
    Replies: 5
    Last Post: 08-30-2008, 11:14 PM
  5. [Release] Be Fast V1
    By sidnietje in forum WarRock - International Hacks
    Replies: 7
    Last Post: 11-28-2007, 08:34 PM