Function at 0x40cb50
Capabilities:
Check if file exists
Enumerate files on windows
Get file attributes
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x4eeda1
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2e4
mov eax, dword [0x50d0e0]
push esi
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x24], eax
add ecx, 0x48
lea edx, [esp + 0x24]
mov dword [esp + 0x50], ecx
xor esi, esi
mov ecx, dword [ecx]
mov dword [esp + 0x2f0], esi
push ecx
push str._s.xml
push edx
call fcn.004074f0
mov ecx, dword [esp + 0x30]
add esp, 0xc
lea eax, [esp + 0x98]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x64], eax
jne 0x40cbf6
mov eax, dword [esp + 0x24]
mov ecx, dword [0x50d0e4]
lea edx, [eax - 0xc]
cmp edx, ecx
je 0x40d441
add eax, 0xfffffff4
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x40d441
mov eax, dword [esp + 0x24]
add eax, 0xfffffff4
push eax
call fcn.004de3a6
add esp, 4
jmp 0x40d441
mov ecx, dword [0x50d0e0]
mov dword [esp + 0x3c], ecx
lea ecx, [esp + 0x40]
call fcn.00427790
lea edx, [esp + 0xc]
lea ecx, [esp + 0x3c]
push edx
mov byte [esp + 0x2f4], 1
call fcn.00409410
test eax, eax
jne 0x40cc49
mov eax, dword [0x4fb6c0]
mov ecx, dword [0x4fb6c4]
mov edx, dword [0x4fb6c8]
mov dword [esp + 0xc], eax
mov eax, dword [0x4fb6cc]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], edx
mov dword [esp + 0x18], eax
push ebx
push ebp
lea ecx, [esp + 0x48]
push edi
push ecx
push 0x4fc6ec
push 3
lea edx, [esp + 0x24]
push esi
push edx
call dword [sym.imp.ole32.dll_CoCreateInstance]
mov dword [esp + 0x50], eax
mov eax, dword [0x50d0e0]
mov dword [esp + 0x58], esi
mov dword [esp + 0x34], esi
mov dword [esp + 0x2c], eax
mov byte [esp + 0x2fc], 2
xor ebp, ebp
test byte [esp + 0xa4], 0x10
jne 0x40d282
mov ecx, dword [0x50d0e0]
lea edx, [esp + 0xd0]
test edx, edx
mov dword [esp + 0x14], ecx
je 0x40cd0a
lea eax, [esp + 0xd0]
shr eax, 0x10
jne 0x40ccca
xor eax, eax
lea ecx, [esp + 0xd0]
mov ax, cx
lea ecx, [esp + 0x14]
push eax
call fcn.00407b60
jmp 0x40cd0a
lea edx, [esp + 0xd0]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov esi, eax
cmp esi, ebp
je 0x40cd0a
push esi
lea ecx, [esp + 0x18]
call fcn.00402190
test eax, eax
je 0x40cd0a
lea eax, [esi + esi]
lea ecx, [esp + 0xd0]
push eax
mov eax, dword [esp + 0x18]
lea edx, [esi + esi + 2]
push ecx
push edx
push eax
call fcn.00402060
add esp, 0x10
mov edx, dword [esp + 0x5c]
lea ecx, [esp + 0xd0]
push ecx
lea eax, [esp + 0x2c]
push edx
push eax
mov byte [esp + 0x308], 3
call fcn.00402910
mov ecx, dword [esp + 0x14]
push str.mini.xml
push ecx
call fcn.004dec69
add esp, 8
test eax, eax
je 0x40d268
mov eax, dword [esp + 0x28]
xor esi, esi
mov edi, eax
mov word [esp + 0x94], bp
push eax
lea ecx, [esp + 0x78]
mov word [esp + 0x78], bp
call fcn.00406940
lea edx, [esp + 0x94]
lea eax, [esp + 0x74]
push edx
push eax
push str.load
lea ecx, [esp + 0x58]
mov byte [esp + 0x308], 6
call fcn.00406990
test eax, eax
jl 0x40cd9d
cmp word [esp + 0x9c], 0xffff
sete al
test al, al
je 0x40cd9d
mov bl, 1
jmp 0x40cd9f
xor bl, bl
lea ecx, [esp + 0x74]
mov byte [esp + 0x2fc], 5
push ecx
call dword [sym.imp.OLEAUT32.dll_VariantCopy]
test bl, bl
je 0x40cdc5
push edi
lea ecx, [esp + 0x4c]
call fcn.00406e00
mov esi, 1
lea edx, [esp + 0x94]
push edx
call dword [sym.imp.OLEAUT32.dll_VariantCopy]
cmp esi, ebp
je 0x40d268
lea ecx, [esp + 0x44]
call fcn.00427790
lea ecx, [esp + 0x54]
xor esi, esi
call fcn.00427790
push str.skin
lea ecx, [esp + 0x88]
mov word [esp + 0x88], bp
call fcn.00406940
lea eax, [esp + 0x54]
lea ecx, [esp + 0x84]
push eax
push ecx
push str.selectSingleNode
lea ecx, [esp + 0x58]
mov byte [esp + 0x308], 9
call fcn.004080f0
lea edx, [esp + 0x84]
mov dword [esp + 0x50], eax
push edx
mov byte [esp + 0x300], 8
call dword [sym.imp.OLEAUT32.dll_VariantCopy]
cmp dword [esp + 0x50], ebp
jl 0x40ce62
mov eax, dword [esp + 0x54]
cmp eax, ebp
je 0x40ce62
push eax
lea ecx, [esp + 0x48]
call fcn.004080d0
mov esi, 1
lea ecx, [esp + 0x54]
mov byte [esp + 0x2fc], 7
call fcn.0042ca10
cmp esi, ebp
je 0x40d257
mov ebx, dword [esp + 0x38]
mov eax, dword [ebx + 0x94]
push eax
mov eax, dword [esp + 0x18]
push eax
call fcn.004dec69
add esp, 8
test eax, eax
jne 0x40ce9f
mov dword [esp + 0x34], 1
mov esi, dword [esp + 0x58]
cmp esi, ebp
jne 0x40cedc
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x14]
cmp eax, ecx
je 0x40cedc
cmp dword [eax - 0xc], ebp
jge 0x40cec5
mov edx, dword [0x50d0e4]
add eax, 0xfffffff4
cmp eax, edx
jne 0x40cece
cmp dword [ecx - 0xc], ebp
jge 0x40cf8c
push ecx
mov ecx, dword [ecx - 8]
push ecx
lea ecx, [esp + 0x34]
call fcn.004021f0
mov edi, dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov eax, dword [0x50d0e0]
inc esi
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
lea edx, [esp + 0x10]
inc esi
push 0x50e570
push edx
lea ecx, [esp + 0x48]
mov byte [esp + 0x304], 0xa
mov dword [esp + 0x60], esi
call fcn.004086e0
mov ecx, dword [esp + 0x10]
mov byte [esp + 0x2fc], 0xb
mov eax, dword [ecx - 8]
cmp eax, ebp
jne 0x40d082
mov eax, dword [0x50d0e0]
mov dword [esp + 0x3c], eax
mov ecx, dword [esp + 0x28]
push esi
push str.unknow
push ecx
lea edx, [esp + 0x48]
push 0x50e554
push edx
mov byte [esp + 0x310], 0xc
call fcn.004074f0
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x50]
add esp, 0x14
cmp eax, ecx
je 0x40cfc5
cmp dword [eax - 0xc], ebp
jge 0x40cf77
mov edx, dword [0x50d0e4]
add eax, 0xfffffff4
cmp eax, edx
jne 0x40cf7c
cmp dword [ecx - 0xc], ebp
jge 0x40cfae
mov eax, dword [ecx - 8]
push ecx
push eax
lea ecx, [esp + 0x24]
call fcn.004021f0
jmp 0x40cfc5
lea ecx, [esp + 0x2c]
call fcn.00402350
mov eax, dword [esp + 0x14]
mov edi, dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov dword [esp + 0x2c], eax
add eax, 0xfffffff4
push eax
call edi
jmp 0x40cee2
lea ecx, [esp + 0x1c]
call fcn.00402350
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x1c], eax
add eax, 0xfffffff4
push eax
call edi
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x28]
cmp eax, ecx
je 0x40d00f
cmp dword [eax - 0xc], ebp
jge 0x40cfe3
mov edx, dword [0x50d0e4]
add eax, 0xfffffff4
cmp eax, edx
jne 0x40cfe8
cmp dword [ecx - 0xc], ebp
jge 0x40cff8
push ecx
mov ecx, dword [ecx - 8]
push ecx
lea ecx, [esp + 0x20]
call fcn.004021f0
jmp 0x40d00f
lea ecx, [esp + 0x18]
call fcn.00402350
mov eax, dword [esp + 0x28]
mov dword [esp + 0x18], eax
add eax, 0xfffffff4
push eax
call edi
lea edx, [esp + 0xd0]
test edx, edx
jne 0x40d01e
xor eax, eax
jmp 0x40d02c
lea eax, [esp + 0xd0]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [esp + 0xd0]
push ecx
push eax
lea ecx, [esp + 0x28]
call fcn.004021f0
mov eax, dword [esp + 0x3c]
mov ecx, dword [0x50d0e4]
mov byte [esp + 0x2fc], 0xb
lea edx, [eax - 0xc]
cmp edx, ecx
je 0x40d13e
add eax, 0xfffffff4
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x40d13e
mov eax, dword [esp + 0x3c]
add eax, 0xfffffff4
push eax
call fcn.004de3a6
add esp, 4
jmp 0x40d13e
mov edx, dword [esp + 0x1c]
cmp edx, ecx
je 0x40d0c5
cmp dword [edx - 0xc], ebp
jge 0x40d09c
mov esi, dword [0x50d0e4]
add edx, 0xfffffff4
cmp edx, esi
jne 0x40d0a1
cmp dword [ecx - 0xc], ebp
jge 0x40d0ae
push ecx
push eax
lea ecx, [esp + 0x24]
call fcn.004021f0
jmp 0x40d0c5
lea ecx, [esp + 0x1c]
call fcn.00402350
mov eax, dword [esp + 0x10]
mov dword [esp + 0x1c], eax
add eax, 0xfffffff4
push eax
call edi
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x28]
cmp eax, ecx
je 0x40d10f
cmp dword [eax - 0xc], ebp
jge 0x40d0e3
mov edx, dword [0x50d0e4]
add eax, 0xfffffff4
cmp eax, edx
jne 0x40d0e8
cmp dword [ecx - 0xc], ebp
jge 0x40d0f8
push ecx
mov ecx, dword [ecx - 8]
push ecx
lea ecx, [esp + 0x20]
call fcn.004021f0
jmp 0x40d10f
lea ecx, [esp + 0x18]
call fcn.00402350
mov eax, dword [esp + 0x28]
mov dword [esp + 0x18], eax
add eax, 0xfffffff4
push eax
call edi
lea edx, [esp + 0xd0]
test edx, edx
jne 0x40d11e
xor eax, eax
jmp 0x40d12c
lea eax, [esp + 0xd0]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea ecx, [esp + 0xd0]
push ecx
push eax
lea ecx, [esp + 0x28]
call fcn.004021f0
mov eax, dword [esp + 0x10]
cmp dword [eax - 8], ebp
je 0x40d165
cmp dword [eax - 0xc], ebp
jl 0x40d157
lea ecx, [esp + 0x10]
call fcn.00402350
jmp 0x40d165
push 0x5209fc
lea ecx, [esp + 0x14]
call fcn.00406e00
lea edx, [esp + 0x68]
push 0x50e548
push edx
lea ecx, [esp + 0x48]
call fcn.004086e0
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x300], 0xd
call fcn.00402090
lea ecx, [esp + 0x68]
mov byte [esp + 0x2fc], 0xb
call fcn.00402160
push 0x50e544
lea ecx, [esp + 0x64]
call fcn.0040b220
mov ecx, dword [esp + 0x5c]
lea eax, [esp + 0x10]
push eax
lea edx, [esp + 0x68]
push ecx
push edx
mov byte [esp + 0x308], 0xe
call fcn.0040d460
lea ecx, [esp + 0x60]
lea edx, [esp + 0x6c]
push ecx
push eax
push edx
mov byte [esp + 0x308], 0xf
call fcn.0040d460
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x300], 0x10
call fcn.00402090
lea ecx, [esp + 0x6c]
call fcn.00402160
lea ecx, [esp + 0x64]
call fcn.00402160
lea ecx, [esp + 0x60]
mov byte [esp + 0x2fc], 0xb
call fcn.00402160
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40d23d
test al, 0x10
je 0x40d23d
mov eax, dword [ebx + 0x168]
lea ecx, [ebx + 0x160]
lea edx, [esp + 0x18]
push edx
push eax
call fcn.0040e190
lea ecx, [esp + 0x10]
call fcn.00402160
lea ecx, [esp + 0x18]
mov byte [esp + 0x2fc], 7
call fcn.0040d600
lea ecx, [esp + 0x44]
mov byte [esp + 0x2fc], 4
call fcn.0042ca10
lea ecx, [esp + 0x28]
call fcn.00402160
lea ecx, [esp + 0x14]
mov byte [esp + 0x2fc], 2
call fcn.00402160
mov esi, dword [esp + 0x70]
lea eax, [esp + 0xa4]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x40cc83
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp dword [esp + 0x34], ebp
jne 0x40d2c9
mov esi, dword [esp + 0x38]
lea ecx, [esp + 0x2c]
push ecx
lea ecx, [esi + 0x94]
call fcn.00402090
push 1
mov ecx, esi
call fcn.0040be80
jmp 0x40d2cd
mov esi, dword [esp + 0x38]
cmp dword [esi + 0x524], ebp
jne 0x40d3d9
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x5c]
add edx, 0x94
lea ecx, [esp + 0x34]
push edx
push eax
push ecx
call fcn.0040d460
mov edx, dword [esp + 0x34]
mov bl, 0x11
push edx
lea ecx, [esp + 0x4c]
mov byte [esp + 0x300], bl
call fcn.00408ff0
test eax, eax
je 0x40d3d0
lea ecx, [esp + 0x40]
call fcn.004098a0
lea eax, [esp + 0x40]
lea ecx, [esp + 0x48]
push eax
push str.skin
mov byte [esp + 0x304], 0x12
call fcn.004092b0
test eax, eax
je 0x40d3c0
lea ecx, [esp + 0x18]
xor edi, edi
push ecx
xor ebp, ebp
call dword [sym.imp.USER32.dll_GetDesktopWindow]
push eax
call dword [sym.imp.USER32.dll_GetWindowRect]
test eax, eax
je 0x40d36c
mov edi, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
mov ebp, dword [esp + 0x24]
mov eax, dword [esp + 0x1c]
sub edi, ecx
sub ebp, eax
push str.width
lea ecx, [esp + 0x44]
call fcn.00408910
push str.height
lea ecx, [esp + 0x44]
mov esi, eax
call fcn.00408910
mov ecx, eax
mov eax, edi
sub eax, esi
mov edi, dword [esp + 0x38]
cdq
sub eax, edx
mov edx, dword [esp + 0x18]
sar eax, 1
add eax, edx
mov dword [edi + 8], eax
add eax, esi
mov dword [edi + 0x10], eax
mov eax, ebp
sub eax, ecx
cdq
sub eax, edx
mov edx, dword [esp + 0x1c]
sar eax, 1
add eax, edx
mov dword [edi + 0xc], eax
add eax, ecx
mov dword [edi + 0x14], eax
xor ebp, ebp
lea ecx, [esp + 0x44]
mov byte [esp + 0x2fc], bl
call fcn.0042ca10
lea ecx, [esp + 0x34]
call fcn.00402160
mov eax, dword [esp + 0x58]
pop edi
cmp eax, ebp
pop ebp
pop ebx
lea ecx, [esp + 0x20]
jle 0x40d422
call fcn.00402160
lea ecx, [esp + 0x3c]
mov byte [esp + 0x2f0], 0
call fcn.00402ab0
lea ecx, [esp + 0x24]
call fcn.00402160
mov eax, 1
pop esi
mov ecx, dword [esp + 0x2e4]
mov dword fs:[0], ecx
add esp, 0x2f0
ret
call fcn.00402160
lea ecx, [esp + 0x3c]
mov byte [esp + 0x2f0], 0
call fcn.00402ab0
lea ecx, [esp + 0x24]
call fcn.00402160
mov ecx, dword [esp + 0x2e8]
xor eax, eax
pop esi
mov dword fs:[0], ecx
add esp, 0x2f0
ret