S
SuKiDelphi
Unregistered / Unconfirmed
GUEST, unregistred user!
void thread()
{
DWORD a,x
char msgbuff[512];
char *pdest;
int result;
while(1)
{
memmove(&a,&outputbuff[0],4);
if(!a){Sleep(10);continue;}
char*name=(char*)&outputbuff[8];
for(x=0;x<stringcount;x++)
{
if(!stricmp(name,strings[x])){a=1;goto skip;}
}
pdest = strstr(name,"##");
if (pdest != NULL)
{
result = pdest-name;
strcpy(msgbuff, "是否允许");
strncat(msgbuff,&outputbuff[8],result);
strcat(msgbuff,"运行");
strcat(msgbuff,&outputbuff[result+10]);
}
else if((pdest=strstr(name,"$$")) != NULL)
{
result = pdest-name;
strcpy(msgbuff, "是否允许");
strncat(msgbuff,&outputbuff[8],result);
strcat(msgbuff,"设置注册表");
strcat(msgbuff,&outputbuff[result+10]);
}
else
{
pdest = strstr(name,"&&");
result = pdest-name;
strcpy(msgbuff,"是否允许");
strncat(msgbuff,&outputbuff[8],result);
strcat(msgbuff,"加载驱动");
strcat(msgbuff,&outputbuff[result]+10);
}
if(IDYES==MessageBox(0, msgbuff,"WARNING",MB_YESNO|MB_ICONQUESTION|0x00200000L))
{
a=1
strings[stringcount]=_strdup(name);
stringcount++;
}
else a=0;
skip:memmove(&outputbuff[4],&a,4);
a=0;
memmove(&outputbuff[0],&a,4);
}
}
我一直想将上面的代码转成 Delphi 的,请大家来帮我一下,谢谢!!!
{
DWORD a,x
char msgbuff[512];
char *pdest;
int result;
while(1)
{
memmove(&a,&outputbuff[0],4);
if(!a){Sleep(10);continue;}
char*name=(char*)&outputbuff[8];
for(x=0;x<stringcount;x++)
{
if(!stricmp(name,strings[x])){a=1;goto skip;}
}
pdest = strstr(name,"##");
if (pdest != NULL)
{
result = pdest-name;
strcpy(msgbuff, "是否允许");
strncat(msgbuff,&outputbuff[8],result);
strcat(msgbuff,"运行");
strcat(msgbuff,&outputbuff[result+10]);
}
else if((pdest=strstr(name,"$$")) != NULL)
{
result = pdest-name;
strcpy(msgbuff, "是否允许");
strncat(msgbuff,&outputbuff[8],result);
strcat(msgbuff,"设置注册表");
strcat(msgbuff,&outputbuff[result+10]);
}
else
{
pdest = strstr(name,"&&");
result = pdest-name;
strcpy(msgbuff,"是否允许");
strncat(msgbuff,&outputbuff[8],result);
strcat(msgbuff,"加载驱动");
strcat(msgbuff,&outputbuff[result]+10);
}
if(IDYES==MessageBox(0, msgbuff,"WARNING",MB_YESNO|MB_ICONQUESTION|0x00200000L))
{
a=1
strings[stringcount]=_strdup(name);
stringcount++;
}
else a=0;
skip:memmove(&outputbuff[4],&a,4);
a=0;
memmove(&outputbuff[0],&a,4);
}
}
我一直想将上面的代码转成 Delphi 的,请大家来帮我一下,谢谢!!!