回复 20楼 hahayezhe
hahayezhe兄能放上vc6.0的工程上来不?我机子上没装有.net

0043245A /$ 807C24 04 00 cmp byte ptr [esp+4], 0 0043245F |. 53 push ebx 00432460 |. 55 push ebp 00432461 |. 56 push esi 00432462 |. 57 push edi 00432463 |. 8BF1 mov esi, ecx 00432465 |. BD 88835100 mov ebp, 00518388 0043246A |. BB 94835100 mov ebx, 00518394 0043246F |. 74 1E je short 0043248F 00432471 |. 8BFD mov edi, ebp 00432473 |> FF37 /push dword ptr [edi] ; /MutexName 00432475 |. 6A 00 |push 0 ; |Inheritable = FALSE 00432477 |. 68 01001F00 |push 1F0001 ; |Access = 1F0001 0043247C |. FF15 50514D00 |call dword ptr [<&KERNEL32.OpenMutex>; \OpenMutexW 00432482 |. 85C0 |test eax, eax 00432484 |. 8906 |mov dword ptr [esi], eax 00432486 |. 75 3F |jnz short 004324C7 00432488 |. 83C7 04 |add edi, 4 0043248B |. 3BFB |cmp edi, ebx 0043248D |.^ 7C E4 \jl short 00432473 0043248F |> 8BFD mov edi, ebp 00432491 |> FF37 /push dword ptr [edi] ; /MutexName 00432493 |. 6A 00 |push 0 ; |InitialOwner = FALSE 00432495 |. 6A 00 |push 0 ; |pSecurity = NULL 00432497 |. FF15 4C514D00 |call dword ptr [<&KERNEL32.CreateMut>; \CreateMutexW 0043249D |. 85C0 |test eax, eax 0043249F |. 8906 |mov dword ptr [esi], eax 004324A1 |. 74 14 |je short 004324B7 004324A3 |. FF15 48514D00 |call dword ptr [<&KERNEL32.GetLastEr>; [GetLastError 004324A9 >|. 3D B7000000 |cmp eax, 0B7 ; 0B7错误号:当文件已存在时,无法创建该文件。 004324AE >|. 75 20 |jnz short 004324D0 ; 创建互斥对象成功,跳转 004324B0 |. 8BCE |mov ecx, esi 004324B2 |. E8 A4010500 |call 0048265B 004324B7 |> 83C7 04 |add edi, 4 004324BA |. 3BFB |cmp edi, ebx 004324BC |.^ 7C D3 \jl short 00432491 ; 继续创建互斥对象 004324BE |> 32C0 xor al, al 004324C0 |> 5F pop edi 004324C1 |. 5E pop esi 004324C2 |. 5D pop ebp 004324C3 |. 5B pop ebx 004324C4 |. C2 0400 retn 4 004324C7 |> 8BCE mov ecx, esi 004324C9 |. E8 8D010500 call 0048265B 004324CE |.^ EB EE jmp short 004324BE 004324D0 |> B0 01 mov al, 1 004324D2 \.^ EB EC jmp short 004324C0
function CreateOrOpenMutex(i:Integer):Integer; begin esi:=ecx; ebp:=$00518388; ebx:=$00518394; if i<>0 then begin edi:=ebp; L2: eax:=OpenMutex($1F0001,0,dword ptr[edi]); if eax<>0 then begin ecx:=esi; call $0048265B; al:=0; end else begin edi:=edi+4; if edi<ebx then goto L2; goto L1; end; end else begin L1: edi:=ebp; eax:=CreateMutex(0,false,dword ptr[edi]); dword ptr [esi]:=eax; if eax<>0 then begin eax:=GetLastError(); if eax<>$0B7 then begin //0B7错误号:当文件已存在时,无法创建该文件。 al:=1; end else begin ecx:=esi; call $0048265B; edi:=edi+4; if edi<ebx then goto L1; al:=0; end; end; end; result:=al; end;
0048268F |. /75 65 jnz short 004826F6 00482691 |. |8B7D 08 mov edi, dword ptr [ebp+8] 00482694 |. |395F 14 cmp dword ptr [edi+14], ebx 00482697 |. |74 5D je short 004826F6 00482699 |. |68 E0B14E00 push 004EB1E0 ; UNICODE "Global\{F573DBE6-4456-46fc-8DAE-C13360CB46C8}" 0048269E |. |8D4D D4 lea ecx, dword ptr [ebp-2C] 004826A1 |. |FF15 E45C4D00 call dword ptr [<&MSVCP71.std::basic_>; MSVCP71.std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> > 004826A7 |. |57 push edi 004826A8 |. |8D4D D4 lea ecx, dword ptr [ebp-2C] 004826AB |. |895D FC mov dword ptr [ebp-4], ebx 004826AE |. |FF15 EC5C4D00 call dword ptr [<&MSVCP71.std::basic_>; MSVCP71.std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::append 004826B4 |. |8D4D D4 lea ecx, dword ptr [ebp-2C] 004826B7 |. |FF15 F45C4D00 call dword ptr [<&MSVCP71.std::basic_>; MSVCP71.std::basic_string<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t> >::data 004826BD |. |50 push eax ; /MutexName 004826BE |. |53 push ebx ; |InitialOwner 004826BF |. |53 push ebx ; |pSecurity 004826C0 |. |FF15 4C514D00 call dword ptr [<&KERNEL32.CreateMute>; \CreateMutexW 004826C6 |. |3BC3 cmp eax, ebx 004826C8 |. |8906 mov dword ptr [esi], eax 004826CA |. |74 19 je short 004826E5 004826CC |. |FF15 48514D00 call dword ptr [<&KERNEL32.GetLastErr>; [GetLastError 004826D2 |. |3D B7000000 cmp eax, 0B7 004826D7 |. |75 0A jnz short 004826E3 004826D9 |. |FF36 push dword ptr [esi] ; /hObject 004826DB |. |FF15 44514D00 call dword ptr [<&KERNEL32.CloseHandl>; \CloseHandle 004826E1 |. |891E mov dword ptr [esi], ebx