Function at 0x40afd0
Capabilities:
Access peb ldr_data
Check if file exists
Get file attributes

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x5796f0
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x5d2020]
xor eax, esp
push eax
lea eax, [esp + 0x30]
mov dword fs:[0], eax
mov edi, ecx
mov dword [esp + 0x20], edi
mov esi, dword [ebp + 8]
lea eax, [esp + 0x24]
push eax
mov ecx, str.tlbox_download_run
mov edx, esi
call fcn.00406730
mov ecx, dword [esp + 0x24]
test ecx, ecx
mov ebx, dword [esi + 0xc]
lea eax, [esi + 8]
je 0x40b028
cmp ecx, eax
je 0x40b02e
call dword [sym.imp.MSVCR80.dll__invalid_parameter_noinfo]
cmp dword [esp + 0x28], ebx
je 0x40b221
mov ecx, str.tlbox_mainexe
mov eax, esi
call fcn.004067d0
test eax, eax
lea ecx, [edi + 4]
mov dword [esp + 0x18], ecx
jne 0x40b053
xor ecx, ecx
jmp 0x40b06f
mov ecx, eax
lea ebx, [ecx + 2]
jmp 0x40b060
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x40b060
sub ecx, ebx
sar ecx, 1
push eax
mov eax, dword [esp + 0x1c]
mov ebx, ecx
call fcn.00402030
mov ecx, str.tlbox_secname
mov eax, esi
call fcn.004067d0
add edi, 8
test eax, eax
mov dword [esp + 0x24], edi
jne 0x40b096
xor ecx, ecx
jmp 0x40b0af
mov ecx, eax
lea ebx, [ecx + 2]
jmp 0x40b0a0
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x40b0a0
sub ecx, ebx
sar ecx, 1
push eax
mov ebx, ecx
mov eax, edi
call fcn.00402030
mov edx, dword [esp + 0x18]
mov eax, dword [edx]
cmp dword [eax - 0xc], 0
je 0x40b1a2
mov ecx, dword [edi]
cmp dword [ecx - 0xc], 0
je 0x40b1a2
mov ecx, 0x5c3e04
mov eax, esi
call fcn.004067d0
lea edx, [esp + 0x14]
push edx
mov ecx, eax
call fcn.00401bd0
mov dword [esp + 0x38], 0
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.MSVCR80.dll__wtoi]
add esp, 4
mov edi, 0x400000
lea ebx, [esp + 0x10]
mov dword [esp + 0x1c], eax
call fcn.00407850
mov esi, ebx
mov byte [esp + 0x38], 1
call fcn.004078e0
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx]
mov ecx, dword [eax - 0xc]
push ecx
push eax
mov edx, ebx
push edx
call fcn.00407d80
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40b1b9
test al, 0x10
jne 0x40b1b9
mov ecx, dword [esp + 0x1c]
mov esi, dword [ebp + 8]
push ecx
call fcn.0040ad90
mov byte [esp + 0x38], 0
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40b17a
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [esp + 0x38], 0xffffffff
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40b1a2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [esp + 0x20]
push ecx
call fcn.0040aed0
test eax, eax
jne 0x40b1f8
mov edx, dword [esp + 0x24]
mov eax, dword [edx]
push eax
call fcn.0040ac90
add esp, 4
test al, al
je 0x40b1f8
mov eax, dword [esp + 0x10]
call fcn.00407a00
test eax, eax
je 0x40b1f8
mov eax, dword [esp + 0x1c]
mov esi, dword [ebp + 8]
push eax
lea ebx, [esp + 0x14]
call fcn.0040ad90
lea eax, [esp + 0x10]
call fcn.00401b90
lea eax, [esp + 0x14]
call fcn.00401b90
xor eax, eax
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov eax, 1
mov ecx, dword [esp + 0x30]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4