Function at 0x407050
Capabilities:
Read http header

Disassembly:
sub esp, 0x50
push ebx
push ebp
mov ebx, dword [esp + 0x5c]
push esi
push edi
xor edi, edi
lea eax, [esp + 0x14]
push edi
push eax
push edi
push edi
mov ebp, ecx
push 0x16
push ebx
mov dword [esp + 0x30], ebp
mov dword [esp + 0x2c], edi
mov dword [esp + 0x28], edi
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
cmp eax, edi
jne 0x40708f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x407426
mov ecx, dword [esp + 0x14]
lea edx, [ecx + ecx]
push edx
call sub.MFC42.DLL_operatornew
mov esi, eax
add esp, 4
cmp esi, edi
je 0x407426
mov eax, dword [esp + 0x10]
mov edi, esi
push 0
lea ecx, [eax + eax]
xor eax, eax
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x14]
push ecx
push esi
push 0
push 0x16
push ebx
mov dword [esp + 0x28], eax
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x40712d
push esi
lea ebx, [ebp + 0x34]
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
mov edi, eax
mov ecx, ebx
push 1
push edi
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Grow_unsigned_int__bool_]
test al, al
je 0x407129
mov eax, dword [ebx + 4]
mov ecx, esi
test edi, edi
jbe 0x407119
mov edx, edi
mov bp, word [ecx]
add ecx, 2
mov word [eax], bp
add eax, 2
dec edx
jne 0x40710a
mov edx, dword [ebx + 4]
mov ebp, dword [esp + 0x18]
mov dword [ebx + 8], edi
mov word [edx + edi*2], 0
mov ebx, dword [esp + 0x64]
mov eax, dword [esp + 0x14]
mov edi, dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
lea ecx, [esp + 0x10]
push 0
push ecx
push esi
push 0
push 5
push ebx
mov dword [esp + 0x28], eax
call edi
test eax, eax
je 0x407167
mov edx, dword [esp + 0x10]
push esi
shr edx, 1
mov word [esi + edx*2], 0
call dword [sym.imp.MSVCRT.dll__wtol]
add esp, 4
mov dword [ebp + 0x74], eax
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x10]
push 0
push ecx
push esi
push 0
push 0x21
push ebx
mov dword [esp + 0x28], eax
call edi
test eax, eax
je 0x4071dd
mov edx, dword [esp + 0x10]
push esi
shr edx, 1
lea ebx, [ebp + 0x10c]
mov word [esi + edx*2], 0
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
mov edi, eax
mov ecx, ebx
push 1
push edi
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Grow_unsigned_int__bool_]
test al, al
je 0x4071d9
mov eax, dword [ebx + 4]
mov ecx, esi
test edi, edi
jbe 0x4071c9
mov edx, edi
mov bp, word [ecx]
add ecx, 2
mov word [eax], bp
add eax, 2
dec edx
jne 0x4071ba
mov eax, dword [ebx + 4]
mov ebp, dword [esp + 0x18]
mov dword [ebx + 8], edi
mov word [eax + edi*2], 0
mov ebx, dword [esp + 0x64]
mov ecx, dword [esp + 0x14]
mov edi, dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
lea edx, [esp + 0x10]
push 0
push edx
push esi
push 0
push 0x19
push ebx
mov dword [esp + 0x28], ecx
call edi
test eax, eax
je 0x407257
mov eax, dword [esp + 0x10]
push esi
shr eax, 1
lea ebx, [ebp + 0x54]
mov word [esi + eax*2], 0
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
mov edi, eax
mov ecx, ebx
push 1
push edi
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Grow_unsigned_int__bool_]
test al, al
je 0x407334
mov eax, dword [ebx + 4]
mov ecx, esi
test edi, edi
jbe 0x407246
mov edx, edi
mov bp, word [ecx]
add ecx, 2
mov word [eax], bp
add eax, 2
dec edx
jne 0x407237
mov ecx, dword [ebx + 4]
mov dword [ebx + 8], edi
mov word [ecx + edi*2], 0
jmp 0x407330
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x10]
push 0
push eax
push esi
push 0
push 1
push ebx
mov dword [esp + 0x28], edx
call edi
test eax, eax
je 0x407334
mov ecx, dword [esp + 0x10]
xor eax, eax
shr ecx, 1
lea edi, [esp + 0x22]
xor ebx, ebx
mov word [esi + ecx*2], 0
mov ecx, 0xf
mov word [esp + 0x20], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
test dword [esp + 0x10], 0xfffffffe
jbe 0x4072e2
mov ebp, dword [sym.imp.MSVCRT.dll__wcsnicmp]
mov edi, esi
push 7
push str.charset
push edi
call ebp
add esp, 0xc
test eax, eax
je 0x4072cd
mov edx, dword [esp + 0x10]
inc ebx
shr edx, 1
add edi, 2
cmp ebx, edx
jb 0x4072ac
jmp 0x4072e2
lea eax, [esi + ebx*2 + 0x10]
push 0xa
lea ecx, [esp + 0x24]
push eax
push ecx
call dword [sym.imp.MSVCRT.dll_wcsncpy]
add esp, 0xc
mov ebp, dword [esp + 0x18]
lea edx, [esp + 0x20]
push edx
lea ebx, [ebp + 0x54]
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
mov edi, eax
mov ecx, ebx
push 1
push edi
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Grow_unsigned_int__bool_]
test al, al
je 0x407334
mov eax, dword [ebx + 4]
lea ecx, [esp + 0x20]
test edi, edi
jbe 0x407324
mov edx, edi
mov bp, word [ecx]
add ecx, 2
mov word [eax], bp
add eax, 2
dec edx
jne 0x407315
mov eax, dword [ebx + 4]
mov dword [ebx + 8], edi
mov word [eax + edi*2], 0
mov ebp, dword [esp + 0x18]
push 0x41fc74
mov dword [esp + 0x20], 0
lea edi, [ebp + 0x78]
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
mov ebx, eax
mov ecx, edi
push 1
push ebx
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Grow_unsigned_int__bool_]
test al, al
je 0x407387
mov eax, dword [edi + 4]
mov ecx, 0x41fc74
test ebx, ebx
jbe 0x40737b
mov edx, ebx
mov bp, word [ecx]
add ecx, 2
mov word [eax], bp
add eax, 2
dec edx
jne 0x40736c
mov ecx, dword [edi + 4]
mov dword [edi + 8], ebx
mov word [ecx + ebx*2], 0
mov edx, dword [esp + 0x14]
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x64]
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x10]
push eax
push ecx
push esi
push 0
push 0x2b
push edx
call dword [sym.imp.WINHTTP.dll_WinHttpQueryHeaders]
test eax, eax
je 0x40741d
mov eax, dword [esp + 0x10]
push esi
mov word [esi + eax*2], 0
call dword [sym.imp.MSVCRT.dll_wcslen]
mov ecx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::npos]
mov ebx, eax
add esp, 4
mov edx, dword [ecx]
mov ecx, dword [edi + 8]
sub edx, ecx
cmp edx, ebx
ja 0x4073da
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
test ebx, ebx
jbe 0x40738f
mov ebp, dword [edi + 8]
push 0
add ebp, ebx
mov ecx, edi
push ebp
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::_Grow_unsigned_int__bool_]
test al, al
je 0x40738f
mov eax, dword [edi + 8]
mov edx, dword [edi + 4]
mov ecx, esi
lea eax, [edx + eax*2]
mov dx, word [ecx]
add ecx, 2
mov word [eax], dx
add eax, 2
dec ebx
jne 0x4073fd
mov eax, dword [edi + 4]
mov dword [edi + 8], ebp
mov word [eax + ebp*2], 0
jmp 0x40738f
push esi
call sub.MFC42.DLL_operatordelete
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x50
ret 4