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.00417c5b
push eax
push str.ERROR:_Source_path_is_too_long._n
call fcn.00433985
jmp 0x402123
xor edi, edi
mov ecx, ebx
call fcn.004074c0
test eax, eax
jne 0x40195a
push str.ERROR:_Source_file_does_not_have_extension._n
push 2
call fcn.00417c5b
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.0040c2d8
mov esp, ebp
pop ebp
ret
push 0x46db20
push eax
call fcn.0043cdf4
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.00406510
mov edx, eax
mov dword [0x476940], edx
test edx, edx
jne 0x401995
push ebx
push str.ERROR:_Cant_open__s_n
jmp 0x402113
mov eax, dword [esp + 0x10]
cmp eax, 0xf4
jb 0x40210d
cmp eax, dword [edx + 0x48]
jne 0x40210d
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.00417c5b
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.0040c2d8
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.00417c5b
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.0040c2d8
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 0x402113
mov al, byte [0x476140]
test al, al
je 0x401ad0
mov esi, 0x476140
push 0x46e9b0
push esi
call fcn.004354d0
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.004358fb
add esp, 4
cmp eax, 0xffffffff
jne 0x401aab
call fcn.004355c3
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 0x402113
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.00415e70
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 0x401c80
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.00415e70
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.00415e70
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.00406510
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 0x402113
mov eax, dword [esp + 0x10]
cmp eax, 0xf4
jb 0x401c76
cmp eax, dword [ecx + 0x48]
jne 0x401c76
mov eax, dword [ecx]
lea edx, [esp + 0x24]
cmp eax, dword [edx]
jne 0x401c67
cmp dword [ecx + 0xb4], 0
je 0x401c67
mov edx, dword [0x476940]
jmp 0x401c91
lea eax, [esp + 0x60]
push eax
push str.ERROR:__s_is_not_a_valid_external_textures_file._n
jmp 0x402113
lea eax, [esp + 0x60]
push eax
jmp 0x40210e
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.004339b9
add esp, 4
mov dword [0x476128], eax
test eax, eax
jne 0x401cc3
push 2
call fcn.00417c5b
push eax
push str.ERROR:_Couldnt_allocate_memory_for_sequences._n
call fcn.00433985
jmp 0x402123
mov edi, dword [0x476940]
mov dword [eax], edi
cmp dword [edi + 0xac], 1
jle 0x401e52
test ebx, ebx
je 0x401d27
mov edx, ebx
lea esi, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x401ce1
sub edx, esi
inc edx
cmp edx, 0x400
jbe 0x401d15
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 0x401d27
push edx
lea eax, [esp + 0x464]
push ebx
push eax
call fcn.00415e70
add esp, 0xc
mov esi, 1
cmp dword [edi + 0xac], esi
jle 0x401e52
mov eax, dword [esp + 0x14]
lea eax, [esp + eax + 0x460]
mov dword [esp + 0x1c], eax
nop word [eax + eax]
push esi
push str._02d.mdl
push dword [esp + 0x28]
push eax
call fcn.00407220
lea eax, [esp + 0x470]
push 0x46e9dc
push eax
call fcn.004344e7
add esp, 0x18
mov dword [esp + 0x14], eax
lea ecx, [esi*4]
mov dword [esp + 0x2c], ecx
test eax, eax
je 0x401e34
push eax
call fcn.0043cf28
lea ecx, [esp + 0x34]
push ecx
push eax
call fcn.00437a0a
mov eax, dword [esp + 0x50]
push eax
mov dword [esp + 0x20], eax
call fcn.004339b9
mov edi, eax
add esp, 0x10
test edi, edi
je 0x401e30
push dword [esp + 0x14]
push 1
push dword [esp + 0x18]
push edi
call fcn.00435b71
push dword [esp + 0x24]
call fcn.004346a6
mov eax, dword [0x476128]
lea ecx, [esi*4]
add esp, 0x14
mov dword [ecx + eax], edi
mov eax, dword [esp + 0x10]
cmp eax, 0xf4
jb 0x401e23
cmp eax, dword [edi + 0x48]
jne 0x401e23
mov eax, dword [edi]
lea ecx, [esp + 0x28]
cmp eax, dword [ecx]
jne 0x401e11
mov edi, dword [0x476940]
inc esi
cmp esi, dword [edi + 0xac]
jge 0x401e52
mov eax, dword [esp + 0x1c]
jmp 0x401d50
lea eax, [esp + 0x460]
push eax
push str.ERROR:__s_is_not_a_valid_sequence_file._n
jmp 0x402113
lea eax, [esp + 0x460]
push eax
jmp 0x40210e
mov ecx, dword [esp + 0x2c]
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 0x402113
test ebx, ebx
je 0x401eb3
cmp byte [ebx], 0
je 0x401eb3
mov cl, byte [ebx]
xor esi, esi
mov eax, ebx
cmp cl, 0x2f
je 0x401e70
cmp cl, 0x5c
je 0x401e70
lea edx, [eax + 1]
jmp 0x401e75
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 0x401e61
test esi, esi
je 0x401e8d
cmp esi, ebx
jae 0x401e8f
mov esi, edx
mov eax, 0x3ff
sub esi, ebx
cmp esi, eax
cmova esi, eax
push esi
push ebx
push 0x476540
call fcn.00415e70
add esp, 0xc
mov byte [esi + 0x476540], 0
jmp 0x401eba
mov byte [0x476540], 0
mov eax, dword [edi + 0x8c]
mov ecx, dword [edi + 0x9c]
shl eax, 2
cmp ecx, eax
jle 0x401ed5
push ecx
push str.WARNING:_Invalid_hitboxes_number__d._n
jmp 0x401eec
mov edx, dword [edi + 0xa0]
lea eax, [ecx + ecx*8]
lea eax, [edx + eax*8]
cmp eax, dword [edi + 0x48]
jbe 0x401f03
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 0x401f4e
nop word [eax + eax]
mov edx, 0x40
mov ecx, edi
call fcn.00406380
mov ecx, dword [0x476124]
inc esi
add edi, 0x50
cmp esi, dword [ecx + 0xb4]
jl 0x401f30
imul eax, esi, 0xffffffb0
mov dword [esp + 0x14], ebx
add edi, eax
cmp dword [ecx + 0xb4], ebx
jle 0x401feb
mov ecx, edi
call fcn.00401160
test eax, eax
jne 0x401f86
inc ebx
push ebx
push str.MDLDEC_Texture_i.bmp
push 0x40
push edi
mov dword [esp + 0x30], ebx
call fcn.00407220
add esp, 0x10
jmp 0x401fab
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 0x402074
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 0x401f63
test ebx, ebx
je 0x401fda
push ebx
push str.WARNING:_Gived_name_to__i_protected_texture_s_._n
call fcn.00401070
add esp, 8
test esi, esi
je 0x401feb
push str.WARNING:_Added_numeric_suffix_to_repeated_texture_name_s_.
call fcn.0041960c
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 0x402054
nop
mov ecx, esi
mov byte [esi + 0x1f], 0
call fcn.00401160
test eax, eax
jne 0x402031
inc edi
push edi
push str.MDLDEC_Bone_i
push 0x20
push esi
call fcn.00407220
add esp, 0x10
mov eax, dword [0x476940]
inc ebx
add esi, 0x70
cmp ebx, dword [eax + 0x8c]
jl 0x402010
test edi, edi
je 0x402054
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.0040c2d8
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x1c]
cmp ebx, dword [esp + 0x14]
je 0x4020cf
test esi, esi
jne 0x402086
mov eax, edi
neg eax
sbb eax, eax
jmp 0x40209a
test edi, edi
je 0x4020cf
push 0x40
push edi
push esi
call fcn.004336d0
mov ecx, dword [esp + 0x28]
add esp, 0xc
test eax, eax
jne 0x4020cf
inc ecx
push ecx
push esi
push str._s__i.bmp
push 0x40
push esi
mov dword [esp + 0x30], ecx
call fcn.00407220
add esp, 0x14
cmp eax, 0xffffffff
jne 0x4020cf
push dword [esp + 0x1c]
push ebx
push str.MDLDEC_Texture_i__i.bmp
push 0x40
push esi
call fcn.00407220
add esp, 0x14
mov eax, dword [0x476124]
inc ebx
add esi, 0x50
cmp ebx, dword [eax + 0xb4]
jl 0x402070
mov eax, dword [esp + 0x1c]
test eax, eax
jle 0x401fa7
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 0x401faf
push ebx
push str.ERROR:_Wrong_file_size__File__s_may_be_corrupted__n
push 2
call fcn.00417c5b
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.0040c2d8
mov esp, ebp
pop ebp
ret