Function at 0x40b830
Capabilities:
Create directory
Create http request
Get common file path
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4e439f
mov eax, dword fs:[0]
push eax
sub esp, 0x418
mov eax, dword [0x53132c]
xor eax, esp
mov dword [esp + 0x410], eax
push ebx
push esi
push edi
mov eax, dword [0x53132c]
xor eax, esp
push eax
lea eax, [esp + 0x428]
mov dword fs:[0], eax
xor edi, edi
mov ebx, ecx
mov esi, 1
mov dword [esp + 0x1c], edi
cmp dword [ebx + 0x34], esi
jne 0x40bb31
push 0x9c40
mov ecx, 0x536e48
call fcn.0044af00
test al, al
je 0x40be48
mov dword [esp + 0x24], 0x513850
mov dword [esp + 0x430], edi
lea ecx, [esp + 0x74]
mov dword [esp + 0x1c], esi
mov dword [esp + 0x74], vtable.std::basic_ostream_char__struct_std::char_traits_char__.0
call fcn.004016a0
lea ecx, [esp + 0x14]
lea eax, [esp + 0x28]
push ecx
lea ecx, [esp + 0x78]
mov dword [esp + 0xb0], eax
mov dword [esp + 0xb4], edi
call fcn.00401660
push eax
mov dword [esp + 0x434], 2
call fcn.00404a20
mov byte [esp + 0x434], 1
mov edi, dword [esp + 0x18]
add esp, 4
mov ebx, eax
test edi, edi
je 0x40b942
push 0
lea ecx, [esp + 0x1c]
call fcn.0044752e
mov eax, dword [edi + 4]
test eax, eax
je 0x40b922
cmp eax, 0xffffffff
jae 0x40b922
dec eax
mov dword [edi + 4], eax
mov esi, dword [edi + 4]
neg esi
sbb esi, esi
lea ecx, [esp + 0x18]
not esi
call fcn.00447556
and esi, edi
je 0x40b942
mov edx, dword [esi]
mov eax, dword [edx]
push 1
mov ecx, esi
call eax
mov edx, dword [ebx]
mov eax, dword [edx + 0x18]
push 0x20
mov ecx, ebx
call eax
cmp dword [esp + 0xac], 0
mov byte [esp + 0xb4], al
jne 0x40b974
mov eax, dword [esp + 0x80]
or eax, 4
push 0
push eax
lea ecx, [esp + 0x7c]
call fcn.00401560
mov dword [esp + 0x430], 3
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx + 4]
mov edi, vtable.std::basic_ostringstream_char__struct_std::char_traits_char___class_std::allocator_char__.0
lea ecx, [esp + 0x28]
mov dword [esp + edx + 0x24], edi
call fcn.004045c0
mov esi, vtable.std::basic_stringbuf_char__struct_std::char_traits_char___class_std::allocator_char__.0
xor ebx, ebx
mov dword [esp + 0x28], esi
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], 4
lea eax, [esp + 0x24]
push str.SmartDownload::start_called_more_than_once
push eax
mov dword [esp + 0x438], 5
call fcn.00404c20
add esp, 8
lea ecx, [esp + 0x1f0]
push ecx
lea ecx, [esp + 0x28]
call fcn.004031f0
push 0x2f
push str.SmartDownload.cpp
push eax
push 0x9c40
mov ecx, 0x536e48
mov byte [esp + 0x440], 6
call fcn.0044af10
cmp dword [esp + 0x204], 0x10
jb 0x40ba16
mov edx, dword [esp + 0x1f0]
push edx
call fcn.00458691
add esp, 4
mov ecx, dword [esp + 0x24]
mov edx, dword [ecx + 4]
lea eax, [esp + 0x74]
mov dword [esp + 0x1c], eax
mov dword [esp + edx + 0x24], edi
mov dword [esp + 0x430], 7
test byte [esp + 0x68], 1
lea eax, [esp + 0x28]
mov dword [esp + 0x20], eax
mov dword [esp + 0x28], esi
je 0x40ba56
mov ecx, dword [esp + 0x38]
mov eax, dword [ecx]
push eax
call fcn.00458691
add esp, 4
mov edx, dword [esp + 0x38]
mov dword [edx], ebx
mov eax, dword [esp + 0x48]
mov dword [eax], ebx
mov ecx, dword [esp + 0x58]
mov dword [ecx], ebx
mov edx, dword [esp + 0x3c]
mov dword [edx], ebx
mov eax, dword [esp + 0x4c]
mov dword [eax], ebx
mov ecx, dword [esp + 0x5c]
mov dword [ecx], ebx
and dword [esp + 0x68], 0xfffffffe
mov dword [esp + 0x64], ebx
mov dword [esp + 0x28], vtable.std::basic_streambuf_char__struct_std::char_traits_char__.0
mov byte [esp + 0x430], 8
mov eax, dword [esp + 0x60]
mov dword [esp + 0x14], eax
cmp eax, ebx
je 0x40baec
mov edi, dword [eax]
cmp edi, ebx
je 0x40badf
push ebx
lea ecx, [esp + 0x1c]
call fcn.0044752e
mov eax, dword [edi + 4]
cmp eax, ebx
jbe 0x40babf
cmp eax, 0xffffffff
jae 0x40babf
dec eax
mov dword [edi + 4], eax
mov esi, dword [edi + 4]
neg esi
sbb esi, esi
lea ecx, [esp + 0x18]
not esi
call fcn.00447556
and esi, edi
je 0x40badf
mov edx, dword [esi]
mov eax, dword [edx]
push 1
mov ecx, esi
call eax
mov ecx, dword [esp + 0x14]
push ecx
call fcn.00458691
add esp, 4
lea ecx, [esp + 0x2c]
mov byte [esp + 0x430], 7
call fcn.00447beb
mov dword [esp + 0x430], 0xffffffff
mov edx, dword [esp + 0x24]
mov eax, dword [edx + 4]
lea ecx, [esp + 0x74]
mov dword [esp + eax + 0x24], vtable.std::basic_ostream_char__struct_std::char_traits_char__.0
push ecx
mov dword [esp + 0x78], vtable.std::ios_base.0
call fcn.00447a81
add esp, 4
jmp 0x40be48
push 0x208
lea eax, [esp + 0x212]
xor edx, edx
push edi
push eax
mov word [esp + 0x218], dx
call fcn.00458cc0
add esp, 0xc
lea ecx, [esp + 0x20c]
push ecx
push 0x105
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea edx, [esp + 0x154]
push edx
call fcn.0040d750
lea eax, [esp + 0x20c]
push eax
lea ecx, [esp + 0x158]
push ecx
mov dword [esp + 0x438], 9
call fcn.0040ed50
mov esi, dword [ebx + 0x54]
movzx eax, word [esi]
add esp, 8
cmp ax, di
je 0x40bc36
cmp ax, 0x2f
je 0x40bc14
cmp ax, 0x20
je 0x40bc14
cmp ax, 9
je 0x40bc14
cmp ax, 0xa
je 0x40bc14
cmp ax, 0xd
je 0x40bc14
cmp ax, 0x2a
je 0x40bc14
cmp ax, 0x5c
je 0x40bc14
cmp ax, 0x28
je 0x40bc14
cmp ax, 0x29
je 0x40bc14
cmp ax, 0x25
je 0x40bc14
cmp ax, 0x3a
je 0x40bc14
cmp ax, 0x3f
je 0x40bc14
cmp ax, 0x27
je 0x40bc14
cmp ax, 0x60
je 0x40bc14
cmp ax, 0x3c
je 0x40bc14
cmp ax, 0x3e
je 0x40bc14
cmp ax, 0x7c
je 0x40bc14
push eax
lea edx, [esp + 0x158]
push edx
jmp 0x40bc1e
push 0x5f
lea eax, [esp + 0x158]
push eax
call fcn.0040f010
movzx eax, word [esi + 2]
add esi, 2
add esp, 8
cmp ax, di
jne 0x40bba3
lea ecx, [esp + 0x154]
push str._smartdownload_
push ecx
call fcn.0040ed50
add esp, 8
lea ecx, [esp + 0x1f0]
lea eax, [esp + 0x154]
call fcn.0040d830
lea esi, [ebx + 0x38]
push eax
mov ecx, esi
mov byte [esp + 0x434], 0xa
call fcn.004087c0
mov edi, 8
mov byte [esp + 0x430], 9
cmp dword [esp + 0x204], edi
jb 0x40bc97
mov edx, dword [esp + 0x1f0]
push edx
call fcn.00458691
add esp, 4
cmp dword [esi + 0x14], edi
jb 0x40bc9e
mov esi, dword [esi]
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x40be05
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp esi, 0xb7
je 0x40be05
push 0x9c40
mov ecx, 0x536e48
call fcn.0044af00
test al, al
je 0x40bde7
push 1
push 2
lea ecx, [esp + 0xc4]
call fcn.004030f0
push esi
push ecx
lea eax, [esp + 0xc4]
push str.SmartDownload::start_failed_creating_temp_dir:
push eax
mov byte [esp + 0x440], 0xb
call fcn.00404c20
add esp, 0xc
mov ecx, eax
call fcn.0040d470
lea ecx, [esp + 0x1f0]
push ecx
lea ecx, [esp + 0xc0]
call fcn.004031f0
push 0x52
push str.SmartDownload.cpp
push eax
push 0x9c40
mov ecx, 0x536e48
mov byte [esp + 0x440], 0xc
call fcn.0044af10
cmp dword [esp + 0x204], 0x10
jb 0x40bd5d
mov edx, dword [esp + 0x1f0]
push edx
call fcn.00458691
add esp, 4
mov ecx, dword [esp + 0xbc]
mov edx, dword [ecx + 4]
lea eax, [esp + 0x10c]
mov dword [esp + 0x204], 0xf
mov dword [esp + 0x200], 0
mov byte [esp + 0x1f0], 0
mov dword [esp + 0x20], eax
mov dword [esp + edx + 0xbc], vtable.std::basic_ostringstream_char__struct_std::char_traits_char___class_std::allocator_char__.0
lea ecx, [esp + 0xc0]
mov byte [esp + 0x430], 0xd
call fcn.00403220
mov byte [esp + 0x430], 9
mov eax, dword [esp + 0xbc]
mov ecx, dword [eax + 4]
lea edx, [esp + 0x10c]
mov dword [esp + ecx + 0xbc], vtable.std::basic_ostream_char__struct_std::char_traits_char__.0
push edx
mov dword [esp + method.std::ios_base.virtual_0], vtable.std::ios_base.0
call fcn.00447a81
add esp, 4
lea ecx, [esp + 0x154]
mov dword [esp + 0x430], 0xffffffff
call fcn.0040be70
mov eax, 2
jmp 0x40be4a
mov eax, dword [ebx + 0x54]
push 0
push 0
push 0
push 1
push eax
call dword [sym.imp.WININET.dll_InternetOpenW]
mov dword [ebx + 0x58], eax
mov dword [esp + 0x430], 0xffffffff
lea ecx, [esp + 0x154]
test eax, eax
jne 0x40be3c
call fcn.0040be70
mov eax, 5
jmp 0x40be4a
mov dword [ebx + 0x34], 1
call fcn.0040be70
xor eax, eax
mov ecx, dword [esp + 0x428]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x410]
xor ecx, esp
call fcn.004587b6
mov esp, ebp
pop ebp
ret