Function at 0x4054e0
Capabilities:
Check for peb beingdebugged flag
Get file size
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x415c6b
mov eax, dword fs:[0]
push eax
sub esp, 0x354
mov eax, dword [0x41a2f0]
xor eax, esp
mov dword [esp + 0x350], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x41a2f0]
xor eax, esp
push eax
lea eax, [esp + 0x368]
mov dword fs:[0], eax
mov eax, dword [esp + 0x37c]
mov ebp, dword [esp + 0x378]
mov edi, dword [esp + 0x380]
xor ebx, ebx
mov esi, edx
push 0x103
lea edx, [esp + 0x261]
push ebx
push edx
mov dword [esp + 0x24], eax
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x34], esi
mov dword [esp + 0x2c], ebx
mov byte [esp + 0x268], bl
call fcn.00409500
add esp, 0xc
push 0x103
lea eax, [esp + 0x159]
push ebx
push eax
mov byte [esp + 0x160], bl
call fcn.00409500
add esp, 0xc
push 0x103
lea ecx, [esp + 0x51]
push ebx
push ecx
mov byte [esp + 0x58], bl
call fcn.00409500
add esp, 0xc
push esi
push edi
push str._s_s
mov ecx, 0x104
lea edi, [esp + 0x268]
mov dword [esp + 0x30], ebx
mov dword [esp + 0x40], ebx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x28], ebx
call fcn.00401bb0
add esp, 0xc
xor edx, edx
cmp dword [esp + 0x384], ebx
push ebx
setne dl
push 0x80
mov eax, edi
lea edx, [edx + edx + 2]
push edx
push ebx
push 1
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x370], ebx
cmp eax, 0xffffffff
jne 0x405607
xor eax, eax
jmp 0x4059ca
lea ecx, [esp + 0x3c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
push esi
push str.SIZE__s_r_n
mov ecx, 0x104
lea edi, [esp + 0x15c]
call fcn.00401bb0
mov eax, edi
add esp, 8
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x405632
mov ecx, dword [ebp + 0xb4]
sub eax, edx
lea edx, [esp + 0x20]
push edx
push eax
lea eax, [esp + 0x15c]
push eax
mov eax, dword [esp + 0x24]
push ecx
call fcn.00404180
mov esi, eax
add esp, 0x10
cmp esi, ebx
je 0x4059b8
mov edi, dword [esp + 0x18]
lea edx, [esp + 0x24]
push edx
mov edx, dword [ebp + 0xb4]
lea eax, [esp + 0x24]
push eax
push ebx
push 0x104
lea ecx, [esp + 0x5c]
push ecx
push edi
push edx
call fcn.00403ee0
mov esi, eax
add esp, 0x1c
cmp esi, ebx
je 0x4059b8
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x54]
push str._d__I64d
push edx
call fcn.0040777a
mov ecx, dword [esp + 0x34]
mov eax, 0x51eb851f
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
add esp, 0x10
cmp eax, 2
je 0x4056d6
xor esi, esi
jmp 0x4059b8
mov ecx, 1
call fcn.00403820
mov ecx, dword [ebp + 0xb4]
mov esi, dword [esp + 0x30]
push ecx
mov ecx, edi
call fcn.004044e0
add esp, 4
test eax, eax
jne 0x405700
xor esi, esi
jmp 0x4059b8
cmp dword [esp + 0x384], ebx
je 0x4057cd
mov edx, dword [esp + 0x2c]
push 2
push ebx
push ebx
xor eax, eax
push eax
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x3c]
push eax
push ecx
push str.REST__d_r_n
mov ecx, 0x400
lea edi, [esp + 0x160]
call fcn.00401bb0
mov eax, edi
add esp, 0xc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x405747
mov ecx, dword [ebp + 0xb4]
mov edi, dword [esp + 0x18]
sub eax, edx
lea edx, [esp + 0x20]
push edx
push eax
lea eax, [esp + 0x15c]
push eax
push ecx
mov eax, edi
call fcn.00404180
mov esi, eax
add esp, 0x10
cmp esi, ebx
je 0x4059b8
lea edx, [esp + 0x24]
push edx
mov edx, dword [ebp + 0xb4]
lea eax, [esp + 0x24]
push eax
push ebx
push 0x104
lea ecx, [esp + 0x5c]
push ecx
push edi
push edx
call fcn.00403ee0
mov esi, eax
add esp, 0x1c
cmp esi, ebx
je 0x4059b8
mov ecx, dword [esp + 0x24]
mov eax, 0x51eb851f
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 3
je 0x4057cd
xor esi, esi
jmp 0x4059b8
mov ecx, dword [esp + 0x28]
push ecx
push str.RETR__s_r_n
mov ecx, 0x400
lea edi, [esp + 0x15c]
call fcn.00401bb0
mov eax, edi
add esp, 8
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x4057f0
mov ecx, dword [ebp + 0xb4]
sub eax, edx
lea edx, [esp + 0x20]
push edx
push eax
lea eax, [esp + 0x15c]
push eax
mov eax, dword [esp + 0x24]
push ecx
call fcn.00404180
mov esi, eax
add esp, 0x10
cmp esi, ebx
je 0x4059b8
mov eax, dword [esp + 0x40]
cmp eax, dword [esp + 0x38]
mov edi, dword [esp + 0x3c]
mov dword [esp + 0x48], eax
jg 0x4058ae
jl 0x405840
cmp edi, dword [esp + 0x34]
jae 0x4058ae
mov edi, edi
push ebx
lea edx, [esp + 0x24]
push edx
mov edx, dword [esp + 0x38]
lea eax, [esp + 0x24]
push eax
mov eax, dword [ebp + 0xb4]
push 0x104
lea ecx, [esp + 0x5c]
push ecx
push edx
push eax
call fcn.00403ee0
mov esi, eax
add esp, 0x1c
cmp esi, ebx
je 0x4059b8
mov eax, dword [esp + 0x1c]
push ebx
lea ecx, [esp + 0x2c]
push ecx
push eax
add edi, eax
mov eax, dword [esp + 0x38]
adc dword [esp + 0x54], ebx
lea edx, [esp + 0x58]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4056cf
mov ecx, dword [esp + 0x48]
cmp ecx, dword [esp + 0x38]
jl 0x405840
jg 0x4058ae
cmp edi, dword [esp + 0x34]
jb 0x405840
lea esi, [esp + 0x2c]
call fcn.00406b20
mov edi, dword [esp + 0x18]
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x24]
push eax
mov eax, dword [ebp + 0xb4]
lea ecx, [esp + 0x24]
push ecx
push 0x104
lea edx, [esp + 0x5c]
push edx
push edi
push eax
mov dword [esp + 0x38], ebx
call fcn.00403ee0
mov esi, eax
add esp, 0x1c
cmp esi, ebx
je 0x4059b8
lea ecx, [esp + 0x28]
mov dword [esp + 0x28], ebx
mov dword [esp + 0x18], ebx
push ecx
mov ecx, dword [esp + 0x20]
lea ebx, [esp + 0x1c]
lea esi, [esp + 0x50]
call fcn.00404be0
mov ecx, dword [esp + 0x1c]
add esp, 4
test ecx, ecx
jne 0x405976
push 0x104
push ecx
mov edx, esi
push edx
mov dword [esp + 0x28], ecx
call fcn.00409500
add esp, 0xc
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [ebp + 0xb4]
lea edx, [esp + 0x24]
push edx
push 0x104
mov eax, esi
push eax
push edi
push ecx
call fcn.00403ee0
mov esi, eax
add esp, 0x1c
test esi, esi
je 0x4059b8
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x28]
push edx
lea esi, [esp + 0x50]
call fcn.00404be0
mov ecx, dword [esp + 0x1c]
add esp, 4
mov eax, 0x51eb851f
imul ecx
sar edx, 5
mov eax, edx
shr eax, 0x1f
add eax, edx
cmp eax, 2
je 0x405990
xor esi, esi
jmp 0x4059b8
cmp ecx, 0xe2
jne 0x4059ab
mov esi, dword [esp + 0x30]
mov ecx, dword [esi]
push ecx
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi], 0xffffffff
mov esi, 1
lea ecx, [esi + 1]
call fcn.00403820
mov eax, dword [esp + 0x2c]
cmp eax, 0xffffffff
je 0x4059c8
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
mov ecx, dword [esp + 0x368]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x350]
xor ecx, esp
call fcn.004075fb
add esp, 0x360
ret