Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned int g_res;
- /*...*/
- unsigned int hashASDF2( char* input_string )
- {
- _asm{
- // result_hash= dword ptr -8
- // loop_counter= dword ptr -4
- // input_string= dword ptr 4
- #define result_hash dword ptr -8
- #define loop_counter dword ptr -4
- //#define input_string dword ptr 4
- sub esp, 8
- push ebx
- push ebp
- xor ecx, ecx
- push esi
- mov [esp+14h+result_hash], ecx
- mov [esp+14h+loop_counter], ecx
- push edi
- loc_4010A1: ; CODE XREF: hash_func+7Fj
- mov eax, [input_string] ; <--- tu jest bug ;/
- movsx edi, byte ptr [ecx+eax]
- xor edx, edx
- xor ecx, ecx
- lea ecx, [ecx+0]
- loc_4010B0: ; CODE XREF: hash_func+3Dj
- mov eax, 1
- shl eax, cl ; 1<<i (2^i)
- mov ebx, eax
- and ebx, [esp+18h+result_hash]
- mov esi, eax
- and esi, edi
- cmp ebx, esi
- jz short loc_4010C7
- or edx, eax
- loc_4010C7: ; CODE XREF: hash_func+33j
- add ecx, 1
- cmp ecx, 20h
- jl short loc_4010B0
- lea esi, [edx+edi]
- add esi, esi
- add esi, esi
- add esi, esi
- xor eax, eax
- xor ecx, ecx
- lea esp, [esp+0]
- loc_4010E0: ; CODE XREF: hash_func+6Bj
- mov edx, 1
- shl edx, cl ; 1<<i (2^i)
- mov ebx, edx
- mov ebp, edx
- and ebx, esi
- and ebp, edi
- cmp ebx, ebp
- jz short loc_4010F5
- or eax, edx
- loc_4010F5: ; CODE XREF: hash_func+61j
- add ecx, 1
- cmp ecx, 20h
- jl short loc_4010E0
- mov ecx, [esp+18h+loop_counter]
- add ecx, 1
- cmp ecx, 7
- mov [esp+18h+result_hash], eax
- mov [esp+18h+loop_counter], ecx
- jl short loc_4010A1
- mov g_res, eax
- pop edi
- pop esi
- pop ebp
- pop ebx
- add esp, 8
- }
- return g_res;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement