Function at 0x491312
Capabilities:
Check if file exists
Delete file
Get common file path

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4a94c0
mov eax, dword fs:[0]
push eax
sub esp, 0x274
mov eax, dword [0x4e106c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
push dword [eax + 0xe8]
push str.StartDownloadTBSElement_begin__retry_count__d_
push 0xd2
push 0x4c6790
call fcn.0044c788
add esp, 0x10
call fcn.00417fc6
add eax, 4
mov dword [ebp - 0x25c], eax
push 0x4c67a4
mov eax, dword [ebp + 8]
add eax, 0xb4
push eax
push str.tbsUrl
push dword [ebp - 0x25c]
mov eax, dword [ebp - 0x25c]
mov eax, dword [eax]
call dword [eax + 0xc]
mov ecx, dword [ebp + 8]
add ecx, 0xb4
call fcn.00406ddd
push eax
lea ecx, [ebp - 0x250]
call fcn.0040700c
and dword [ebp - 4], 0
lea ecx, [ebp - 0x250]
call fcn.004070ef
movzx eax, al
test eax, eax
je 0x491446
push str.StartDownloadTBSElement_server_config_url_is_empty_try_package_default
push 0xd2
push 0x4c6848
call fcn.0044c788
add esp, 0xc
mov ecx, dword [ebp + 8]
call fcn.004919ca
mov ecx, dword [ebp + 8]
add ecx, 0xb4
call fcn.00406ddd
push eax
lea ecx, [ebp - 0x250]
call fcn.00406fd6
lea ecx, [ebp - 0x250]
call fcn.004070ef
movzx eax, al
test eax, eax
je 0x491446
push str.StartDownloadTBSElement_package_default_url_is_empty
push 0xd2
push 0x4c685c
call fcn.0044c788
add esp, 0xc
and dword [ebp - 0x270], 0
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x250]
call fcn.00405d4a
mov eax, dword [ebp - 0x270]
jmp 0x491796
mov ecx, dword [ebp + 8]
add ecx, 0xb4
call fcn.00406ddd
push eax
push str.StartDownloadTBSElement_url_:_s
push 0xd2
push 0x4c68dc
call fcn.0044c788
add esp, 0x10
mov eax, dword [ebp + 8]
cmp dword [eax + 0xac], 0
jne 0x4914c6
push 0xc8
call fcn.00455954
pop ecx
mov dword [ebp - 0x274], eax
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x274]
call fcn.0041ce44
mov dword [ebp - 0x260], eax
jmp 0x4914a7
mov eax, dword [ebp - 0x260]
mov dword [ebp - 0x278], eax
mov byte [ebp - 4], 0
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x278]
mov dword [eax + 0xac], ecx
lea ecx, [ebp - 0x250]
call fcn.004026c4
push eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xac]
call fcn.00406eb9
xor eax, eax
mov word [ebp - 0x21c], ax
push 0x208
push 0
lea eax, [ebp - 0x21a]
push eax
call fcn.00458260
add esp, 0xc
lea eax, [ebp - 0x24c]
push eax
mov ecx, dword [ebp + 8]
call fcn.00490593
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x26c]
call fcn.0041c0b7
mov byte [ebp - 4], 3
lea eax, [ebp - 0x26c]
push eax
push 0x4c6930
mov eax, dword [ebp + 8]
push dword [eax + 0xac]
call fcn.0047e55d
add esp, 0xc
lea ecx, [ebp - 0x26c]
call fcn.0041d7c9
movzx eax, al
test eax, eax
jne 0x49164a
mov dword [ebp - 0x264], 1
push 0x4c6934
lea ecx, [ebp - 0x234]
call fcn.0040224c
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x234]
call fcn.00406ddd
push eax
lea ecx, [ebp - 0x24c]
call fcn.00406ddd
push eax
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4915bb
lea eax, [ebp - 0x21c]
push eax
call fcn.0047ec3f
pop ecx
mov dword [ebp - 0x264], eax
cmp dword [ebp - 0x264], 0
je 0x491602
lea ecx, [ebp - 0x26c]
call fcn.0041d7a3
push eax
lea ecx, [ebp - 0x234]
call fcn.00402035
lea ecx, [ebp - 0x234]
call fcn.00406ddd
push eax
lea ecx, [ebp - 0x24c]
call fcn.00406ddd
push eax
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
jmp 0x49163b
lea eax, [ebp - 0x21c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea ecx, [ebp - 0x26c]
call fcn.0041d7a3
mov ecx, eax
call fcn.00406ddd
push eax
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x234]
call fcn.004020b1
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebp - 0x21c]
push eax
push str.StartDownloadTBSElement_file_s
push 0xd2
push 0x4c696c
call fcn.0044c788
add esp, 0x10
lea eax, [ebp - 0x21c]
push eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xac]
add ecx, 0x18
call fcn.00406eb9
mov eax, dword [ebp + 8]
add eax, 0xb0
push eax
mov eax, dword [ebp + 8]
push dword [eax + 0xac]
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x18]
mov ecx, dword [ebp + 8]
mov eax, dword [eax]
mov ecx, dword [ecx + 0x18]
call dword [eax + 4]
test eax, eax
jne 0x49172b
lea eax, [ebp - 0x258]
push eax
mov ecx, dword [ebp + 8]
add ecx, 0x1c
call fcn.0041dc5e
lea eax, [ebp - 0x280]
push eax
mov ecx, dword [ebp + 8]
add ecx, 0x1c
call fcn.0041dc09
push eax
lea ecx, [ebp - 0x258]
call fcn.00401d6d
movzx eax, al
test eax, eax
je 0x491727
lea ecx, [ebp - 0x258]
call fcn.00401db3
mov eax, dword [eax]
mov dword [ebp - 0x254], eax
cmp dword [ebp - 0x254], 0
je 0x49171a
push 0x12
mov eax, dword [ebp - 0x254]
mov eax, dword [eax]
push dword [ebp - 0x254]
call dword [eax + 0x14]
lea ecx, [ebp - 0x258]
call fcn.0041d9bc
jmp 0x4916c6
xor eax, eax
jne 0x4916b4
call fcn.00417daa
mov ecx, eax
call fcn.00498389
push 1
call fcn.00417daa
mov ecx, eax
call fcn.004983a5
push str.StartDownloadTBSElement_end
push 0xd2
push 0x4c69f8
call fcn.0044c788
add esp, 0xc
and dword [ebp - 0x27c], 0
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x26c]
call fcn.0041c072
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x24c]
call fcn.004020b1
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x250]
call fcn.00405d4a
mov eax, dword [ebp - 0x27c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00455912
mov esp, ebp
pop ebp
ret 4