Function at 0x4018b0
Capabilities:
Check if file exists
Create directory
Get file attributes
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x85c
mov eax, dword [0x474004]
xor eax, esp
mov dword [esp + 0x858], eax
push ebx
push esi
push edi
mov ebx, ecx
mov dword [esp + 0x24], 0x54534449
push ebx
push str.MDL:__s_n
mov dword [esp + 0x30], 0x51534449
call fcn.00401070
add esp, 8
test ebx, ebx
je 0x40191e
mov edi, ebx
lea ecx, [edi + 1]
mov al, byte [edi]
inc edi
test al, al
jne 0x4018f6
sub edi, ecx
cmp edi, 0x3fd
jbe 0x401920
push 2
call fcn.00417d1b
push eax
push str.ERROR:_Source_path_is_too_long._n
call fcn.00433a45
jmp 0x402133
xor edi, edi
mov ecx, ebx
call fcn.00407580
test eax, eax
jne 0x40195a
push str.ERROR:_Source_file_does_not_have_extension._n
push 2
call fcn.00417d1b
add esp, 4
push eax
call fcn.00401040
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x858]
xor ecx, esp
call fcn.0040c398
mov esp, ebp
pop ebp
ret
push 0x46db20
push eax
call fcn.0043ceb3
add esp, 8
test eax, eax
je 0x401973
push str.ERROR:_Only_.mdl_files_is_supported._n
jmp 0x401930
lea edx, [esp + 0x10]
mov ecx, ebx
call fcn.004065d0
mov edx, eax
mov dword [0x476940], edx
test edx, edx
jne 0x401995
push ebx
push str.ERROR:_Cant_open__s_n
jmp 0x402123
mov eax, dword [esp + 0x10]
cmp eax, 0xf4
jb 0x40211d
cmp eax, dword [edx + 0x48]
jne 0x40211d
mov eax, dword [edx]
lea ecx, [esp + 0x24]
cmp eax, dword [ecx]
je 0x4019f2
lea ecx, [esp + 0x28]
mov esi, str.ERROR:__s_is_not_a_main_HL_model_file._n
cmp eax, dword [ecx]
je 0x4019c9
mov esi, str.ERROR:__s_is_not_a_valid_HL_model_file._n
push 2
call fcn.00417d1b
push ebx
push esi
push eax
call fcn.00401040
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x858]
xor ecx, esp
call fcn.0040c398
mov esp, ebp
pop ebp
ret
mov eax, dword [edx + 4]
cmp eax, 0xa
je 0x401a2b
push eax
push ebx
push str.ERROR:__s_has_unknown_Studio_MDL_format_version__d._n
push 2
call fcn.00417d1b
add esp, 4
push eax
call fcn.00401040
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x858]
xor ecx, esp
call fcn.0040c398
mov esp, ebp
pop ebp
ret
cmp dword [edx + 0xcc], 0
jne 0x401a3f
push ebx
push str.ERROR:__s_is_not_a_main_HL_model_file._n
jmp 0x402123
mov al, byte [0x476140]
test al, al
je 0x401ad0
mov esi, 0x476140
push 0x46e9b0
push esi
call fcn.00435590
mov esi, eax
add esp, 8
test esi, esi
je 0x401a6e
mov al, byte [esi]
mov byte [esp + 0x1b], al
mov byte [esi], 0
push 0x476140
call fcn.004359bb
add esp, 4
cmp eax, 0xffffffff
jne 0x401aab
call fcn.00435683
cmp dword [eax], 0x11
jne 0x401ac1
push 0x476140
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x401aa5
test al, 0x10
je 0x401aa5
mov eax, 1
jmp 0x401aa7
xor eax, eax
test eax, eax
je 0x401ac1
test esi, esi
je 0x401b37
mov al, byte [esp + 0x1b]
mov byte [esi], al
inc esi
cmp byte [esi], 0
jne 0x401a51
jmp 0x401b37
push 0x476140
push str.ERROR:_Couldnt_create_directory__s_n
jmp 0x402123
test ebx, ebx
je 0x401af4
mov ecx, ebx
lea esi, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401ae0
sub ecx, esi
lea esi, [ebx - 1]
add esi, ecx
cmp esi, ebx
jbe 0x401b16
jmp 0x401af7
lea esi, [ebx - 1]
mov cl, byte [esi - 1]
cmp cl, 0x5c
je 0x401b1f
cmp cl, 0x2f
je 0x401b12
dec esi
cmp esi, ebx
ja 0x401af7
mov byte [0x476140], 0
jmp 0x401b70
cmp esi, ebx
ja 0x401b1f
mov byte [0x476140], 0
jmp 0x401b70
sub esi, ebx
push esi
push ebx
push 0x476140
call fcn.00415f30
add esp, 0xc
mov byte [esi + 0x47613f], 0
mov al, byte [0x476140]
mov edx, dword [0x476940]
test al, al
je 0x401b70
mov ecx, 0x476140
lea esi, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401b50
sub ecx, esi
mov al, byte [ecx + 0x47613f]
cmp al, 0x5c
je 0x401b70
cmp al, 0x2f
je 0x401b70
mov word [ecx + 0x476140], 0x2f
sub edi, 4
cmp dword [edx + 0xb4], 0
mov dword [esp + 0x14], edi
jne 0x401c7e
test ebx, ebx
je 0x401bce
mov ecx, ebx
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401b90
sub ecx, edx
inc ecx
cmp ecx, 0x400
jbe 0x401bbf
mov ecx, 0xff
lea edi, [esp + 0x60]
mov esi, ebx
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x14]
mov byte [esp + 0x45f], al
jmp 0x401bce
push ecx
lea eax, [esp + 0x64]
push ebx
push eax
call fcn.00415f30
add esp, 0xc
mov esi, 0x400
sub esi, edi
lea edi, [esp + edi + 0x60]
mov dword [esp + 0x20], esi
test edi, edi
je 0x401c14
test esi, esi
je 0x401c14
cmp esi, 6
jae 0x401c03
lea eax, [esi - 1]
push eax
push str.t.mdl
push edi
call fcn.00415f30
add esp, 0xc
mov byte [edi + esi - 1], 0
jmp 0x401c14
mov eax, dword [str.t.mdl]
mov dword [edi], eax
mov ax, word [0x46dc28]
mov word [edi + 4], ax
lea edx, [esp + 0x10]
lea ecx, [esp + 0x60]
call fcn.004065d0
mov ecx, eax
mov dword [0x476124], ecx
test ecx, ecx
jne 0x401c3c
lea eax, [esp + 0x60]
push eax
push str.ERROR:_Cant_open_external_textures_file__s_n
jmp 0x402123
mov eax, dword [esp + 0x10]
cmp eax, 0xf4
jb 0x401c74
mov edx, dword [0x476940]
cmp eax, dword [edx + 0x48]
jne 0x401c74
mov eax, dword [ecx]
lea esi, [esp + 0x24]
cmp eax, dword [esi]
jne 0x401c65
cmp dword [ecx + 0xb4], 0
jne 0x401c8f
lea eax, [esp + 0x60]
push eax
push str.ERROR:__s_is_not_a_valid_external_textures_file._n
jmp 0x402123
lea eax, [esp + 0x60]
push eax
jmp 0x40211e
mov eax, 0x400
mov dword [0x476124], edx
sub eax, edi
mov dword [esp + 0x20], eax
mov eax, dword [edx + 0xac]
shl eax, 2
push eax
call fcn.00433a79
add esp, 4
mov dword [0x476128], eax
test eax, eax
jne 0x401cc1
push 2
call fcn.00417d1b
push eax
push str.ERROR:_Couldnt_allocate_memory_for_sequences._n
call fcn.00433a45
jmp 0x402133
mov edi, dword [0x476940]
mov dword [eax], edi
cmp dword [edi + 0xac], 1
jle 0x401e64
test ebx, ebx
je 0x401d26
mov edx, ebx
lea esi, [edx + 1]
nop
mov al, byte [edx]
inc edx
test al, al
jne 0x401ce0
sub edx, esi
inc edx
cmp edx, 0x400
jbe 0x401d14
mov ecx, 0xff
lea edi, [esp + 0x460]
mov esi, ebx
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
mov edi, dword [0x476940]
mov byte [esp + 0x85f], al
jmp 0x401d26
push edx
lea eax, [esp + 0x464]
push ebx
push eax
call fcn.00415f30
add esp, 0xc
mov esi, 1
cmp dword [edi + 0xac], esi
jle 0x401e64
mov eax, dword [esp + 0x14]
lea eax, [esp + eax + 0x460]
mov dword [esp + 0x1c], eax
push esi
push str._02d.mdl
push dword [esp + 0x28]
push eax
call fcn.004072e0
lea eax, [esp + 0x470]
push 0x46e9dc
push eax
call fcn.004345a7
mov edi, eax
lea ecx, [esi*4]
add esp, 0x18
mov dword [esp + 0x2c], ecx
test edi, edi
je 0x401e46
push edi
call fcn.0043cfe7
lea ecx, [esp + 0x34]
push ecx
push eax
call fcn.00437aca
mov eax, dword [esp + 0x50]
push eax
mov dword [esp + 0x24], eax
call fcn.00433a79
add esp, 0x10
mov dword [esp + 0x10], eax
test eax, eax
je 0x401e24
push edi
push 1
push dword [esp + 0x1c]
push eax
call fcn.00435c31
push edi
call fcn.00434766
mov eax, dword [0x476128]
lea edx, [esi*4]
mov ecx, dword [esp + 0x24]
add esp, 0x14
mov dword [edx + eax], ecx
mov eax, dword [esp + 0x14]
cmp eax, 0xf4
jb 0x401e17
mov edi, dword [0x476940]
cmp eax, dword [edi + 0x48]
jne 0x401e17
mov eax, dword [ecx]
lea edx, [esp + 0x28]
cmp eax, dword [edx]
jne 0x401e05
inc esi
cmp esi, dword [edi + 0xac]
jge 0x401e64
mov eax, dword [esp + 0x1c]
jmp 0x401d46
lea eax, [esp + 0x460]
push eax
push str.ERROR:__s_is_not_a_valid_sequence_file._n
jmp 0x402123
lea eax, [esp + 0x460]
push eax
jmp 0x40211e
mov eax, dword [0x476128]
mov edx, dword [esp + 0x2c]
mov dword [edx + eax], 0
lea eax, [esp + 0x460]
push eax
push str.ERROR:_Cant_open_sequence_file__s_n
jmp 0x402123
mov eax, dword [0x476128]
mov dword [ecx + eax], 0
lea eax, [esp + 0x460]
push eax
push str.ERROR:_Cant_open_sequence_file__s_n
jmp 0x402123
test ebx, ebx
je 0x401ec5
cmp byte [ebx], 0
je 0x401ec5
mov cl, byte [ebx]
xor esi, esi
mov eax, ebx
cmp cl, 0x2f
je 0x401e82
cmp cl, 0x5c
je 0x401e82
lea edx, [eax + 1]
jmp 0x401e87
lea ebx, [eax + 1]
mov edx, ebx
cmp cl, 0x2e
cmovne eax, esi
mov esi, eax
mov eax, edx
mov cl, byte [eax]
test cl, cl
jne 0x401e73
test esi, esi
je 0x401e9f
cmp esi, ebx
jae 0x401ea1
mov esi, edx
mov eax, 0x3ff
sub esi, ebx
cmp esi, eax
cmova esi, eax
push esi
push ebx
push 0x476540
call fcn.00415f30
add esp, 0xc
mov byte [esi + 0x476540], 0
jmp 0x401ecc
mov byte [0x476540], 0
mov eax, dword [edi + 0x8c]
mov ecx, dword [edi + 0x9c]
shl eax, 2
cmp ecx, eax
jle 0x401ee7
push ecx
push str.WARNING:_Invalid_hitboxes_number__d._n
jmp 0x401efe
mov edx, dword [edi + 0xa0]
lea eax, [ecx + ecx*8]
lea eax, [edx + eax*8]
cmp eax, dword [edi + 0x48]
jbe 0x401f15
push edx
push str.WARNING:_Invalid_hitboxes_offset__d._n
call fcn.00401070
mov eax, dword [0x476940]
add esp, 8
mov dword [eax + 0x9c], 0
mov ecx, dword [0x476124]
xor ebx, ebx
xor esi, esi
mov dword [esp + 0x20], ebx
mov dword [esp + 0x10], ebx
mov edi, dword [ecx + 0xb8]
add edi, ecx
cmp dword [ecx + 0xb4], ebx
jle 0x401f5e
nop word [eax + eax]
mov edx, 0x40
mov ecx, edi
call fcn.00406440
mov ecx, dword [0x476124]
inc esi
add edi, 0x50
cmp esi, dword [ecx + 0xb4]
jl 0x401f40
imul eax, esi, 0xffffffb0
mov dword [esp + 0x14], ebx
add edi, eax
cmp dword [ecx + 0xb4], ebx
jle 0x401ffb
mov ecx, edi
call fcn.00401160
test eax, eax
jne 0x401f96
inc ebx
push ebx
push str.MDLDEC_Texture_i.bmp
push 0x40
push edi
mov dword [esp + 0x30], ebx
call fcn.004072e0
add esp, 0x10
jmp 0x401fbb
mov eax, dword [0x476124]
xor ecx, ecx
xor ebx, ebx
mov dword [esp + 0x1c], ecx
mov esi, dword [eax + 0xb8]
add esi, eax
cmp dword [eax + 0xb4], ecx
jg 0x402084
mov ebx, dword [esp + 0x20]
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
add edi, 0x50
mov eax, dword [0x476124]
inc ecx
mov dword [esp + 0x14], ecx
cmp ecx, dword [eax + 0xb4]
jl 0x401f73
test ebx, ebx
je 0x401fea
push ebx
push str.WARNING:_Gived_name_to__i_protected_texture_s_._n
call fcn.00401070
add esp, 8
test esi, esi
je 0x401ffb
push str.WARNING:_Added_numeric_suffix_to_repeated_texture_name_s_.
call fcn.004196cc
add esp, 4
call fcn.00401380
call fcn.004015f0
mov eax, dword [0x476940]
xor ebx, ebx
xor edi, edi
mov esi, dword [eax + 0x90]
add esi, eax
cmp dword [eax + 0x8c], ebx
jle 0x402064
nop
mov ecx, esi
mov byte [esi + 0x1f], 0
call fcn.00401160
test eax, eax
jne 0x402041
inc edi
push edi
push str.MDLDEC_Bone_i
push 0x20
push esi
call fcn.004072e0
add esp, 0x10
mov eax, dword [0x476940]
inc ebx
add esi, 0x70
cmp ebx, dword [eax + 0x8c]
jl 0x402020
test edi, edi
je 0x402064
push edi
push str.WARNING:_Gived_name_to__i_protected_bone_s_._n
call fcn.00401070
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x858]
xor ecx, esp
call fcn.0040c398
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x1c]
cmp ebx, dword [esp + 0x14]
je 0x4020df
test esi, esi
jne 0x402096
mov eax, edi
neg eax
sbb eax, eax
jmp 0x4020aa
test edi, edi
je 0x4020df
push 0x40
push edi
push esi
call fcn.00433790
mov ecx, dword [esp + 0x28]
add esp, 0xc
test eax, eax
jne 0x4020df
inc ecx
push ecx
push esi
push str._s__i.bmp
push 0x40
push esi
mov dword [esp + 0x30], ecx
call fcn.004072e0
add esp, 0x14
cmp eax, 0xffffffff
jne 0x4020df
push dword [esp + 0x1c]
push ebx
push str.MDLDEC_Texture_i__i.bmp
push 0x40
push esi
call fcn.004072e0
add esp, 0x14
mov eax, dword [0x476124]
inc ebx
add esi, 0x50
cmp ebx, dword [eax + 0xb4]
jl 0x402080
mov eax, dword [esp + 0x1c]
test eax, eax
jle 0x401fb7
push eax
push edi
push str.WARNING:_Texture_name___s__is_repeated__i_times._n
call fcn.00401070
mov ebx, dword [esp + 0x2c]
mov esi, 1
add esp, 0xc
mov dword [esp + 0x10], esi
jmp 0x401fbf
push ebx
push str.ERROR:_Wrong_file_size__File__s_may_be_corrupted__n
push 2
call fcn.00417d1b
add esp, 4
push eax
call fcn.00401040
mov ecx, dword [esp + 0x870]
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040c398
mov esp, ebp
pop ebp
ret