Function at 0x40d2e0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
push edi
push esi
push ebx
mov ebx, 0x18
sub esp, 0x5c
mov edi, dword [0x4c0f68]
mov eax, dword [esp + 0x74]
mov dword [esp + 0x4c], 0
test eax, eax
je 0x40d349
mov eax, dword [esp + 0x74]
mov ebx, 0x18
mov esi, dword [esp + 0x78]
lea ebp, [eax + eax*2]
shl ebp, 4
add ebp, esi
mov eax, dword [esi + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
xor edx, edx
add eax, 3
shr eax, 2
lea ecx, [eax*4 + 8]
mov eax, ebx
div edi
lea eax, [ecx + edx]
cmp eax, edi
jbe 0x40d340
add ebx, edi
sub ebx, edx
add esi, 0x30
add ebx, ecx
cmp esi, ebp
jne 0x40d317
mov ebp, dword [esp + 0x70]
test ebp, ebp
jne 0x40d4e0
mov dword [esp + 0x3c], 2
mov dword [esp + 0x70], 2
mov esi, dword [esp + 0x3c]
mov dword [esp], esi
call fcn.0040c840
mov dword [esp], esi
call fcn.0040c660
test eax, eax
mov esi, eax
je 0x40d5f0
lea eax, [ebx + edi - 1]
xor edx, edx
div edi
xor edx, edx
mov dword [esp + 0x10], edx
mov dword [esp + 8], edx
mov dword [esp], esi
mov ebp, eax
imul ebp, edi
mov dword [esp + 0xc], ebp
mov dword [esp + 4], ebp
call fcn.0040de30
test eax, eax
mov edi, eax
je 0x40d630
movzx eax, word [esp + 0x7c]
mov ecx, 0x4000
mov word [esi], cx
lea edx, [esp + 0x4c]
xor ecx, ecx
add eax, 2
mov word [esi + 0x1a], ax
mov eax, dword [0x4c1014]
or dword [esi + 0x20], eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x4b030a
mov dword [esp], eax
mov eax, edi
call fcn.0040ce90
test eax, eax
je 0x40d5d8
mov ecx, dword [esp + 0x70]
lea edx, [esp + 0x4c]
mov dword [esp + 8], 2
mov dword [esp + 4], 0x4b0332
mov dword [esp], ecx
mov ecx, eax
mov eax, edi
call fcn.0040ce90
test eax, eax
je 0x40d646
mov ecx, dword [esp + 0x74]
xor esi, esi
mov edx, dword [esp + 0x74]
mov ebx, dword [esp + 0x78]
sub ecx, 1
test edx, edx
mov dword [esp + 0x38], ecx
jne 0x40d461
jmp 0x40d5aa
test eax, eax
mov dword [ebx + 0x1c], eax
je 0x40d5c6
add esi, 1
add ebx, 0x30
cmp esi, dword [esp + 0x74]
je 0x40d5b0
movzx edx, byte [ebx + 0x14]
mov ecx, eax
mov eax, edi
mov dword [esp + 8], edx
mov edx, dword [ebx + 8]
mov dword [esp], 0
mov dword [esp + 4], edx
lea edx, [esp + 0x4c]
call fcn.0040ce90
mov edx, dword [esp + 0x4c]
cmp ebp, edx
jb 0x40d496
jne 0x40d446
cmp dword [esp + 0x38], esi
je 0x40d446
mov edx, ebp
mov dword [esp + 0x14], ebp
mov dword [esp + 0x10], edx
mov eax, dword [ebx + 8]
mov dword [esp + 8], str.make_directory
mov dword [esp + 4], str.critical_error:__s:_internal_error:_dentry_for__s_ends_at__d__past__d_n_n
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0040ce60
mov dword [esp + 4], 1
mov dword [esp], 0x4c0fa0
call sub.msvcrt.dll_longjmp
lea esi, [esi]
mov eax, dword [0x4c0f60]
mov dword [esp], eax
mov eax, dword [0x4c0f64]
mov dword [esp + 4], eax
mov eax, dword [0x4c0f68]
mov dword [esp + 8], eax
mov eax, dword [0x4c0f6c]
mov dword [esp + 0xc], eax
mov eax, dword [0x4c0f70]
mov dword [esp + 0x10], eax
mov eax, dword [0x4c0f74]
mov dword [esp + 0x14], eax
mov eax, dword [0x4c0f78]
mov dword [esp + 0x18], eax
mov eax, dword [0x4c0f7c]
mov dword [esp + 0x1c], eax
mov eax, dword [0x4c0f80]
mov dword [esp + 0x20], eax
mov eax, dword [0x4c0f84]
mov dword [esp + 0x24], eax
mov eax, dword [0x4c0f88]
mov dword [esp + 0x28], eax
mov eax, dword [0x4c0f8c]
mov dword [esp + 0x2c], eax
mov eax, dword [0x4c0f90]
mov dword [esp + 0x30], eax
mov eax, dword [0x4c0f94]
mov dword [esp + 0x34], eax
call fcn.0040c7e0
cmp eax, 0xffffffff
mov dword [esp + 0x3c], eax
jne 0x40d365
mov dword [esp + 8], str.make_directory
mov dword [esp + 4], str.error:__s:_failed_to_allocate_inode_n_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0040ce60
mov esi, dword [0x4bf544]
test esi, esi
je 0x40d4c5
add esp, 0x5c
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [esp + 0x4c]
nop
add bp, word [eax + 4]
sub ebp, edx
mov word [eax + 4], bp
mov eax, dword [esp + 0x3c]
add esp, 0x5c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 8], str.make_directory
mov dword [esp + 4], str.error:__s:_failed_to_add_directory_n
jmp 0x40d57f
mov dword [esp + 8], str.make_directory
mov dword [esp + 4], str.error:__s:_failed_to_add_._directory_n
jmp 0x40d57f
mov eax, dword [esp + 0x3c]
mov dword [esp + 8], str.make_directory
mov dword [esp + 4], str.error:__s:_failed_to_get_inode__u_n
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.0040ce60
mov ebx, dword [0x4bf544]
test ebx, ebx
jne 0x40d59d
jmp 0x40d4c5
mov dword [esp + 0xc], ebp
mov dword [esp + 8], str.make_directory
mov dword [esp + 4], str.error:__s:_failed_to_allocate__u_extents_n
jmp 0x40d608
mov dword [esp + 8], str.make_directory
mov dword [esp + 4], str.error:__s:_failed_to_add_.._directory_n
jmp 0x40d57f