Function at 0x402130
Capabilities:
Check mutex on windows
Create process on windows
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
push ebx
push esi
push edi
mov ebx, dword [ebp + 8]
lea edi, [ebp - 0x54]
mov esi, 0x40bfdc
mov ecx, 0x11
rep movsd dword es:[edi], dword [esi]
lea edi, [ebp - 0x10]
mov ecx, 0x10
xor eax, eax
rep stosb byte es:[edi], al
push 0
call sub.storm.dll_Ordinal_272
mov dword [0x40da5c], ebx
push 0x104
push 0x40db64
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x5c
push 0x40db64
call fcn.00402550
add esp, 8
mov dword [0x40de08], eax
cmp dword [0x40de08], 0
je 0x402219
inc dword [0x40de08]
mov eax, dword [0x40de08]
mov byte [eax], 0
push 0x40db64
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [str.Snej60]
push eax
push 0x40db64
push str._s_s_
push 0x104
push 0x40dc68
call fcn.00402500
add esp, 0x14
push 0x40db64
push str._sD2SE.ini
push 0x104
push 0x40da60
call fcn.00402500
add esp, 0x10
push str.GlobalSnej_Diary_of_the_Dark_Wanderer
push 0
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
mov esi, eax
push str.GlobalSnej_Diary_of_the_Dark_Wanderer_471118
push 0
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
mov dword [ebp - 0x58], eax
jmp 0x402235
push 0x10
push str.ERROR_
push str.Error_determining_Path_for_D2
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
or eax, 0xffffffff
jmp 0x402490
push 0x40da60
call fcn.004010d0
test esi, esi
je 0x40225f
push 0x10
push str.ERROR_
push str.Snej_is_already_started_please_exit_it_first__
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
or eax, 0xffffffff
jmp 0x402490
cmp dword [ebp - 0x58], 0
jne 0x4022be
push str.GlobalSnej_Diary_of_the_Dark_Wanderer_88320
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x40228c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x4022a8
push 0x10
push str.ERROR_
push str.Snej_is_already_started_please_exit_it_first__
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
or eax, 0xffffffff
jmp 0x402490
mov eax, dword [ebp + 0x14]
push eax
push ebx
call fcn.004018d0
test eax, eax
jne 0x4022c8
or eax, 0xffffffff
jmp 0x402490
mov dword [0x40b4cc], 1
cmp dword [0x40b4cc], 0
jne 0x402314
push str.GlobalSnej_Diary_of_the_Dark_Wanderer
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x4022f8
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
jne 0x402323
push 0x10
push str.ERROR_
push str.Snej_is_already_started_please_exit_it_first__
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
or eax, 0xffffffff
jmp 0x402490
push str.GlobalSnej_Diary_of_the_Dark_Wanderer_471118
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
cmp dword [0x40b4c8], 0
jne 0x4023ed
push str.D2XMUSIC.MPQ
call fcn.00401090
mov esi, eax
push str.D2XVIDEO.MPQ
call fcn.00401090
mov edi, eax
test esi, esi
je 0x402350
test edi, edi
jne 0x402367
push str.Information:_n_n
push 0x1000
push 0x40ca50
call fcn.00402500
add esp, 0xc
test esi, esi
jne 0x402382
push 0x1000
push str.Your_D2XMUSIC.MPQ_is_missing._n
push 0x40ca50
call fcn.00402570
add esp, 0xc
test edi, edi
jne 0x40239d
push 0x1000
push str.Your_D2XVIDEO.MPQ_is_missing._n
push 0x40ca50
call fcn.00402570
add esp, 0xc
test esi, esi
je 0x4023a5
test edi, edi
jne 0x4023ed
push 0x1000
push str._nYou_have_to_leave_your_CD_inside_your_Drive_to_Play_nor_have_to_copy_the_missing_.mpq_manually_to_your_D2_Folder_to_play_without_CD__n_nThis_Message_wont_appear_a_second_time_so_remember_it____nOr_go_into_D2SE.ini_and_set_inside_Section__INTERNAL__the_nParameter_MPQWarning_to_0
push 0x40ca50
call fcn.00402570
add esp, 0xc
push 0x40040
push str.IMPORTANT_INFORMATION_
push 0x40ca50
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0x40da60
push 0x4090b8
push str.MPQWarning
push str.INTERNAL
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
call fcn.00401e00
push 0x40dc68
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov eax, dword [0x40b4cc]
push eax
call fcn.00401da0
test eax, eax
je 0x402425
push 0x10
push str.ERROR_
push str.Snejmod_could_not_be_Initialized._nDid_you_follow_the_Readme_for_Installation___nSnej_needs_a_CLEAN_LOD_1.11B_Installation_as_Base__no_other_Patch_will_work_
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
or eax, 0xffffffff
jmp 0x402490
cmp dword [0x40b4cc], 0
je 0x402487
cmp byte [0x40b005], 0
je 0x402487
cmp dword [ebp - 0x58], 0
jne 0x402487
push 0x1000
push 0x40ca50
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x54]
push eax
push 0
push 0
push 0x200
push 0
push 0
push 0
push 0x40ca50
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, ebx
call fcn.00401ec0
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10