Function at 0x401000
Capabilities:
Accept command line arguments
Check if file exists
Create process on windows
Create process suspended

Disassembly:
sub esp, 0x680
push esi
push edi
xor esi, esi
push str.DIABLO_II_OK
push esi
push esi
push esi
mov dword [esp + 0x18], esi
xor edi, edi
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [esp + 0xc], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x401034
mov edi, 1
cmp edi, esi
jne 0x40136e
push ebx
mov ebx, dword [esp + 0x690]
push ebp
mov ebp, dword [sym.imp.USER32.dll_LoadStringA]
mov ecx, 0x11
xor eax, eax
lea edi, [esp + 0x138]
push 0x104
rep stosd dword es:[edi], eax
mov dword [esp + 0x20], eax
lea ecx, [esp + 0x590]
mov dword [esp + 0x24], eax
push ecx
mov dword [esp + 0x2c], eax
push 1
push ebx
mov dword [esp + 0x38], eax
call ebp
lea edx, [esp + 0x488]
push 0x104
push edx
push 7
push ebx
call ebp
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov edi, eax
push 0x406034
push edi
mov dword [esp + 0x20], edi
call fcn.0040146d
add esp, 8
lea edx, [esp + 0x17c]
test eax, eax
jne 0x40110a
mov edi, 0x406034
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x17c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x18]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x17c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x406034
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x280]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x4064b0
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [esp + 0x17c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x488]
push ecx
push edx
call fcn.0040146d
lea ecx, [esp + 0x184]
lea edx, [esp + 0x184]
sub eax, ecx
push eax
lea eax, [esp + 0x28c]
push edx
push eax
call fcn.004013b0
lea edi, [esp + 0x5a0]
or ecx, 0xffffffff
xor eax, eax
add esp, 0x14
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x280]
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x280]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x406030
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x280]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x69c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x1c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x13c]
lea edx, [esp + 0x284]
push ecx
push 0
push 0
push 0
push 1
push 0
push 0
push edx
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x401295
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
lea eax, [esp + 0x384]
push 0x104
push eax
push 2
push ebx
call ebp
lea ecx, [esp + 0x34]
push 0x104
push ecx
push 9
push ebx
call ebp
lea edx, [esp + 0x384]
push 5
lea eax, [esp + 0x38]
push edx
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 2
je 0x40136c
jmp 0x40104b
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
push 0xffffffffffffffff
lea eax, [esp + 0x30]
push 0
push eax
push 2
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x40], edx
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
lea ecx, [esp + 0x384]
push 0x104
push ecx
push 2
push ebx
mov esi, eax
call ebp
mov eax, esi
sub eax, 0
je 0x4012dd
dec eax
je 0x40136c
jmp 0x40104b
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x10]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
mov eax, dword [esp + 0x10]
cmp eax, 0xc
ja case.default.0x4012fe
xor ecx, ecx
mov cl, byte [eax + 0x401398]
jmp dword [ecx*4 + 0x401388]
lea edx, [esp + 0x34]
push 0x104
push edx
push 4
jmp 0x401349
lea eax, [esp + 0x34]
push 0x104
push eax
push 5
jmp 0x401349
lea ecx, [esp + 0x34]
push 0x104
push ecx
push 6
jmp 0x401349
lea edx, [esp + 0x34]
push 0x104
push edx
push 3
jmp 0x401349
lea eax, [esp + 0x34]
push 0x104
push eax
push 8
push ebx
call ebp
lea ecx, [esp + 0x384]
push 5
lea edx, [esp + 0x38]
push ecx
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
cmp eax, 2
jne 0x40104b
pop ebp
pop ebx
mov eax, dword [esp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
pop edi
pop esi
add esp, 0x680
ret 0x10