Function at 0x40d520
Capabilities:
Create directory
Get file size
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x427d8c
mov eax, dword fs:[0]
push eax
sub esp, 0xc4
mov eax, dword [0x430240]
xor eax, esp
mov dword [esp + 0xc0], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x430240]
xor eax, esp
push eax
lea eax, [esp + 0xd8]
mov dword fs:[0], eax
mov eax, dword [esp + 0xe8]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0xec]
mov dword [esp + 0x48], ecx
xor edi, edi
mov dword [esp + 0xe0], edi
cmp dword [eax + 0x18], 8
jb 0x40d585
mov eax, dword [eax + 4]
jmp 0x40d588
add eax, 4
push edi
push 0x80
push 3
push edi
push 3
push SysReAllocStringLen
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x20], ebx
je 0x40d60d
lea esi, [esp + 0x2c]
call fcn.0040e200
lea edx, [esp + 0x24]
push edx
push ebx
mov byte [esp + 0xe8], 1
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
jne 0x40d5d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [esp + 0x34]
cmp esi, edi
je 0x40d606
push edi
lea eax, [esp + 0x1c]
push eax
push 7
push esi
push ebx
mov dword [esp + 0x2c], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40d5fd
cmp dword [esp + 0x18], edi
seta al
test al, al
jne 0x40d614
push esi
call fcn.00413bba
add esp, 4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
jmp 0x40dc65
push 1
push 0x42c0a4
push esi
call fcn.004150d5
add esp, 0xc
test eax, eax
jne 0x40d5fd
mov ebp, dword [esi + 3]
mov edi, ebp
imul edi, edi, 0x238
lea esi, [esp + 0x2c]
call fcn.0040ca70
mov eax, dword [esp + 0x34]
test eax, eax
je 0x40d671
mov esi, dword [esp + 0x30]
push 0
lea ecx, [esp + 0x1c]
push ecx
push esi
push eax
push ebx
mov dword [esp + 0x2c], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40d671
mov ecx, dword [esp + 0x18]
test ecx, ecx
seta al
test al, al
jne 0x40d688
lea ecx, [esp + 0x2c]
call fcn.00403920
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
jmp 0x40dc65
cmp ecx, esi
jne 0x40dc2f
mov esi, dword [esp + 0x1c]
add esi, 0x2c
call fcn.0040dd50
test ebp, ebp
jbe 0x40d71b
mov ebx, dword [esp + 0x34]
push 0x238
call fcn.00413b50
add esp, 4
test eax, eax
je 0x40d6c0
mov esi, eax
call fcn.0040d2e0
mov esi, eax
jmp 0x40d6c2
xor esi, esi
push esi
lea ecx, [esp + 0x2c]
mov dword [esp + 0x28], esi
call fcn.0040e320
push esi
push esi
call fcn.00403a10
add esp, 8
mov byte [esp + 0xe0], 2
mov edi, dword [esp + 0x24]
mov esi, ebx
mov ecx, 0x8e
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x1c]
lea eax, [esp + 0x24]
add edi, 0x2c
add ebx, 0x238
call fcn.0040dcd0
lea eax, [esp + 0x24]
mov byte [esp + 0xe0], 1
call fcn.00403f30
sub ebp, 1
jne 0x40d6a4
mov esi, dword [esp + 0x30]
cmp esi, 0x1000
je 0x40d773
push 0x1000
call fcn.004137e2
xor ebx, ebx
add esp, 4
cmp esi, ebx
mov edi, eax
jbe 0x40d758
cmp esi, 0x1000
jb 0x40d749
mov esi, 0x1000
mov edx, dword [esp + 0x34]
push esi
push edx
push edi
call fcn.00414d70
add esp, 0xc
mov eax, dword [esp + 0x34]
push eax
call fcn.00413bba
add esp, 4
mov dword [esp + 0x34], edi
mov dword [esp + 0x30], 0x1000
jmp 0x40d775
xor ebx, ebx
mov esi, dword [esp + 0x1c]
mov ebp, dword [esi + 0x30]
add esi, 0x2c
cmp ebp, dword [esi + 8]
jbe 0x40d790
call fcn.00414249
lea esp, [esp]
mov edi, dword [esi + 8]
cmp dword [esi + 4], edi
jbe 0x40d79d
call fcn.00414249
cmp esi, esi
je 0x40d7a6
call fcn.00414249
cmp ebp, edi
je 0x40dc45
cmp ebp, dword [esi + 8]
jb 0x40d7b8
call fcn.00414249
mov eax, dword [ebp]
lea ecx, [eax + 4]
mov eax, ecx
mov dword [esp + 0xb4], 7
mov dword [esp + 0xb0], ebx
mov word [esp + 0xa0], bx
lea esi, [eax + 2]
lea ecx, [ecx]
mov dx, word [eax]
add eax, 2
cmp dx, bx
jne 0x40d7e0
sub eax, esi
sar eax, 1
push eax
push ecx
lea esi, [esp + 0xa4]
call fcn.00403260
mov edx, dword [esp + 0x48]
mov ecx, esi
push ecx
push edx
lea ecx, [esp + 0x88]
mov byte [esp + 0xe8], 3
call fcn.00408900
add esp, 8
mov edi, 8
mov byte [esp + 0xe0], 5
cmp dword [esp + 0xb4], edi
jb 0x40d842
mov eax, dword [esp + 0xa0]
push eax
call fcn.00413bbf
add esp, 4
lea ecx, [esp + 0x80]
lea esi, [esp + 0xb8]
mov dword [esp + 0xb4], 7
mov dword [esp + 0xb0], ebx
mov word [esp + 0xa0], bx
call fcn.00408b50
mov ecx, esi
push ecx
mov byte [esp + 0xe4], 6
call fcn.0040eb90
add esp, 4
test al, al
jne 0x40d894
mov ebx, esi
call fcn.0040ecb0
mov edi, 8
xor ebx, ebx
mov esi, dword [esp + 0x1c]
cmp ebp, dword [esi + 0x34]
jb 0x40d8a2
call fcn.00414249
mov eax, dword [ebp]
cmp dword [eax], 1
jne 0x40d8ce
cmp dword [esp + 0x98], edi
mov eax, dword [esp + 0x84]
jae 0x40d8c1
lea eax, [esp + 0x84]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
jmp 0x40db17
cmp ebp, dword [esi + 0x34]
jb 0x40d8d8
call fcn.00414249
mov eax, dword [ebp]
cmp dword [eax], ebx
jne 0x40db17
mov byte [esp + 0xe0], 7
cmp ebp, dword [esi + 0x34]
jb 0x40d8f5
call fcn.00414249
cmp dword [esp + 0x98], edi
mov eax, dword [ebp]
mov eax, dword [eax + 0x21c]
mov ecx, dword [esp + 0x84]
jae 0x40d915
lea ecx, [esp + 0x84]
push ebx
push eax
push 2
push ebx
push 1
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x24], eax
je 0x40db7f
lea edx, [esp + 0x9c]
push edx
lea ecx, [esp + 0x84]
call fcn.0040ee20
add esp, 4
mov edx, str..swf
lea eax, [esp + 0x64]
mov byte [esp + 0xe0], 8
call fcn.00402d70
lea eax, [esp + 0x64]
lea esi, [esp + 0x9c]
call fcn.00405020
test eax, eax
sete bl
cmp dword [esp + 0x7c], 8
jb 0x40d98b
mov eax, dword [esp + 0x68]
push eax
call fcn.00413bbf
add esp, 4
test bl, bl
je 0x40d9a3
mov ecx, dword [esp + 0x1c]
push 0xffffffffffffffff
push 0
lea eax, [esp + 0x88]
call fcn.004030d0
mov ecx, dword [esp + 0x1c]
cmp ebp, dword [ecx + 0x34]
jb 0x40d9b1
call fcn.00414249
mov ebx, dword [esp + 0x1c]
cmp ebp, dword [ebx + 0x34]
mov edi, dword [ebp]
jb 0x40d9c2
call fcn.00414249
cmp ebp, dword [ebx + 0x34]
mov esi, dword [ebp]
jb 0x40d9cf
call fcn.00414249
mov edx, dword [edi + 0x230]
mov ecx, dword [edi + 0x234]
mov eax, dword [ebp]
mov dword [esp + 0x4c], edx
mov edx, dword [esi + 0x228]
mov dword [esp + 0x50], ecx
mov ecx, dword [esi + 0x22c]
mov dword [esp + 0x54], edx
mov edx, dword [eax + 0x220]
mov eax, dword [eax + 0x224]
mov dword [esp + 0x58], ecx
lea ecx, [esp + 0x4c]
push ecx
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x60], edx
lea edx, [esp + 0x58]
mov dword [esp + 0x64], eax
push edx
lea eax, [esp + 0x64]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
cmp ebp, dword [ebx + 0x34]
jb 0x40da32
call fcn.00414249
mov eax, dword [ebp]
mov edi, dword [eax + 0x214]
mov eax, dword [eax + 0x218]
test eax, eax
mov dword [esp + 0x40], eax
ja 0x40da51
test edi, edi
jbe 0x40daf7
mov ebx, dword [esp + 0x34]
cmp dword [esp + 0x40], 0
ja 0x40da64
cmp edi, 0x1000
jbe 0x40da6b
mov esi, 0x1000
jmp 0x40da6d
mov esi, edi
test ebx, ebx
je 0x40dc02
mov eax, dword [esp + 0x20]
push 0
lea edx, [esp + 0x1c]
push edx
push esi
push ebx
push eax
mov dword [esp + 0x2c], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40dc02
mov ecx, dword [esp + 0x18]
test ecx, ecx
seta al
test al, al
je 0x40dc02
cmp ecx, esi
jne 0x40dc02
mov edx, dword [esp + 0x24]
push 0
lea ecx, [esp + 0x1c]
push ecx
push esi
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40dc02
cmp esi, dword [esp + 0x18]
jne 0x40dc02
mov eax, dword [esp + 0x40]
sub edi, esi
sbb eax, 0
test eax, eax
mov dword [esp + 0x40], eax
ja 0x40da55
jb 0x40daf7
test edi, edi
ja 0x40da55
lea esi, [esp + 0x9c]
call fcn.00404b40
lea esi, [esp + 0x24]
call fcn.00405740
mov esi, dword [esp + 0x1c]
xor ebx, ebx
mov edi, 8
cmp dword [esp + 0xd0], edi
jb 0x40db30
mov eax, dword [esp + 0xbc]
push eax
call fcn.00413bbf
add esp, 4
mov byte [esp + 0xe0], 1
cmp dword [esp + 0x98], edi
mov dword [esp + 0xd0], 7
mov dword [esp + 0xcc], ebx
mov word [esp + 0xbc], bx
jb 0x40db6b
mov ecx, dword [esp + 0x84]
push ecx
call fcn.00413bbf
add esp, 4
add esi, 0x2c
cmp ebp, dword [esi + 8]
jb 0x40db78
call fcn.00414249
add ebp, edi
jmp 0x40d790
cmp dword [esp + 0xd0], edi
jb 0x40db98
mov edx, dword [esp + 0xbc]
push edx
call fcn.00413bbf
add esp, 4
cmp dword [esp + 0x98], edi
mov esi, 7
mov dword [esp + 0xd0], esi
mov dword [esp + 0xcc], ebx
mov word [esp + 0xbc], bx
jb 0x40dbcc
mov eax, dword [esp + 0x84]
push eax
call fcn.00413bbf
add esp, 4
mov eax, dword [esp + 0x34]
cmp eax, ebx
mov dword [esp + 0x98], esi
mov dword [esp + 0x94], ebx
mov word [esp + 0x84], bx
je 0x40dbf3
push eax
call fcn.00413bba
add esp, 4
mov ecx, dword [esp + 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
jmp 0x40dc65
lea esi, [esp + 0x9c]
call fcn.00404b40
lea esi, [esp + 0x24]
call fcn.00405740
lea esi, [esp + 0xb8]
call fcn.00404b40
lea esi, [esp + 0x80]
call fcn.00404b40
lea ecx, [esp + 0x2c]
call fcn.00403920
lea esi, [esp + 0x20]
call fcn.00405740
xor al, al
jmp 0x40dc65
cmp dword [esp + 0x34], ebx
je 0x40dc58
mov edx, dword [esp + 0x34]
push edx
call fcn.00413bba
add esp, 4
mov eax, dword [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
mov ecx, dword [esp + 0xd8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0xc0]
xor ecx, esp
call fcn.004138c3
add esp, 0xd0
ret 8