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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x878
mov eax, dword [0x474004]
xor eax, esp
mov dword [esp + 0x874], eax
mov eax, dword [0x476124]
push esi
push edi
push 0x476140
mov edi, dword [eax + 0xb8]
add edi, eax
lea eax, [esp + 0x47c]
push str._stextures_
push 0x400
push eax
mov dword [esp + 0x1c], edi
call fcn.00407220
mov esi, eax
add esp, 0x10
cmp esi, 0xffffffff
je 0x4061e8
lea eax, [esp + 0x478]
push eax
call fcn.004358fb
add esp, 4
cmp eax, 0xffffffff
jne 0x405e62
call fcn.004355c3
cmp dword [eax], 0x11
jne 0x4061e8
lea eax, [esp + 0x478]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x405e58
test al, 0x10
je 0x405e58
mov eax, 1
jmp 0x405e5a
xor eax, eax
test eax, eax
je 0x4061e8
mov eax, dword [0x476124]
mov ecx, 0x400
sub ecx, esi
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], ecx
cmp dword [eax + 0xb4], 0
jle 0x4061fd
lea eax, [esp + 0x478]
add eax, esi
mov dword [esp + 0x10], eax
test eax, eax
je 0x405ee9
test edi, edi
je 0x405ee9
test ecx, ecx
je 0x405ee9
mov esi, edi
lea edx, [esi + 1]
mov al, byte [esi]
inc esi
test al, al
jne 0x405ea5
sub esi, edx
lea eax, [esi + 1]
cmp eax, ecx
jbe 0x405ed5
lea eax, [ecx - 1]
push eax
push edi
push dword [esp + 0x18]
call fcn.00415e70
mov ecx, dword [esp + 0x24]
add esp, 0xc
mov eax, dword [esp + 0x10]
mov byte [eax + ecx - 1], 0
jmp 0x405eeb
push eax
push edi
push dword [esp + 0x18]
call fcn.00415e70
mov ecx, dword [esp + 0x24]
add esp, 0xc
jmp 0x405eeb
xor esi, esi
mov eax, ecx
sub eax, esi
js 0x4061e0
lea eax, [esp + 0x478]
push 0x46e970
push eax
call fcn.004344e7
mov edi, eax
add esp, 8
mov dword [esp + 8], edi
test edi, edi
je 0x4061ac
mov esi, dword [esp + 0xc]
mov ecx, esi
call fcn.004074c0
test eax, eax
jne 0x405f2c
or eax, 0xffffffff
jmp 0x405f3a
push 0x46e99c
push eax
call fcn.0043cdf4
add esp, 8
xorps xmm0, xmm0
test eax, eax
jne 0x406039
push dword [esp + 8]
movzx edi, word [esi + 0x44]
movzx esi, word [esi + 0x48]
mov word [esp + 0x34], ax
mov eax, 0x100
movaps xmmword [esp + 0x24], xmm0
mov word [esp + 0x29], ax
mov eax, dword [esp + 0x10]
push 1
push 0x12
mov word [esp + 0x2d], 0x101
mov eax, dword [eax + 0x4c]
add eax, dword [0x476124]
mov dword [esp + 0x20], eax
lea eax, [esp + 0x2c]
push eax
mov byte [esp + 0x37], 0x18
mov byte [esp + 0x40], 8
mov word [esp + 0x3c], di
mov word [esp + 0x3e], si
call fcn.00435494
mov eax, edi
add esp, 0x10
mov edi, dword [esp + 0x14]
imul eax, esi
movzx esi, word [esp + 0x25]
add eax, edi
test esi, esi
je 0x405fdf
lea edx, [esp + 0x79]
nop word [eax + eax]
movzx ecx, byte [eax]
lea eax, [eax + 3]
mov byte [edx + 1], cl
lea edx, [edx + 3]
movzx ecx, byte [eax - 2]
mov byte [edx - 3], cl
movzx ecx, byte [eax - 1]
mov byte [edx - 4], cl
sub esi, 1
jne 0x405fc0
push dword [esp + 8]
lea eax, [esp + 0x7c]
push 1
push 0x300
push eax
call fcn.00435494
movzx eax, word [esp + 0x3e]
add esp, 0x10
movzx ecx, word [esp + 0x2c]
lea esi, [eax - 1]
imul esi, ecx
add esi, edi
xor edi, edi
test eax, eax
je 0x40614d
push dword [esp + 8]
push 1
push ecx
push esi
call fcn.00435494
movzx ecx, word [esp + 0x3c]
inc edi
movzx eax, word [esp + 0x3e]
add esp, 0x10
sub esi, ecx
cmp edi, eax
jl 0x406013
jmp 0x40614d
mov eax, dword [esi + 0x44]
mov esi, dword [esi + 0x48]
movlpd qword [esp + 0x52], xmm0
mov dword [esp + 0x56], esi
imul esi, eax
mov dword [esp + 0x52], eax
push edi
push 1
push 0x36
mov dword [esp + 0x52], 0
mov dword [esp + 0x6a], 0
movlpd qword [esp + 0x72], xmm0
lea eax, [esi + 0x436]
mov dword [esp + 0x7e], 0
mov dword [esp + 0x4e], eax
mov eax, dword [esp + 0x18]
mov word [esp + 0x4c], 0x4d42
mov dword [esp + 0x66], 0x80001
mov dword [esp + 0x6e], esi
mov eax, dword [eax + 0x4c]
add eax, dword [0x476124]
mov dword [esp + 0x20], eax
lea eax, [esp + 0x4c]
push eax
mov dword [esp + 0x7e], 0x100
mov dword [esp + 0x5a], 0x436
mov dword [esp + 0x5e], 0x28
call fcn.00435494
mov ecx, dword [esp + 0x24]
add esp, 0x10
add ecx, esi
xor edx, edx
mov esi, dword [esp + 0x6e]
test esi, esi
jle 0x4060fa
movzx eax, byte [ecx]
lea ecx, [ecx + 3]
mov byte [esp + edx*4 + 0x7a], al
movzx eax, byte [ecx - 2]
mov byte [esp + edx*4 + 0x79], al
movzx eax, byte [ecx - 1]
mov byte [esp + edx*4 + 0x78], al
mov byte [esp + edx*4 + 0x7b], 0
inc edx
cmp edx, esi
jl 0x4060d6
push edi
push 1
lea eax, [esp + 0x80]
push 0x400
push eax
call fcn.00435494
mov eax, dword [esp + 0x66]
add esp, 0x10
mov ecx, dword [esp + 0x52]
xor edi, edi
lea esi, [eax - 1]
imul esi, ecx
add esi, dword [esp + 0x14]
test eax, eax
jle 0x40614d
nop word [eax + eax]
push dword [esp + 8]
push 1
push ecx
push esi
call fcn.00435494
mov ecx, dword [esp + 0x62]
inc edi
add esp, 0x10
sub esi, ecx
cmp edi, dword [esp + 0x56]
jl 0x406130
push dword [esp + 8]
call fcn.004346a6
lea eax, [esp + 0x47c]
push eax
push str.Texture:__s_n
call fcn.00401070
mov eax, dword [0x476124]
add esp, 0xc
mov edx, dword [esp + 0x1c]
mov edi, dword [esp + 0xc]
inc edx
mov ecx, dword [esp + 0x18]
add edi, 0x50
cmp edx, dword [eax + 0xb4]
mov eax, dword [esp + 0x10]
mov dword [esp + 0x1c], edx
mov dword [esp + 0xc], edi
jl 0x405e94
pop edi
pop esi
mov ecx, dword [esp + 0x874]
xor ecx, esp
call fcn.0040c2d8
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x478]
push eax
push str.ERROR:_Couldnt_write_texture_file__s_n
push 2
call fcn.00417c5b
add esp, 4
push eax
call fcn.00401040
add esp, 0xc
pop edi
pop esi
mov ecx, dword [esp + 0x874]
xor ecx, esp
call fcn.0040c2d8
mov esp, ebp
pop ebp
ret
push edi
push str.ERROR:_Destination_path_is_too_long._Couldnt_write__s_n
jmp 0x4061b9
push 2
call fcn.00417c5b
push eax
push str.ERROR:_Destination_path_is_too_long_or_write_permission_denied._Couldnt_create_directory_for_textures_n
call fcn.00433985
add esp, 0xc
mov ecx, dword [esp + 0x87c]
pop edi
pop esi
xor ecx, esp
call fcn.0040c2d8
mov esp, ebp
pop ebp
ret