Function at 0x40a690
Capabilities:
Create directory
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x344
mov eax, dword [0x497650]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov ebx, ecx
push edi
xor esi, esi
push ebx
mov dword [ebp - 0x344], eax
mov dword [ebp - 0x33c], esi
call fcn.0045e580
add esp, 4
test eax, eax
jne 0x40aaab
lea ebx, [ebx]
push ebx
push 1
lea ecx, [ebp - 0x220]
push 4
push ecx
call fcn.0045d5e0
mov eax, dword [ebp - 0x220]
add esp, 0x10
cmp eax, 2
je 0x40aa9e
cmp eax, 1
jne 0x40a7be
push ebx
xor edi, edi
call fcn.0045e580
add esp, 4
test eax, eax
jne 0x40a740
jmp 0x40a710
push ebx
push 1
lea esi, [ebp + edi - 0x338]
push 1
push esi
call fcn.0045d5e0
add esp, 0x10
cmp byte [esi], 0
je 0x40a758
inc edi
cmp edi, 0x104
jg 0x40a740
push ebx
call fcn.0045e580
add esp, 4
test eax, eax
je 0x40a710
mov eax, 0xfffffffc
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045cc1a
mov esp, ebp
pop ebp
ret 8
mov eax, dword [ebp + 0xc]
lea edx, [ebp - 0x110]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40a763
lea edx, [ebp - 0x110]
push edx
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
lea eax, [ebp - 0x338]
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a782
lea edi, [ebp - 0x110]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40a792
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 0
lea eax, [ebp - 0x110]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
jmp 0x40aa55
test eax, eax
jne 0x40a91a
test esi, esi
je 0x40a7d3
push esi
call fcn.0045d66a
add esp, 4
lea ecx, [ebp - 0x338]
push ecx
call fcn.0040a630
test al, al
je 0x40a740
push ebx
push 1
lea edx, [ebp - 0x234]
push 4
push edx
call fcn.0045d5e0
push ebx
push 1
lea eax, [ebp - 0x230]
push 4
push eax
call fcn.0045d5e0
push ebx
push 5
lea ecx, [ebp - 0x22c]
push 1
push ecx
call fcn.0045d5e0
mov edx, dword [ebp - 0x234]
push edx
call fcn.00417314
add esp, 0x34
mov dword [ebp - 0x224], eax
test eax, eax
je 0x40aac0
mov ecx, dword [ebp - 0x234]
push ebx
push ecx
push 1
push eax
call fcn.0045d5e0
mov edx, dword [ebp - 0x230]
push edx
call fcn.00417314
mov edx, dword [ebp - 0x224]
add esp, 0x14
mov esi, eax
push 5
lea eax, [ebp - 0x22c]
push eax
lea ecx, [ebp - 0x234]
push ecx
push edx
lea eax, [ebp - 0x230]
push eax
push esi
mov dword [ebp - 0x340], esi
call fcn.0045b340
test eax, eax
jne 0x40aad8
mov ecx, dword [ebp - 0x224]
push ecx
call fcn.0045cc0f
mov eax, dword [ebp + 0xc]
lea edx, [ebp - 0x218]
add esp, 4
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40a8a4
lea edx, [ebp - 0x218]
push edx
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
lea eax, [ebp - 0x338]
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a8c3
lea edi, [ebp - 0x218]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40a8d3
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea eax, [ebp - 0x218]
and ecx, 3
push 0x48adc4
push eax
rep movsb byte es:[edi], byte [esi]
call fcn.0045deba
add esp, 8
mov dword [ebp - 0x33c], eax
test eax, eax
je 0x40aaf9
mov ecx, dword [ebp - 0x230]
push eax
push ecx
jmp 0x40aa3e
cmp eax, 8
jne 0x40aa55
push ebx
push 1
lea edx, [ebp - 0x234]
push 4
push edx
call fcn.0045d5e0
push ebx
push 1
lea eax, [ebp - 0x230]
push 4
push eax
call fcn.0045d5e0
push ebx
push 5
lea ecx, [ebp - 0x22c]
push 1
push ecx
call fcn.0045d5e0
mov edx, dword [ebp - 0x234]
push edx
call fcn.00417314
add esp, 0x34
mov dword [ebp - 0x224], eax
test eax, eax
je 0x40aac0
mov ecx, dword [ebp - 0x234]
push ebx
push ecx
push 1
push eax
call fcn.0045d5e0
mov edx, dword [ebp - 0x230]
push edx
call fcn.00417314
mov edx, dword [ebp - 0x224]
add esp, 0x14
mov esi, eax
push 5
lea eax, [ebp - 0x22c]
push eax
lea ecx, [ebp - 0x234]
push ecx
push edx
lea eax, [ebp - 0x230]
push eax
push esi
mov dword [ebp - 0x340], esi
call fcn.0045b340
test eax, eax
jne 0x40ab0f
mov ecx, dword [ebp - 0x224]
push ecx
call fcn.0045cc0f
mov eax, dword [ebp + 0xc]
lea edx, [ebp - 0x110]
add esp, 4
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40a9e0
lea edx, [ebp - 0x110]
push edx
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
lea eax, [ebp - 0x338]
mov edx, eax
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40aa00
lea edi, [ebp - 0x110]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40aa10
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [ebp - 0x33c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
test eax, eax
je 0x40aaf9
push eax
mov eax, dword [ebp - 0x230]
push eax
mov esi, dword [ebp - 0x340]
push 1
push esi
call fcn.0045e506
push esi
call fcn.0045cc0f
add esp, 0x14
push ebx
call fcn.0045e342
add esp, 4
push 0
push 0x46
push edx
push eax
call fcn.0046e640
mov esi, dword [ebp - 0x344]
mov ecx, dword [esi + 0x14]
push ecx
mov ecx, dword [esi + 0x10]
push ecx
push edx
push eax
call fcn.0046e680
mov edx, dword [esi + 8]
add eax, 0x19
push eax
call edx
push ebx
call fcn.0045e580
mov esi, dword [ebp - 0x33c]
add esp, 4
test eax, eax
je 0x40a6d0
test esi, esi
je 0x40aaab
push esi
call fcn.0045d66a
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045cc1a
mov esp, ebp
pop ebp
ret 8
mov eax, 0xfffffffe
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045cc1a
mov esp, ebp
pop ebp
ret 8
push esi
call fcn.0045cc0f
add esp, 4
mov eax, 0xfffffffd
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045cc1a
mov esp, ebp
pop ebp
ret 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045cc1a
mov esp, ebp
pop ebp
ret 8
push esi
call fcn.0045cf39
mov ecx, dword [ebp - 4]
add esp, 4
pop edi
pop esi
xor ecx, ebp
mov eax, 0xfffffffd
pop ebx
call fcn.0045cc1a
mov esp, ebp
pop ebp
ret 8