Function at 0x40176e
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1048
call fcn.0040ba70
mov eax, dword [0x4160c0]
xor eax, ebp
mov dword [ebp - 8], eax
mov edx, dword [ebp + 0x10]
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
xor ebx, ebx
cmp dword [edi + 0x14], 0x10
mov dword [ebp - 0x1030], edx
mov dword [edi + 0x10], ebx
jb 0x4017a3
mov eax, dword [edi]
jmp 0x4017a5
mov eax, edi
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocString
mov byte [eax], bl
push ecx
mov dword [edx], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x102c], eax
cmp eax, 0xffffffff
jne 0x4017d2
xor al, al
jmp 0x401a4f
push 0xfff
lea eax, [ebp - 0x100b]
push ebx
push eax
mov byte [ebp - 0x100c], bl
call fcn.004097f0
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
add esp, 0xc
push str.___DownloaderConfigStart__
call esi
push str.___DownloaderConfigEnd__
mov dword [ebp - 0x1028], eax
call esi
mov esi, dword [ebp - 0x102c]
push ebx
push esi
mov dword [ebp - 0x1024], eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edx, eax
mov dword [ebp - 0x1048], edx
cmp edx, 0xffffffff
jne 0x401831
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4017cb
push ebx
lea eax, [ebp - 0x1010]
push eax
mov ecx, 0x1000
mov eax, ecx
cmp edx, ecx
cmovbe eax, edx
push eax
lea eax, [ebp - 0x100c]
push eax
xorps xmm0, xmm0
push esi
mov dword [ebp - 0x1020], ebx
mov byte [ebp - 0x1011], bl
movlpd qword [ebp - 0x1044], xmm0
mov dword [ebp - 0x1010], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401a41
mov eax, dword [ebp - 0x1040]
mov dword [ebp - 0x1034], eax
mov eax, dword [ebp - 0x1044]
mov dword [ebp - 0x1038], eax
mov eax, dword [ebp - 0x1010]
test eax, eax
je 0x401a3f
mov edx, dword [ebp - 0x1020]
add edx, eax
mov dword [ebp - 0x1020], edx
mov esi, ebx
lea ecx, [ebp - 0x100c]
mov dword [ebp - 0x1018], ecx
mov eax, edx
cmp byte [ebp - 0x1011], bl
je 0x401973
sub eax, dword [ebp - 0x1024]
cmp esi, eax
ja 0x4019b0
push dword [ebp - 0x1024]
push str.___DownloaderConfigEnd__
push ecx
call fcn.0040c668
add esp, 0xc
test eax, eax
je 0x401a2f
mov eax, dword [ebp - 0x1018]
mov al, byte [eax]
mov byte [ebp - 0x1019], al
test al, al
je 0x401a41
mov ecx, dword [edi + 0x10]
or eax, 0xffffffff
sub eax, ecx
cmp eax, 1
jbe 0x401a5e
lea eax, [ecx + 1]
push ebx
push eax
mov ecx, edi
mov dword [ebp - 0x1040], eax
call fcn.00402ada
test al, al
je 0x401960
cmp dword [edi + 0x14], 0x10
mov edx, dword [edi + 0x10]
jb 0x40193d
mov eax, dword [edi]
jmp 0x40193f
mov eax, edi
mov cl, byte [ebp - 0x1019]
mov byte [eax + edx], cl
cmp dword [edi + 0x14], 0x10
mov ecx, dword [ebp - 0x1040]
mov dword [edi + 0x10], ecx
jb 0x40195b
mov eax, dword [edi]
jmp 0x40195d
mov eax, edi
mov byte [eax + ecx], bl
mov ecx, dword [ebp - 0x1018]
inc esi
inc ecx
mov edx, dword [ebp - 0x1020]
jmp 0x4018b5
sub eax, dword [ebp - 0x1028]
cmp esi, eax
ja 0x4019b0
push dword [ebp - 0x1028]
push str.___DownloaderConfigStart__
push ecx
call fcn.0040c668
add esp, 0xc
test eax, eax
jne 0x401960
mov ecx, dword [ebp - 0x1018]
add esi, dword [ebp - 0x1028]
add ecx, dword [ebp - 0x1028]
mov byte [ebp - 0x1011], 1
jmp 0x401968
mov eax, dword [ebp - 0x1030]
sub edx, esi
add dword [eax], esi
add dword [ebp - 0x1038], esi
push edx
lea eax, [ebp - 0x100c]
adc dword [ebp - 0x1034], ebx
add eax, esi
push eax
lea eax, [ebp - 0x100c]
push eax
mov dword [ebp - 0x1020], edx
call fcn.00403440
add esp, 0xc
mov eax, 0x1000
sub eax, dword [ebp - 0x1020]
push ebx
cmp eax, dword [ebp - 0x1048]
lea edx, [ebp - 0x1010]
cmovae eax, dword [ebp - 0x1048]
push edx
push eax
lea eax, [ebp - 0x100c]
add eax, dword [ebp - 0x1020]
mov dword [ebp - 0x1010], ebx
push eax
push dword [ebp - 0x102c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401891
jmp 0x401a41
mov eax, dword [ebp - 0x1024]
mov ecx, dword [ebp - 0x1030]
add eax, esi
add dword [ecx], eax
mov bl, 1
push dword [ebp - 0x102c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, bl
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040342f
leave
ret
push str.string_too_long
call fcn.004033ce
int3