Function at 0x40a53d
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4a1f34
mov eax, dword fs:[0]
push eax
sub esp, 0x824
mov eax, dword [0x4d04c0]
xor eax, esp
mov dword [esp + 0x81c], eax
push ebx
push esi
mov eax, dword [0x4d04c0]
xor eax, esp
push eax
lea eax, [esp + 0x830]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x10], eax
mov eax, dword [edi + 8]
mov esi, ecx
mov ebx, edx
test eax, eax
je 0x40a8a1
cmp eax, 0xffffffff
je 0x40a8a1
test ebx, ebx
je 0x40a883
mov eax, ebx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40a5a8
sub eax, edx
sar eax, 1
cmp eax, 1
jb 0x40a883
cmp dword [ebp + 0xc], 0
jg 0x40a607
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [0x4d4770]
push eax
push str._ERROR___d___pid__d__error.
call fcn.00414401
add esp, 0xc
mov eax, dword [edi + 8]
test eax, eax
je 0x40a8ba
cmp eax, 0xffffffff
je 0x40a8ba
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [edi + 8], 0
jmp 0x40a8ba
push esi
lea eax, [esp + 0x18]
push eax
call fcn.004025df
and dword [esp + 0x838], 0
lea eax, [esp + 0x14]
mov esi, 0x4bae00
push eax
mov ecx, esi
call fcn.00404382
test eax, eax
jne 0x40a659
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [0x4d4770]
push eax
push str._ERROR___d___download_url_is_empty.
call fcn.00414401
mov eax, dword [esp + 0x1c]
pop ecx
pop ecx
add eax, 0xfffffff0
call fcn.00402a23
jmp 0x40a8ba
push ebx
lea eax, [edi + 0x3c]
push eax
call fcn.004025be
xor ebx, ebx
cmp dword [esp + 0x10], ebx
je 0x40a66f
mov esi, dword [esp + 0x10]
push esi
lea eax, [edi + 0x40]
push eax
call fcn.004025be
mov eax, dword [ebp + 0x10]
mov dword [edi + 0x30], eax
mov eax, dword [0x4d001c]
mov esi, 0x4d001c
mov ecx, esi
call dword [eax + 0xc]
add eax, 0x10
mov dword [esp + 0x10], eax
mov byte [esp + 0x838], 1
mov eax, dword [0x4d001c]
mov ecx, esi
call dword [eax + 0xc]
add eax, 0x10
mov dword [esp + 0x1c], eax
xor eax, eax
mov byte [esp + 0x838], 2
push 0x7fe
mov word [esp + 0x28], ax
lea eax, [esp + 0x2a]
push ebx
push eax
mov dword [esp + 0x24], ebx
call fcn.004805d0
mov eax, dword [esp + 0x20]
add esp, 0xc
push dword [eax - 0xc]
lea esi, [esp + 0x18]
call fcn.004024d9
lea esi, [esp + 0x24]
mov ecx, eax
call fcn.00412dba
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x14]
push eax
lea edx, [esp + 0x20]
mov ecx, esi
call fcn.0040682a
pop ecx
pop ecx
test eax, eax
jne 0x40a764
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str._ERROR___d___parse_url_diy_failed_
mov ecx, dword [0x4d4770]
call fcn.00414401
mov eax, dword [edi + 8]
pop ecx
pop ecx
cmp eax, ebx
je 0x40a739
cmp eax, 0xffffffff
je 0x40a739
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 8], ebx
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
call fcn.00402a23
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
call fcn.00402a23
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
call fcn.00402a23
mov eax, ebx
jmp 0x40a8bc
lea ecx, [esp + 0x24]
lea eax, [edi + 0x48]
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
cmp dx, bx
jne 0x40a76e
sub ecx, esi
sar ecx, 1
lea edx, [esp + 0x24]
push edx
mov ebx, ecx
call fcn.00402530
xor ebx, ebx
inc ebx
call fcn.0040a8e1
xor ebx, ebx
mov dword [edi + 0x54], eax
cmp eax, ebx
jne 0x40a7e4
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [0x4d4770]
push eax
push str._ERROR___d___create_download_pub_info_failed_
call fcn.00414401
mov eax, dword [edi + 8]
pop ecx
pop ecx
cmp eax, ebx
je 0x40a7c9
cmp eax, 0xffffffff
je 0x40a7c9
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [edi + 8], ebx
lea eax, [esp + 0x18]
push eax
mov ecx, edi
mov dword [esp + 0x1c], 5
call fcn.0040c03d
mov ebx, eax
jmp 0x40a739
mov ecx, dword [edi + 0xa0]
push ebx
mov dword [eax + 0x10], ecx
mov esi, dword [edi + 0x54]
push ebx
call fcn.00405d70
mov eax, dword [edi + 0x54]
mov dword [eax + 0xc], edi
lea eax, [esp + 0x24]
push eax
mov eax, dword [edi + 0x54]
call fcn.004060bf
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
call esi
mov ecx, dword [0x4d4770]
push eax
push str._INFO___d___create_download_main_thread.
call fcn.00414401
pop ecx
pop ecx
lea eax, [esp + 0x20]
push eax
push ebx
push edi
push 0x40a299
push 0xa00000
push ebx
mov dword [esp + 0x38], ebx
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [edi + 0x34], eax
cmp eax, ebx
je 0x40a876
cmp eax, 0xffffffff
je 0x40a876
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff0
call fcn.00402a23
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
call fcn.00402a23
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
call fcn.00402a23
xor eax, eax
inc eax
jmp 0x40a8bc
call esi
push eax
push str._ERROR___d___create_download_main_thread_failed_
jmp 0x40a716
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [0x4d4770]
push eax
push str._ERROR___d___save_file_path_is_empty.
call fcn.00414401
pop ecx
pop ecx
jmp 0x40a5e3
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [0x4d4770]
push eax
push str._ERROR___d___end_event_is_invalid.
call fcn.00414401
pop ecx
pop ecx
xor eax, eax
mov ecx, dword [esp + 0x830]
mov dword fs:[0], ecx
pop ecx
pop esi
pop ebx
mov ecx, dword [esp + 0x81c]
xor ecx, esp
call fcn.0047a0fb
mov esp, ebp
pop ebp
ret 0xc