[HELP] Explain me please how this function works

08/10/2009 21:19 Xorg#1
Hi,
Anyone here can tell me what this function do?

PHP Code:
DWORD SearchPattern(charpattern,DWORD start_offset ,DWORD ende)
{
        
DWORD offset=start_offset;
        
DWORD start=offset
        
DWORD backoffset=0;
        
DWORD size =strlen(pattern)-1;
        
DWORD foundoffset=0;
 
        
char pEnd=pattern;
        while(
1)
        {
                
char &myposition=*(char*)offset;
                if ((
pEnd[1]!='x'))
                {
                        
char temp=(char)strtoul(pEnd, &pEnd0x10);
                        if (
temp==myposition)
                        {
                                if (
foundoffset==0)
                                {
                                        
foundoffset=offset;
                                }
                        }
                        else
                        {
                                
pEnd=pattern;
                                if (
foundoffset != 0)
                                        
offset=foundoffset;
                                
foundoffset=0;
                        }
                }
                else
                {
                 
pEnd=&pEnd[2];
                }
                
offset++;
                if (((
DWORD)pEnd-(DWORD)pattern>=size)||(offset>=ende))
                        break;
        }
        return 
foundoffset;

Execution:
PHP Code:
SearchPattern("55 8B EC 83 EC 18 83 3D x x x x 00 74 07 33 C0 E9 x x x x 8A 45 08",0x00400000,0x007FFFFF); 
I dont understand that:
PHP Code:
char &myposition=*(char*)offset
08/10/2009 21:27 bloodx#2
this function search for the HEX code -> 55 8B EC 83 EC 18 83 3D x x x x 00 74 07 33 C0 E9 x x x x 8A 45 08

x = can be anything....

,0x00400000,0x007FFFFF = range from -> to
08/10/2009 21:47 Xorg#3
Yeah I already know that, but dont understand how it works in details.
My problem is:
Quote:
char &myposition=*(char*)offset;
What declares?
PHP Code:
char &myposition