Function at 0x40013630
Capabilities:
Check if file exists
Get file attributes
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x106c
call fcn.4001eac0
mov eax, dword [0x4006f01c]
xor eax, esp
mov dword [esp + 0x1068], eax
mov edx, dword [0x40477460]
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
push esi
xor esi, esi
cmp byte [edx + 0x40], 0
mov dword [esp + 0x28], ecx
mov ecx, dword [ebp + 0x10]
push edi
mov dword [esp + 0x40], eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x38], esi
mov dword [esp + 0x30], esi
je 0x40013689
mov dword [esp + 0x10], 0x7d0b
jmp 0x40013f5b
cmp ebx, esi
jne 0x4001369a
mov dword [esp + 0x10], 0x7d08
jmp 0x40013f5b
push ebx
call fcn.40011aa0
mov eax, dword [0x40477438]
add esp, 4
push 0x4c
push esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov dword [esp + 0x20], edi
cmp edi, esi
je 0x4001373b
mov esi, edi
call fcn.40010ed0
xor eax, eax
or ecx, 0xffffffff
mov dword [edi + 0x18], eax
mov byte [edi + 0x1c], al
mov dword [edi + 0x20], eax
mov dword [edi + 0x24], ecx
mov dword [edi + 0x28], eax
mov dword [edi], vtable.SafeMachine::Module.0
mov byte [edi + 0x14], 0
mov byte [edi + 0x15], 0
mov byte [edi + 0x16], 0
mov byte [edi + 0x17], 0
mov dword [edi + 0x2c], eax
mov dword [edi + 0x30], ecx
mov dword [edi + 0x34], eax
mov dword [edi + 0x38], eax
mov dword [edi + 0x44], ecx
mov ecx, dword [esp + 0x1c]
push ecx
mov dword [edi + 0x3c], eax
mov dword [edi + 0x40], eax
mov byte [edi + 0x48], al
push ebx
mov eax, edi
mov dword [esp + 0x38], edi
call fcn.4000f850
mov esi, eax
mov dword [esp + 0x10], esi
cmp esi, 0x7d00
je 0x4001374c
mov edx, dword [edi]
mov eax, dword [edx]
push 1
mov ecx, edi
call eax
mov dword [esp + 0x30], 0
jmp 0x40013f39
mov dword [esp + 0x30], esi
mov dword [esp + 0x10], 0x7d05
jmp 0x40013f5b
mov ecx, dword [esp + 0x2c]
mov eax, dword [ecx + 4]
cmp dword [eax], 0
jne 0x4001375c
mov dword [eax], edi
jmp 0x40013768
mov edx, dword [eax + 4]
mov dword [edi + 4], edx
mov ecx, dword [eax + 4]
mov dword [ecx + 8], edi
inc dword [eax + 8]
mov ebx, dword [esp + 0x2c]
mov dword [eax + 4], edi
mov eax, edi
mov esi, ebx
call fcn.40014700
cmp dword [ebx + 0x10], 0
jne 0x400137d6
mov eax, dword [edi + 0x38]
test eax, eax
je 0x400137d6
movzx eax, word [eax + 0x16]
test al, 2
je 0x400137d6
test eax, 0x2000
jne 0x400137d6
mov esi, dword [edi + 0x3c]
call fcn.40007980
xor ecx, ecx
mov dword [ebx + 0x10], eax
test eax, eax
je 0x400137bc
cmp word [eax], cx
je 0x400137b8
lea ecx, [ecx]
inc ecx
cmp word [eax + ecx*2], 0
jne 0x400137b0
test ecx, ecx
jl 0x400137d6
lea edx, [eax + ecx*2]
nop
cmp word [edx], 0x5c
je 0x400137d0
dec ecx
sub edx, 2
test ecx, ecx
jge 0x400137c0
jmp 0x400137d6
xor edx, edx
mov word [eax + ecx*2], dx
mov eax, dword [edi + 0x38]
test eax, eax
je 0x400137ff
movzx eax, word [eax + 0x16]
test al, 2
je 0x400137ff
test eax, 0x2000
jne 0x400137ff
cmp dword [ebx + 8], 0xffffffff
je 0x400137ff
mov dword [esp + 0x10], 0x7d28
jmp 0x40013f41
mov eax, dword [edi + 0x38]
test eax, eax
je 0x40013937
movzx eax, word [eax + 0x16]
test al, 2
je 0x40013937
test eax, 0x2000
jne 0x40013937
mov eax, ebx
cmp dword [eax + 8], 0xffffffff
jne 0x40013937
cmp dword [0x40477408], 0
je 0x40013937
cmp dword [0x4047740c], 0
je 0x40013937
cmp dword [0x40477410], 0
je 0x40013937
push 0x20
lea ecx, [esp + 0x48]
push 0
push ecx
call fcn.40001a40
mov edx, dword [edi + 0x3c]
mov eax, dword [0x40477460]
add esp, 0xc
lea ecx, [esp + 0x44]
mov dword [esp + 0x44], 0x20
mov dword [esp + 0x4c], edx
mov dword [esp + 0x58], 1
mov dword [esp + 0x48], 8
mov ebx, dword [eax + 0x54]
push ecx
call fcn.400153e0
mov esi, dword [esp + 0x2c]
mov dword [esi + 8], eax
cmp eax, 0xffffffff
jne 0x40013905
mov eax, dword [edi + 0x3c]
push eax
xor edx, edx
push str._s.manifest
push 0x800
lea ecx, [esp + 0x74]
mov word [esp + 0x1074], dx
call fcn.40007560
add esp, 0xc
lea ecx, [esp + 0x68]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40013905
mov eax, dword [0x40477460]
lea edx, [esp + 0x68]
lea ecx, [esp + 0x44]
mov dword [esp + 0x4c], edx
mov dword [esp + 0x48], 0
mov ebx, dword [eax + 0x54]
push ecx
call fcn.400153e0
mov dword [esi + 8], eax
cmp eax, 0xffffffff
jne 0x40013905
call fcn.40011aa0
mov eax, dword [esi + 8]
cmp eax, 0xffffffff
je 0x40013937
lea edx, [esi + 0xc]
push edx
push eax
call dword [0x4047740c]
test eax, eax
jne 0x40013933
mov eax, dword [esi + 8]
push eax
mov dword [esp + 0x14], 0x7d27
call dword [0x40477410]
jmp 0x40013f41
mov byte [edi + 0x48], 1
mov eax, dword [edi + 0x38]
test eax, eax
je 0x40013a2a
mov eax, dword [eax + 0x80]
test eax, eax
je 0x40013a2a
mov esi, dword [edi + 0x34]
add esi, eax
push 0x14
push esi
mov dword [esp + 0x3c], esi
call fcn.40001d00
test al, al
je 0x40013a2a
test esi, esi
je 0x40013a2a
cmp dword [esi + 0x10], 0
mov dword [esp + 0x1c], 0
je 0x40013a2a
mov edi, dword [edi + 0x20]
mov ebx, dword [esi + 0xc]
add ebx, edi
push ebx
mov dword [esp + 0x18], edi
call fcn.40001cb0
add esp, 4
test al, al
je 0x40013baf
mov edi, dword [esi]
test edi, edi
je 0x400139ae
mov ecx, dword [esp + 0x14]
add edi, ecx
jmp 0x400139b5
mov edi, dword [esi + 0x10]
add edi, dword [esp + 0x14]
mov esi, dword [esi + 0x10]
add esi, dword [esp + 0x14]
push ebx
mov dword [esp + 0x1c], esi
call fcn.40009700
mov esi, eax
call fcn.40008a70
test al, al
jne 0x40013b35
push ebx
call fcn.400079c0
mov esi, eax
add esp, 4
test esi, esi
je 0x40013cd9
mov ecx, dword [esp + 0x2c]
push 0xffffffffffffffff
lea edx, [esp + 0x3c]
push edx
push esi
call fcn.40013630
push esi
mov dword [esp + 0x14], eax
mov eax, dword [0x40477438]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x38]
test eax, eax
jne 0x40013b48
cmp dword [esp + 0x10], 0x7d00
jne 0x40013f41
mov edi, dword [esp + 0x20]
cmp byte [edi + 0x15], 0
jne 0x40013a4c
cmp byte [edi + 0x16], 0
jne 0x40013a4c
mov eax, edi
call fcn.4000fab0
mov dword [esp + 0x10], eax
cmp eax, 0x7d00
jne 0x40013f41
mov eax, dword [edi + 0x40]
test eax, eax
je 0x40013f35
call fcn.40008b40
test eax, eax
je 0x40013f35
mov eax, dword [eax + 4]
cmp dword [eax], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x28], eax
je 0x40013da5
mov ecx, eax
mov dword [esp + 0x14], ecx
mov edx, dword [esp + 0x14]
mov eax, dword [edx]
push eax
mov ecx, edi
call fcn.40010a40
mov dword [esp + 0x34], eax
test eax, eax
je 0x40013d84
mov ecx, dword [esp + 0x14]
mov ebx, dword [ecx]
test ebx, ebx
je 0x40013d7f
push 0
push 0
push 0xffffffffffffffff
push ebx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, eax
test esi, esi
je 0x40013d7f
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
mov eax, dword [0x40477438]
push ecx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push esi
push eax
push 0xffffffffffffffff
push ebx
push 0
push 0
mov dword [esp + 0x30], eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x40013d7f
cmp dword [esp + 0x18], 0
je 0x40013d7f
mov esi, dword [esp + 0x34]
mov eax, dword [0x40477440]
mov edx, dword [eax + 0xc]
mov ecx, esi
and ecx, 0x7ff
lea ebx, [edx + ecx*8]
mov dword [esp + 0x24], eax
cmp dword [ebx], esi
jne 0x40013cf3
mov ebx, dword [ebx + 4]
jmp 0x40013d1c
mov eax, dword [esp + 0x2c]
mov edx, esi
call fcn.40014040
mov dword [esp + 0x38], eax
test eax, eax
je 0x40013baf
mov ecx, dword [esp + 0x20]
push ecx
mov esi, eax
mov ebx, eax
call fcn.40014d00
cmp eax, 0x7d00
jne 0x40013ce6
mov esi, dword [esp + 0x20]
push ebx
call fcn.40014d70
cmp eax, 0x7d00
jne 0x40013ce6
mov edx, esi
cmp byte [edx + 0x16], 0
jne 0x40013cb2
push 4
xor ebx, ebx
push edi
mov dword [esp + 0x2c], ebx
call fcn.40001d00
test al, al
je 0x40013baf
mov esi, edi
cmp dword [esi], 0
je 0x40013bbc
inc ebx
push 4
lea esi, [edi + ebx*4]
push esi
mov dword [esp + 0x2c], ebx
call fcn.40001d00
test al, al
jne 0x40013b96
mov dword [esp + 0x10], 0x7d27
jmp 0x40013f41
test al, al
je 0x40013baf
mov dword [esp + 0x3c], 0
test ebx, ebx
jle 0x40013bea
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x3c]
push eax
push 4
lea ecx, [ebx*4]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x40013baf
cmp dword [edi], 0
mov dword [esp + 0x28], 0
je 0x40013c74
xor ebx, ebx
lea esp, [esp]
mov eax, dword [esp + 0x18]
lea esi, [ebx + eax]
push 4
push esi
call fcn.40001d00
test al, al
je 0x40013baf
mov eax, dword [ebx + edi]
test eax, eax
jns 0x40013c2b
and eax, 0x7fffffff
push eax
mov eax, dword [esp + 0x3c]
call fcn.40010b80
jmp 0x40013c3d
mov ecx, dword [esp + 0x14]
lea edx, [eax + ecx + 2]
mov ecx, dword [esp + 0x38]
push edx
call fcn.40010a40
mov dword [esi], eax
test eax, eax
jne 0x40013c5e
mov eax, dword [ebx + edi]
mov ecx, dword [esp + 0x14]
lea edx, [ecx + eax + 2]
push edx
push esi
call fcn.40011aa0
add esp, 8
mov dword [esi], 0x40009010
mov eax, dword [esp + 0x28]
inc eax
lea ebx, [eax*4]
cmp dword [ebx + edi], 0
mov dword [esp + 0x28], eax
jne 0x40013c00
cmp dword [esp + 0x10], 0x7d00
jne 0x40013f41
cmp dword [esp + 0x24], 0
jle 0x40013cb2
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x24]
lea eax, [esp + 0x64]
push eax
push ecx
mov ecx, dword [esp + 0x20]
lea eax, [edx*4]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x40013baf
mov eax, dword [esp + 0x1c]
inc eax
lea edx, [eax + eax*4]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x34]
cmp dword [eax + edx*4 + 0x10], 0
lea esi, [eax + edx*4]
je 0x40013a18
mov edi, dword [esp + 0x20]
jmp 0x40013983
mov dword [esp + 0x10], 0x7d29
jmp 0x40013f41
mov dword [esp + 0x10], 0x7dff
jmp 0x40013f41
push esi
push eax
call fcn.40008e00
test eax, eax
je 0x40013d44
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx + 8]
mov eax, dword [eax]
and edx, esi
mov eax, dword [eax + edx*4]
test eax, eax
je 0x40013d15
mov dword [ebx], esi
mov dword [ebx + 4], eax
mov ebx, eax
mov eax, dword [0x40477440]
test ebx, ebx
je 0x40013d48
cmp byte [ebx + 0xc], 0
jne 0x40013d48
cmp byte [ebx + 0x15], 0
je 0x40013d69
mov ebx, dword [esp + 0x14]
cmp byte [ebx + 0x10], 0
jne 0x40013d69
mov eax, esi
call fcn.40008900
mov eax, dword [0x40477440]
jmp 0x40013d4c
xor eax, eax
jmp 0x40013d15
mov ebx, dword [esp + 0x14]
movzx ecx, byte [ebx + 0x10]
mov edx, dword [ebx + 4]
push ecx
mov ecx, dword [ebx + 0xc]
push edx
mov edx, dword [edi + 0x40]
push ecx
mov ecx, dword [esp + 0x24]
push esi
push edx
mov ebx, eax
call fcn.40008800
mov eax, dword [esp + 0x18]
mov ecx, dword [0x40477438]
push eax
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x40013d84
call fcn.40011aa0
mov eax, dword [esp + 0x1c]
inc eax
mov dword [esp + 0x1c], eax
lea edx, [eax + eax*4]
mov eax, dword [esp + 0x28]
cmp dword [eax + edx*4], 0
lea eax, [eax + edx*4]
mov dword [esp + 0x14], eax
jne 0x40013a82
mov eax, dword [edi + 0x38]
test eax, eax
je 0x40013dcb
mov eax, dword [eax + 0x78]
test eax, eax
je 0x40013dcb
mov esi, dword [edi + 0x34]
add esi, eax
push 0x28
push esi
call fcn.40001d00
movzx eax, al
neg eax
sbb eax, eax
and eax, esi
jmp 0x40013dcd
xor eax, eax
mov ecx, dword [edi + 0x20]
mov edx, dword [eax + 0x1c]
add edx, ecx
mov dword [esp + 0x28], edx
mov edx, dword [eax + 0x20]
add edx, ecx
mov dword [esp + 0x24], edx
mov edx, dword [eax + 0x24]
add edx, ecx
cmp dword [eax + 0x18], 0
mov dword [esp + 0x1c], eax
mov dword [esp + 0x34], edx
mov dword [esp + 0x14], 0
jbe 0x40013f35
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x14]
movzx eax, word [ecx + edx*2]
mov ecx, dword [esp + 0x28]
mov esi, dword [ecx + eax*4]
add esi, dword [edi + 0x20]
mov eax, dword [0x40477440]
mov ecx, dword [eax + 0xc]
mov edx, esi
and edx, 0x7ff
lea ebx, [ecx + edx*8]
mov dword [esp + 0x18], eax
cmp dword [ebx], esi
jne 0x40013e37
mov ebx, dword [ebx + 4]
jmp 0x40013e5f
push esi
push eax
call fcn.40008e00
test eax, eax
je 0x40013f0f
mov edx, dword [esp + 0x18]
mov ecx, dword [edx + 8]
mov edx, dword [eax]
and ecx, esi
mov eax, dword [edx + ecx*4]
test eax, eax
je 0x40013e5d
mov dword [ebx], esi
mov dword [ebx + 4], eax
mov ebx, eax
test ebx, ebx
je 0x40013e73
cmp byte [ebx + 0xc], 0
jne 0x40013e73
cmp dword [ebx + 8], 0
jne 0x40013f1f
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x14]
mov eax, dword [eax + ecx*4]
add eax, dword [edi + 0x20]
mov dword [esp + 0x18], eax
je 0x40013f16
push 0
push 0
push 0xffffffffffffffff
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ebx, eax
test ebx, ebx
je 0x40013f16
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
mov eax, dword [0x40477438]
push ecx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ecx, dword [esp + 0x18]
push ebx
mov edi, eax
push edi
push 0xffffffffffffffff
push ecx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
je 0x40013f16
test edi, edi
je 0x40013f16
mov edx, dword [esp + 0x20]
mov eax, dword [edx + 0x40]
mov ebx, dword [0x40477440]
push 0
push 0
push 0x40009010
push esi
push eax
mov ecx, edi
call fcn.40008800
mov ecx, dword [0x40477438]
push edi
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x40013f1b
xor eax, eax
jmp 0x40013e5d
call fcn.40011aa0
mov edi, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
inc eax
mov dword [esp + 0x14], eax
cmp eax, dword [edx + 0x18]
jb 0x40013e01
mov esi, dword [esp + 0x10]
cmp esi, 0x7d00
je 0x40013f5b
mov eax, dword [esp + 0x30]
test eax, eax
je 0x40013f5b
mov ecx, dword [esp + 0x2c]
push eax
call fcn.40013f90
mov dword [esp + 0x30], 0
mov eax, dword [esp + 0x40]
test eax, eax
je 0x40013f69
mov ecx, dword [esp + 0x30]
mov dword [eax], ecx
mov ecx, dword [esp + 0x1074]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.4001a06e
mov esp, ebp
pop ebp
ret 0xc