A
andy263
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下
unsigned long string_id(const char *str)
{
int i;
unsigned int v;
static unsigned m[70];
strncpy((char *)m,str,256);
for (i=0;i<256/4 &&
m;i++)
m[i++]=0x9BE74448,m[i++]=0x66F42C48;
v=0xF4FA8928;
__asm {
mov esi,0x37A8470E ;x0=0x37A8470E
mov edi,0x7758B42B ;y0=0x7758B42B
xor ecx,ecx
_loop:
mov ebx,0x267B0B11 ;w=0x267B0B11
rol v,1
lea eax,m
xor ebx,v
mov eax,[eax+ecx*4]
mov edx,ebx
xor esi,eax
xor edi,eax
add edx,edi
or edx,0x2040801 ;a=0x2040801
and edx,0xBFEF7FDF ;c=0xBFEF7FDF
mov eax,esi
mul edx
adc eax,edx
mov edx,ebx
adc eax,0
add edx,esi
or edx,0x804021 ;b=0x804021
and edx,0x7DFEFBFF ;d=0x7DFEFBFF
mov esi,eax
mov eax,edi
mul edx
add edx,edx
adc eax,edx
jnc _skip
add eax,2
_skip:
inc ecx;
mov edi,eax
cmp ecx,i
jnz _loop
xor esi,edi
mov v,esi
}
return v;
}
up有份 分不够再加
unsigned long string_id(const char *str)
{
int i;
unsigned int v;
static unsigned m[70];
strncpy((char *)m,str,256);
for (i=0;i<256/4 &&
m;i++)
m[i++]=0x9BE74448,m[i++]=0x66F42C48;
v=0xF4FA8928;
__asm {
mov esi,0x37A8470E ;x0=0x37A8470E
mov edi,0x7758B42B ;y0=0x7758B42B
xor ecx,ecx
_loop:
mov ebx,0x267B0B11 ;w=0x267B0B11
rol v,1
lea eax,m
xor ebx,v
mov eax,[eax+ecx*4]
mov edx,ebx
xor esi,eax
xor edi,eax
add edx,edi
or edx,0x2040801 ;a=0x2040801
and edx,0xBFEF7FDF ;c=0xBFEF7FDF
mov eax,esi
mul edx
adc eax,edx
mov edx,ebx
adc eax,0
add edx,esi
or edx,0x804021 ;b=0x804021
and edx,0x7DFEFBFF ;d=0x7DFEFBFF
mov esi,eax
mov eax,edi
mul edx
add edx,edx
adc eax,edx
jnc _skip
add eax,2
_skip:
inc ecx;
mov edi,eax
cmp ecx,i
jnz _loop
xor esi,edi
mov v,esi
}
return v;
}
up有份 分不够再加