Function at 0x402840
Capabilities:
Check if file exists
Link many functions at runtime

Disassembly:
sub esp, 0xd4
mov eax, dword [0x40701c]
xor eax, esp
mov dword [esp + 0xd0], eax
call fcn.004023e0
test eax, eax
je 0x40287b
call fcn.00402590
test eax, eax
jne 0x40287b
mov ecx, dword [esp + 0xd0]
xor ecx, esp
call fcn.0040413a
add esp, 0xd4
ret
push ebx
push ebp
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0x405304
mov dword [esp + 0x20], eax
mov dword [esp + 0x30], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test eax, eax
mov ebp, dword [sym.imp.KERNEL32.dll_GetProcAddress]
jne 0x402bc3
lea esi, [esp + 0x10]
call fcn.004020d0
lea esi, [esp + 0x14]
call fcn.004020d0
push eax
lea eax, [esp + 0x2c]
push eax
mov ebx, 0x40551c
call fcn.004031c0
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
add esp, 8
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4028ef
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea esi, [esp + 0x14]
call fcn.004020d0
push eax
lea ecx, [esp + 0x24]
push ecx
mov ebx, 0x405534
call fcn.004031c0
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
add esp, 8
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40292b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x28]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x402b63
mov edx, dword [esp + 0x20]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x402b63
xor eax, eax
lea ebx, [esp + 0x24]
lea edi, [esp + 0x18]
lea esi, [esp + 0x14]
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x24], eax
call fcn.00402350
mov eax, dword [esp + 0x14]
cmp eax, 5
jne 0x402a4a
cmp dword [esp + 0x18], 1
jne 0x402b63
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x1c]
push ecx
mov ebx, 0x40554c
call fcn.004031c0
mov edx, dword [esp + 0x20]
push 0
push edx
call dword [sym.imp.MSVCR80.dll__waccess]
add esp, 0x10
cmp eax, 0xffffffff
je 0x402b5a
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x18]
push ecx
mov ebx, 0x405554
call fcn.004031c0
mov edx, dword [esp + 0x1c]
add esp, 8
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
je 0x402b51
mov eax, dword [esp + 0x18]
push eax
lea esi, [esp + 0x44]
call fcn.00403470
mov ecx, dword [eax]
push ecx
lea ecx, [esp + 0xc8]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov eax, dword [esp + 0x40]
lea edx, [esp + 0x44]
cmp eax, edx
je 0x402a15
push eax
call dword [sym.imp.MSVCR80.dll_free]
add esp, 4
push 0x40556c
push edi
call ebp
test eax, eax
mov esi, 0x10
je 0x402a40
cmp dword [esp + 0xdc], esi
mov ecx, dword [esp + 0xc8]
jae 0x402a3d
lea ecx, [esp + 0xc8]
push ecx
call eax
push 0x40557c
jmp 0x402b1b
cmp eax, 6
jne 0x402b63
cmp dword [esp + 0x18], 1
jne 0x402b63
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x1c]
push ecx
mov ebx, 0x40558c
call fcn.004031c0
mov edx, dword [esp + 0x20]
push 0
push edx
call dword [sym.imp.MSVCR80.dll__waccess]
add esp, 0x10
cmp eax, 0xffffffff
je 0x402b5a
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x18]
push ecx
mov ebx, 0x405598
call fcn.004031c0
mov edx, dword [esp + 0x1c]
add esp, 8
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
je 0x402b51
mov eax, dword [esp + 0x18]
push eax
lea esi, [esp + 0x44]
call fcn.00403470
mov ecx, dword [eax]
push ecx
lea ecx, [esp + 0xc8]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_char_const__]
mov eax, dword [esp + 0x40]
lea edx, [esp + 0x44]
cmp eax, edx
je 0x402aeb
push eax
call dword [sym.imp.MSVCR80.dll_free]
add esp, 4
push 0x4055b0
push edi
call ebp
test eax, eax
mov esi, 0x10
je 0x402b16
cmp dword [esp + 0xdc], esi
mov ecx, dword [esp + 0xc8]
jae 0x402b13
lea ecx, [esp + 0xc8]
push ecx
call eax
push 0x4055c0
push edi
call ebp
test eax, eax
je 0x402b44
cmp dword [esp + 0xdc], esi
mov ecx, dword [esp + 0xc8]
mov dword [esp + 0x2c], 1
jae 0x402b41
lea ecx, [esp + 0xc8]
push ecx
call eax
lea ecx, [esp + 0xc4]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea eax, [esp + 0x14]
call fcn.004034f0
lea eax, [esp + 0x18]
call fcn.004034f0
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402b83
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402ba3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402bc3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
sub eax, dword [esp + 0x1c]
mov dword [esp + 0x3c], eax
call edi
lea esi, [esp + 0x38]
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], 0
call fcn.00402210
lea esi, [esp + 0x1c]
call fcn.00402210
push eax
lea ecx, [esp + 0x38]
push ecx
mov ebx, 0x40551c
call fcn.004031c0
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
add esp, 8
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x402c26
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea esi, [esp + 0x1c]
call fcn.00402210
push eax
lea ecx, [esp + 0x34]
push ecx
mov ebx, 0x4055d4
call fcn.004031c0
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
add esp, 8
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x402c62
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x34]
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
push ecx
call esi
test eax, eax
je 0x402dc4
mov edx, dword [esp + 0x30]
push edx
call esi
test eax, eax
je 0x402dc4
lea eax, [esp + 0x38]
push eax
lea ecx, [esp + 0x14]
push ecx
mov ebx, 0x4055f4
call fcn.004031c0
mov edx, dword [esp + 0x18]
push 0
push edx
call dword [sym.imp.MSVCR80.dll__waccess]
add esp, 0x10
cmp eax, 0xffffffff
je 0x402da4
lea eax, [esp + 0x10]
push eax
lea ecx, [esp + 0x24]
push ecx
mov ebx, 0x405604
call fcn.004031c0
mov edx, dword [esp + 0x28]
add esp, 8
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
test eax, eax
je 0x402d84
lea eax, [esp + 0x28]
push eax
mov ecx, 0x405620
call fcn.00403040
mov ecx, dword [esp + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
test edi, edi
je 0x402d75
push 0x405648
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebp, eax
test ebp, ebp
je 0x402d75
lea esi, [esp + 0x1c]
call fcn.00402210
push eax
lea edx, [esp + 0x1c]
push edx
mov ebx, 0x405658
call fcn.004031c0
add esp, 8
mov eax, esi
call fcn.004034f0
mov eax, dword [esp + 0x18]
push 0x405678
push eax
call ebp
add esp, 8
test eax, eax
je 0x402d6c
push 0x4056e0
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x402d6c
mov ecx, dword [esp + 0x18]
push 0x405678
push ecx
mov dword [esp + 0x1c], 1
call eax
add esp, 8
lea eax, [esp + 0x18]
call fcn.004034f0
lea eax, [esp + 0x28]
call fcn.004034f0
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x402da4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402dc4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
call edi
sub eax, dword [esp + 0x24]
mov dword [esp + 0x24], eax
call edi
lea ecx, [esp + 0x10]
push ecx
mov ecx, 0x405374
mov ebp, eax
call fcn.00403040
mov eax, dword [esp + 0x10]
mov ecx, dword [eax - 8]
mov edx, 1
sub edx, dword [eax - 4]
sub ecx, 0x104
or edx, ecx
jge 0x402e0c
mov ecx, 0x104
lea eax, [esp + 0x10]
call fcn.00403700
mov eax, dword [esp + 0x10]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov edx, dword [esp + 0x10]
test edx, edx
jne 0x402e26
xor eax, eax
jmp 0x402e45
mov eax, edx
lea esi, [eax + 2]
jmp 0x402e30
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x402e30
sub eax, esi
sar eax, 1
js 0x402ffa
cmp eax, dword [edx - 8]
jg 0x402ffa
mov dword [edx - 0xc], eax
mov edx, dword [esp + 0x10]
mov word [edx + eax*2], 0
mov eax, dword [esp + 0x10]
push 0x5c
push eax
call dword [sym.imp.MSVCR80.dll_wcsrchr]
add esp, 8
test eax, eax
jne 0x402e74
or eax, 0xffffffff
jmp 0x402e7a
sub eax, dword [esp + 0x10]
sar eax, 1
add eax, 1
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x10]
call fcn.00403150
mov ecx, dword [eax]
mov esi, dword [esp + 0x10]
lea eax, [ecx - 0x10]
add esi, 0xfffffff0
cmp eax, esi
je 0x402edc
cmp dword [esi + 0xc], 0
lea edi, [esi + 0xc]
jl 0x402ecf
mov edx, dword [eax]
cmp edx, dword [esi]
jne 0x402ecf
call fcn.00403750
mov ebx, eax
or eax, 0xffffffff
lock xadd dword [edi], eax
dec eax
test eax, eax
jg 0x402ec6
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
add ebx, 0x10
mov dword [esp + 0x10], ebx
jmp 0x402edc
mov ebx, dword [ecx - 0xc]
push ecx
lea eax, [esp + 0x14]
call fcn.00403660
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402efc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x10]
push ecx
call fcn.004016e0
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
add esp, 4
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x402f29
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
mov esi, eax
sub esi, ebp
call edi
push 0x4056f4
mov ebp, eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov ebx, eax
call edi
mov edi, eax
sub edi, ebp
test ebx, ebx
je 0x402f7f
push 0x40570c
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x402f78
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x3c]
push esi
push edi
push ecx
mov ecx, dword [esp + 0x20]
push edx
mov edx, dword [esp + 0x3c]
push ecx
push edx
call eax
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [esp + 0x30]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402f9f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402fbf
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x38]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x402fdf
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0xe0]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
xor eax, eax
call fcn.0040413a
add esp, 0xd4
ret
push 0x80070057
call fcn.00401000
int3