Function at 0x40f560
Capabilities:
Create directory

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x38
mov esi, dword [ebp + 0xc]
push esi
call sym._strlen
add esp, 0x10
mov ebx, eax
cmp eax, 0x400
jle 0x40f589
or eax, 0xffffffff
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x20], eax
mov edi, dword [ebp + 8]
push eax
lea eax, [ebp - 0x24]
push 8
mov dword [ebp - 0x24], 0x56434552
push eax
push edi
call dbg.writex
add esp, 0x10
test eax, eax
jne 0x40f57e
mov edx, dword [ebp + 8]
push ecx
push ebx
push esi
push edx
call dbg.writex
add esp, 0x10
test eax, eax
jne 0x40f57e
push eax
lea eax, [ebp - 0x24]
push 8
push eax
mov eax, dword [ebp + 8]
push eax
call dbg.readx
add esp, 0x10
test eax, eax
jne 0x40f57e
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x10], eax
cmp eax, 0x41544144
je 0x40f64e
or edi, 0xffffffff
cmp eax, 0x454e4f44
je 0x40f64e
sub esp, 0xc
push edi
call dbg.adb_close
pop eax
mov eax, dword [ebp + 0x10]
push eax
call sym._unlink
add esp, 0x10
inc eax
je 0x40f801
cmp dword [ebp - 0x10], 0x4c494146
je 0x40f77a
mov eax, dword [ebp - 0x10]
mov byte [0x4312ec], 0
mov dword [0x4312e8], eax
sub esp, 0xc
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov ebx, dword [ebp + 0x10]
add eax, 0x40
push 0x4312e8
push ebx
push esi
push str.failed_to_copy__s_to__s:__s_n
push eax
call sym._fprintf_9
xor eax, eax
add esp, 0x20
jmp 0x40f581
sub esp, 0xc
mov eax, dword [ebp + 0x10]
push eax
call sym._unlink
add esp, 0x10
inc eax
je 0x40f7b1
mov ebx, dword [ebp + 0x10]
jmp 0x40f690
test eax, eax
je 0x40f671
cmp eax, edi
ja 0x40f6b0
mov ebx, edi
sub esp, 0xc
mov byte [ebx], 0
mov eax, dword [ebp + 0x10]
push eax
call sym.__mkdir
add esp, 0x10
mov byte [ebx], 0x5c
test eax, eax
js 0x40f7ee
inc ebx
push edi
push edi
push 0x2f
push ebx
call sym._strchr
pop edx
pop ecx
push 0x5c
mov edi, eax
push ebx
call sym._strchr
add esp, 0x10
mov ebx, eax
test edi, edi
jne 0x40f669
test ebx, ebx
jne 0x40f673
mov ebx, dword [ebp + 0x10]
push edi
push edi
push 0x1a4
push ebx
call dbg.adb_creat
add esp, 0x10
mov edi, eax
test eax, eax
js 0x40f8a2
mov eax, dword [ebp - 0x10]
mov ebx, dword [ebp - 0x20]
cmp eax, 0x454e4f44
je 0x40f767
cmp eax, 0x41544144
jne 0x40f5eb
cmp ebx, 0x10000
jg 0x40f87a
push eax
mov eax, dword [ebp + 8]
push ebx
push 0x4312e8
push eax
call dbg.readx
add esp, 0x10
test eax, eax
jne 0x40f866
push eax
push ebx
push 0x4312e8
push edi
call dbg.writex
add esp, 0x10
test eax, eax
jne 0x40f83e
mov eax, dword [0x4312c0]
mov edx, dword [ebp + 8]
add eax, ebx
push ecx
mov dword [0x4312c0], eax
lea eax, [ebp - 0x24]
push 8
push eax
push edx
call dbg.readx
add esp, 0x10
test eax, eax
jne 0x40f57e
mov eax, dword [ebp - 0x24]
mov ebx, dword [ebp - 0x20]
mov dword [ebp - 0x10], eax
cmp eax, 0x454e4f44
jne 0x40f6e2
sub esp, 0xc
push edi
call dbg.adb_close
xor eax, eax
add esp, 0x10
jmp 0x40f581
mov ebx, dword [ebp - 0x20]
cmp ebx, 0x100
jle 0x40f78a
mov ebx, 0x100
mov edi, dword [ebp + 8]
push eax
push ebx
push 0x4312e8
push edi
call dbg.readx
add esp, 0x10
test eax, eax
jne 0x40f57e
mov byte [ebx + 0x4312e8], 0
jmp 0x40f624
call sym.__errno
cmp dword [eax], 0xd
jne 0x40f664
push eax
push eax
mov eax, dword [ebp + 0x10]
push 0x180
push eax
call sym._chmod
add esp, 0x10
test eax, eax
jne 0x40f664
sub esp, 0xc
mov eax, dword [ebp + 0x10]
push eax
call sym._unlink
add esp, 0x10
jmp 0x40f664
call sym.__errno
cmp dword [eax], 0x11
je 0x40f690
jmp 0x40f6b4
call sym.__errno
cmp dword [eax], 0xd
jne 0x40f608
push eax
push eax
mov eax, dword [ebp + 0x10]
push 0x180
push eax
call sym._chmod
add esp, 0x10
test eax, eax
jne 0x40f608
sub esp, 0xc
mov eax, dword [ebp + 0x10]
push eax
call sym._unlink
add esp, 0x10
jmp 0x40f608
call sym.__errno
sub esp, 0xc
mov eax, dword [eax]
push eax
call sym._strerror
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push esi
push str.cannot_write__s:__s_n
push eax
call sym._fprintf_9
add esp, 0x20
sub esp, 0xc
push edi
call dbg.adb_close
or eax, 0xffffffff
add esp, 0x10
jmp 0x40f581
push eax
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
push str.data_overrun_n
add eax, 0x40
push eax
call sym._fprintf_9
mov dword [esp], edi
call dbg.adb_close
or eax, 0xffffffff
add esp, 0x10
jmp 0x40f581
call sym.__errno
sub esp, 0xc
mov ecx, dword [eax]
push ecx
call sym._strerror
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov edx, dword [ebp + 0x10]
add eax, 0x40
push edx
push str.cannot_create__s:__s_n
push eax
call sym._fprintf_9
or eax, 0xffffffff
add esp, 0x20
jmp 0x40f581