Function at 0x405170
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x11c4
call fcn.00413f90
mov eax, dword [0x41e494]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, ecx
push edi
mov edx, str.ENTERING________________________________________________EHDownLoadFilesToFolder
mov dword [ebp - 0x1020], esi
call fcn.00401870
push esi
lea eax, [ebp - 0x1008]
push 0x400
push eax
call fcn.00406b82
add esp, 0xc
push str.getfileOnline.txt
lea ecx, [ebp - 0x1008]
push 0x400
push ecx
call fcn.0040795d
add esp, 0xc
xor edi, edi
push edi
push 0x80
push 3
push edi
push edi
push 0x80000000
lea edx, [ebp - 0x1008]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40524b
push str.ERROR______________hFile__INVALID_HANDLE_VALUE___FileName__
lea eax, [ebp - 0x808]
push 0x400
push eax
call fcn.00406b82
add esp, 0xc
lea ecx, [ebp - 0x1008]
push ecx
push 0x400
lea edx, [ebp - 0x808]
push edx
call fcn.0040795d
add esp, 0xc
lea edx, [ebp - 0x808]
call fcn.00401870
mov edx, str.LEAVING________________________________________________EHDownLoadFilesToFolder
call fcn.00401870
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00406b73
mov esp, ebp
pop ebp
ret
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
lea eax, [ebp - 0x1014]
push eax
push edi
push esi
mov dword [ebp - 0x1018], edi
mov dword [ebp - 0x1014], edi
call ebx
mov edi, eax
mov dword [ebp - 0x1018], edi
cmp edi, 0xffffffff
jne 0x405290
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x40528a
or edi, edi
mov dword [ebp - 0x1014], edi
jmp 0x405290
mov edi, dword [ebp - 0x1018]
push 2
xor eax, eax
lea ecx, [ebp - 0x100c]
push ecx
push eax
push esi
mov dword [ebp - 0x1010], eax
mov dword [ebp - 0x100c], eax
call ebx
mov dword [ebp - 0x1010], eax
cmp eax, 0xffffffff
jne 0x4052cd
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4052c7
or eax, 0xffffffff
or ecx, eax
jmp 0x4052d3
mov eax, dword [ebp - 0x1010]
mov ecx, dword [ebp - 0x100c]
sub eax, edi
sbb ecx, dword [ebp - 0x1014]
mov edi, eax
xor eax, eax
push eax
lea edx, [ebp - 0x100c]
push edx
push eax
push esi
mov dword [ebp - 0x102c], ecx
mov dword [ebp - 0x1010], eax
mov dword [ebp - 0x100c], eax
call ebx
mov dword [ebp - 0x1010], eax
cmp eax, 0xffffffff
jne 0x40530e
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea eax, [edi + 1]
push eax
call fcn.004071e1
add esp, 4
push 0
lea ecx, [ebp - 0x101c]
push ecx
mov ebx, eax
push edi
push ebx
push esi
mov dword [ebp - 0x1014], ebx
mov dword [ebp - 0x101c], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x405373
push str.ERROR______________ReadFileFALSE___FileName__
lea edx, [ebp - 0x808]
push 0x400
push edx
call fcn.00406b82
add esp, 0xc
lea eax, [ebp - 0x1008]
push eax
push 0x400
lea ecx, [ebp - 0x808]
push ecx
jmp 0x40521b
xor ecx, ecx
cmp edi, dword [ebp - 0x101c]
jne 0x405385
cmp dword [ebp - 0x102c], ecx
je 0x4053b6
push str.ERROR______________fileSize_dwbytesRead___FileName__
lea edx, [ebp - 0x808]
push 0x400
push edx
call fcn.00406b82
add esp, 0xc
lea eax, [ebp - 0x1008]
push eax
push 0x400
lea ecx, [ebp - 0x808]
push ecx
jmp 0x40521b
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edx, [ebp - 0x1024]
push edx
push 0x41a6dc
push ebx
mov byte [edi + ebx], 0
xor esi, esi
call fcn.004087b9
add esp, 0xc
test eax, eax
je 0x405402
lea esp, [esp]
mov dword [ebp + esi*4 - 0x11c0], eax
lea eax, [ebp - 0x1024]
push eax
push 0x41a6dc
push 0
call fcn.004087b9
add esp, 0xc
inc esi
test eax, eax
jne 0x4053e0
mov ebx, esi
xor esi, esi
test ebx, ebx
jle 0x4054ba
mov edi, edi
mov edx, dword [ebp + esi*4 - 0x11c0]
mov eax, edx
lea edi, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x405420
sub eax, edi
inc eax
push eax
push edx
push 0x400
lea ecx, [ebp - 0x808]
push ecx
lea edx, [ebp - 0x100c]
push edx
call fcn.00408afb
mov eax, dword [ebp - 0x1020]
add esp, 0x14
push eax
lea ecx, [ebp - 0x1008]
push 0x400
push ecx
call fcn.00406b82
add esp, 0xc
push 0x41a0f4
lea edx, [ebp - 0x1008]
push 0x400
push edx
call fcn.0040795d
add esp, 0xc
lea eax, [ebp - 0x808]
push eax
lea ecx, [ebp - 0x1008]
push 0x400
push ecx
call fcn.0040795d
add esp, 0xc
lea edx, [ebp - 0x1008]
push edx
lea eax, [ebp - 0x808]
push eax
call dword [0x4203a0]
add esp, 8
test al, al
je 0x4054e6
inc esi
cmp esi, ebx
jl 0x405410
mov edx, dword [ebp - 0x1014]
push edx
call fcn.00406d5b
add esp, 4
mov edx, str.LEAVING________________________________________________EHDownLoadFilesToFolder
call fcn.00401870
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov al, 1
pop ebx
call fcn.00406b73
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x1014]
push ecx
call fcn.00406d5b
add esp, 4
mov edx, 0x41a6e0
jmp 0x405229