Function at 0x402140
Capabilities:
Reference http user-agent string
Write file on windows

Disassembly:
mov eax, 0x857c
call fcn.00410870
mov eax, dword [esp + 0x8580]
push ebx
push ebp
push esi
add eax, 7
lea edx, [esp + 0x1c]
push edi
sub edx, eax
mov edi, edi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x402160
lea eax, [esp + 0x20]
push 0x2f
push eax
call fcn.00406820
add esp, 8
test eax, eax
je 0x402194
lea esi, [esp + 0x88]
mov ecx, eax
sub esi, eax
mov dl, byte [ecx]
mov byte [esi + ecx], dl
inc ecx
test dl, dl
jne 0x402188
mov byte [eax], dl
push 0
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x90]
push edx
lea eax, [esp + 0x194]
push str.POST__s_HTTP_1.1_r_nUser_Agent:Mozilla_5.0__compatible__MSIE_10.0__Windows_NT_6.1__WOW64__Trident_6.0__r_nHOST:__s_r_nPragma:_no_cache_r_nContent_type:_application_x_www_form_urlencoded_r_nContent_length:__d_r_n_r_n_s
push eax
call fcn.004061fd
lea eax, [esp + 0x19c]
add esp, 0x14
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4021c2
sub eax, edx
push eax
lea ecx, [esp + 0x18c]
push ecx
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x28]
call fcn.004040b0
add esp, 8
test eax, eax
je 0x402203
mov edx, dword [esp + 0x14]
push edx
call dword [0x41a18c]
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x857c
ret
mov esi, dword [esp + 0x14]
push 0
push 0x400
lea eax, [esp + 0x590]
push eax
push esi
call dword [0x419f58]
mov ebp, eax
test ebp, ebp
jne 0x402238
push esi
call dword [0x41a18c]
lea eax, [ebp + 2]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x857c
ret
lea ecx, [esp + 0x591]
push str.200_OK_r_n
push ecx
call fcn.00406780
lea edx, [esp + 0x599]
add esp, 8
cmp eax, edx
je 0x40226f
push esi
call dword [0x41a18c]
mov eax, 3
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x857c
ret
lea eax, [esp + 0x588]
push str._r_nContent_Length:
push eax
call fcn.00406780
lea ecx, [esp + 0x590]
push str._r_nTransfer_Encoding:_chunked_r_n
push ecx
mov edi, eax
call fcn.00406780
lea edx, [esp + 0x598]
push str._r_n_r_n
push edx
mov ebx, eax
call fcn.00406780
mov esi, eax
add esp, 0x18
add esi, 4
test edi, edi
je 0x4022c5
add edi, 0x12
push edi
call fcn.004068f4
add esp, 4
mov dword [esp + 0x18], eax
test ebx, ebx
je 0x4022ec
lea eax, [esp + 0x18]
push eax
push 0x415c84
push esi
call fcn.004065ab
push 0x415c88
push esi
call fcn.00406780
add esp, 0x14
add eax, 2
mov esi, eax
mov ecx, dword [esp + 0x8594]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40232e
mov edx, dword [esp + 0x14]
push edx
call dword [0x41a18c]
mov eax, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x857c
ret
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [esp + 0x58c]
sub eax, esi
lea ecx, [esp + 0x20]
push ecx
add ebp, eax
push ebp
push esi
push edi
call ebx
sub dword [esp + 0x18], ebp
je 0x402386
mov eax, dword [esp + 0x14]
push 0
push 0x8000
lea edx, [esp + 0x590]
push edx
push eax
call dword [0x419f58]
push 0
lea ecx, [esp + 0x20]
push ecx
mov esi, eax
push esi
lea edx, [esp + 0x594]
push edx
push edi
call ebx
sub dword [esp + 0x18], esi
jne 0x402351
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14]
push eax
call dword [0x41a18c]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x857c
ret