Einzelnen Beitrag anzeigen

sdean

Registriert seit: 5. Dez 2009
64 Beiträge
 
#1

Conversion from Cpp to Delphi

  Alt 27. Dez 2011, 03:08
Can someone helps me in converting these two CPP functions into Delphi :
Code:
 bool StrSearch(byte* mem,char* text,DWORD size){
       byte* pchL=mem;
       DWORD offset=(DWORD)pchL;
       DWORD length=offset+size;
       int s=strlen(text);
       while(offset<length){
          if (!strnicmp((PCSTR)pchL, (PCSTR)text, s)){
             return true;
          }
          offset++;
          pch++;
       }
       return false;
    }
Code:
int PEFILE::GetPESectionIndex(char* SectionName){
       int j;
       int n=image_nt_headers->FileHeader.NumberOfSections;
       for(j=0;j<n;j++){
          if(!strcmp((const char*)image_section_header[j]->Name,SectionName)) return j;
       }
       return -1;
    }

many thanks
  Mit Zitat antworten Zitat