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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4434
call fcn.004119a0
mov eax, dword [0x41b004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x420c
lea eax, [ebp - 0x4424]
push 0
push eax
mov dword [ebp - 0x4428], 0
call fcn.0040fab0
add esp, 0xc
push str.Setup.ini
push 0x41cdfc
lea ecx, [ebp - 0x218]
push 0x417c5c
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
lea edx, [ebp - 0x218]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov dword [ebp - 0x442c], esi
cmp esi, 0xffffffff
jne 0x4053d9
mov esi, dword [0x41cd90]
lea eax, [ebp - 0x218]
push eax
push str._0x00020001_
push 0x30
mov edi, str.file_open_error
call fcn.0040aa70
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
lea ecx, [edi + 1]
push ecx
call fcn.0040ae25
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x405437
mov esi, dword [0x41cd90]
lea edx, [ebp - 0x218]
push edx
push str._0x00020002_
push 0x30
mov edi, str.memory_allocate_error
call fcn.0040aa70
mov eax, dword [ebp - 0x442c]
add esp, 0xc
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
push 0
lea ecx, [ebp - 0x4434]
push ecx
push edi
push ebx
push esi
mov byte [ebx + edi], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40549b
mov esi, dword [0x41cd90]
lea edx, [ebp - 0x218]
push edx
push str._0x00020003_
push 0x30
mov edi, str.read_error
call fcn.0040aa70
add esp, 0xc
push ebx
call fcn.0040adeb
mov eax, dword [ebp - 0x442c]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x4185b0
push ebx
call fcn.0040aec0
add esp, 8
test eax, eax
je 0x4056c7
push 0x4185b0
push ebx
call fcn.0040aec0
add esp, 8
mov esi, eax
push str._script__r_n
sub esi, ebx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push ebx
lea ecx, [ebp - 0x4428]
add esi, eax
call fcn.00404b50
add esp, 4
test eax, eax
je 0x4056df
xor eax, eax
mov dword [ebp - 0x4430], eax
mov dword [ebp - 0x442c], eax
mov al, byte [esi + ebx]
cmp al, 0x45
je 0x405663
mov edi, dword [sym.imp.USER32.dll_MessageBoxA]
xor ecx, ecx
cmp al, 0x3b
je 0x405523
inc esi
mov byte [ebp + ecx - 0x110], al
mov al, byte [esi + ebx]
inc ecx
cmp al, 0x3b
jne 0x405513
mov byte [ebp + ecx - 0x110], 0
jmp 0x405530
mov cl, byte [esi + ebx]
inc esi
cmp cl, 0xa
jne 0x405530
movsx eax, byte [ebp - 0x110]
add eax, 0xffffffbd
cmp eax, 0x23
ja case.0x405553.69
movzx edx, byte [eax + 0x40570c]
jmp dword [edx*4 + 0x4056fc]
mov ecx, dword [ebp - 0x442c]
mov edx, dword [ebp - 0x4430]
lea eax, [ebp - 0x4428]
push eax
push ecx
push edx
lea ecx, [ebp - 0x110]
call fcn.00404d80
add esp, 0xc
test eax, eax
je 0x4056df
add dword [ebp - 0x4430], eax
adc dword [ebp - 0x442c], 0
jmp case.0x405553.69
push 0x44
lea ecx, [ebp - 0x10e]
call fcn.00404200
add esp, 4
lea eax, [ebp - 0x10e]
push eax
push 0x41d434
lea ecx, [ebp - 0x218]
push 0x417c5c
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0
lea edx, [ebp - 0x218]
push edx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
jne case.0x405553.69
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je case.0x405553.69
push ebx
call fcn.0040adeb
mov edx, dword [0x41cd90]
add esp, 4
push 0x30
lea ecx, [ebp - 0x218]
push ecx
push 0x418600
push edx
call edi
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x10e]
call fcn.0040a570
test eax, eax
jne case.0x405553.69
mov edi, edi
mov eax, dword [0x41cd90]
push 1
push 0x41d22c
push 0x418620
push eax
call edi
cmp eax, 2
je 0x405697
lea ecx, [ebp - 0x10e]
call fcn.0040a570
test eax, eax
je 0x405630
mov al, byte [esi + ebx]
cmp al, 0x45
jne 0x40550d
mov ecx, dword [0x41d114]
mov edx, dword [ecx*4 + 0x41d118]
push 0
push edx
call fcn.004043a0
push ebx
call fcn.0040adeb
add esp, 0xc
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
push ebx
call fcn.0040adeb
mov eax, dword [0x41cd90]
add esp, 4
push 0
push 0x41d22c
push 0x418640
push eax
call edi
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aabb
mov esp, ebp
pop ebp
ret
mov eax, dword [0x41cd90]
push 0x30
push str.script_error
push str._script_
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
push ebx
call fcn.0040adeb
mov ecx, dword [ebp - 4]
add esp, 4
pop edi
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.0040aabb
mov esp, ebp
pop ebp
ret