Function at 0x10040170
Capabilities:
Check if file exists
Delete file

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x10152b3c
mov eax, dword fs:[0]
push eax
sub esp, 0x434
mov eax, dword [0x101a154c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x434], edi
mov eax, dword [ebp + 8]
xor esi, esi
mov dword [ebp - 0x430], eax
lea eax, [ebp - 0x420]
mov dword [ebp - 0x42c], 0
push eax
mov dword [ebp - 0x420], esi
call fcn.1004d3d0
add esp, 4
mov ecx, dword [edi]
or edi, 0xffffffff
mov dword [ebp - 4], esi
mov eax, dword [ecx + 0x50]
cmp dword [eax - 0xc], esi
je 0x10040531
push ecx
mov dword [ebp - 0x41c], esi
mov esi, esp
mov dword [ebp - 0x414], esi
mov eax, dword [ecx + 0x50]
sub eax, 0x10
push eax
call fcn.10019b20
add eax, 0x10
add esp, 4
mov dword [esi], eax
lea eax, [ebp - 0x41c]
push eax
call fcn.1004d310
add esp, 8
mov dword [ebp - 0x418], 0
mov eax, dword [ebp - 0x420]
mov byte [ebp - 4], 2
mov dword [ebp - 0x424], 0
mov ecx, dword [eax - 0x10]
test ecx, ecx
je 0x10040247
mov eax, dword [ecx]
mov eax, dword [eax + 0x10]
call eax
mov ecx, eax
test ecx, ecx
jne 0x1004025f
call fcn.10017d20
mov ecx, eax
mov edx, dword [eax]
mov eax, dword [edx + 0x10]
call eax
mov ecx, eax
test ecx, ecx
je 0x10040c95
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x42c], 1
mov dword [ebp - 0x424], eax
mov eax, dword [ebp - 0x420]
push 1
push 0x101601d4
push dword [eax - 0xc]
push eax
lea eax, [ebp - 0x424]
push eax
call fcn.10019b90
lea eax, [ebp - 0x41c]
push eax
lea eax, [ebp - 0x424]
push eax
lea eax, [ebp - 0x418]
push eax
call fcn.10019130
add esp, 0x20
mov dword [ebp - 0x42c], 0
mov edx, dword [ebp - 0x424]
mov eax, edi
mov byte [ebp - 4], 4
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x100402de
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [0x101a7bf4]
test ecx, ecx
jne 0x10040345
push 0x101a10e8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x101a7bf4], 0
jne 0x1004032c
push 0x1c
call fcn.100f8c40
mov esi, eax
add esp, 4
mov dword [ebp - 0x414], esi
test esi, esi
je 0x10040324
lea ecx, [esi + 4]
mov dword [esi], vtable._BaseModule::CCriticalSection.0
push ecx
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
jmp 0x10040326
xor esi, esi
mov dword [0x101a7bf4], esi
push 0x101a10e8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [0x101a7bf4]
test ecx, ecx
jne 0x10040345
xor eax, eax
jmp 0x100403a9
mov eax, dword [0x101a7bf0]
test eax, eax
jne 0x100403a9
mov eax, dword [ecx]
push ecx
call dword [eax]
cmp dword [0x101a7bf0], 0
jne 0x10040399
push 4
call fcn.100f8c40
add esp, 4
mov dword [ebp - 0x414], eax
mov byte [ebp - 4], 5
test eax, eax
je 0x10040383
mov ecx, eax
mov dword [eax], 0
call fcn.1009c010
jmp 0x10040385
xor eax, eax
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x414]
xor edx, edx
lock or dword [ecx], edx
mov dword [0x101a7bf0], eax
mov eax, dword [0x101a7bf4]
push eax
mov ecx, dword [eax]
call dword [ecx + 4]
mov eax, dword [0x101a7bf0]
push 0
push str.halopet
push 0
push 0
push str.start_download
mov ecx, eax
call fcn.1009c0b0
push dword [ebp - 0x418]
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x1004058d
push 0x200
lea eax, [ebp - 0x210]
push 0
push eax
call fcn.101213d0
push 0x100
lea eax, [ebp - 0x210]
push eax
push dword [ebp - 0x418]
call fcn.1008ad30
add esp, 0x18
call fcn.10017d20
mov ecx, eax
test ecx, ecx
je 0x10040c9f
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x428], eax
lea eax, [ebp - 0x210]
mov byte [ebp - 4], 6
test eax, 0xffff0000
jne 0x10040442
movzx eax, ax
lea ecx, [ebp - 0x428]
push eax
call fcn.10014c30
jmp 0x10040472
lea ecx, [ebp - 0x210]
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10040450
sub ecx, edx
lea eax, [ebp - 0x210]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x428]
call fcn.1001c8c0
mov eax, dword [ebp - 0x434]
mov esi, dword [ebp - 0x428]
push esi
mov byte [ebp - 4], 7
mov eax, dword [eax]
push dword [eax + 0x54]
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x10040572
mov ecx, dword [ebp - 0x430]
lea eax, [ebp - 0x418]
push eax
call fcn.100190c0
push 0
push str.halopet
push 0
push 0
push str.md5_suc2
mov dword [ebp - 0x424], 1
call fcn.1001ae30
mov ecx, eax
call fcn.1009c0b0
mov byte [ebp - 4], 4
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x100404e9
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x418]
mov eax, edi
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1004050a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x41c]
mov eax, edi
mov byte [ebp - 4], 0
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x1004052b
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x424]
mov eax, dword [ebp - 0x420]
mov dword [ebp - 4], 0xffffffff
add eax, 0xfffffff0
lock xadd dword [eax + 0xc], edi
dec edi
test edi, edi
jg 0x10040553
mov ecx, dword [eax]
push eax
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.100f8fe1
mov esp, ebp
pop ebp
ret 4
mov byte [ebp - 4], 4
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x1004058d
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
push dword [ebp - 0x418]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
call fcn.10017d20
mov ecx, eax
test ecx, ecx
je 0x10040ca9
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x438], eax
mov eax, dword [ebp - 0x434]
xorps xmm0, xmm0
push 0x20
mov byte [ebp - 4], 8
movlpd qword [ebp - 0x440], xmm0
mov esi, dword [eax]
mov eax, dword [eax + 0x10]
mov dword [ebp - 0x428], eax
call fcn.100f8c40
add esp, 4
mov dword [ebp - 0x414], eax
mov byte [ebp - 4], 9
test eax, eax
je 0x10040603
xorps xmm0, xmm0
mov ecx, eax
movups xmmword [eax], xmm0
movups xmmword [eax + 0x10], xmm0
call fcn.10018e20
jmp 0x10040605
xor eax, eax
push dword [ebp - 0x414]
lea ecx, [ebp - 0x440]
mov byte [ebp - 4], 8
push eax
mov dword [ebp - 0x440], 0
mov dword [ebp - 0x43c], 0
call fcn.10018770
push dword [ebp - 0x428]
lea eax, [ebp - 0x418]
mov byte [ebp - 4], 0xa
push 0x493e0
push eax
push dword [esi + 0x50]
mov esi, dword [ebp - 0x440]
mov ecx, esi
mov dword [ebp - 0x424], 0
call fcn.10019cf0
lea ecx, [ebp - 0x438]
test eax, eax
je 0x10040678
mov dword [ebp - 0x424], 1
lea eax, [esi + 0x14]
jmp 0x1004067b
lea eax, [esi + 0x1c]
push eax
call fcn.10019000
mov esi, dword [ebp - 0x43c]
mov byte [ebp - 4], 8
test esi, esi
je 0x100406ae
mov eax, edi
lock xadd dword [esi + 4], eax
jne 0x100406ae
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, edi
lock xadd dword [esi + 8], eax
jne 0x100406ae
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
cmp dword [ebp - 0x424], 0
je 0x10040af9
mov ecx, dword [0x101a7bf4]
test ecx, ecx
jne 0x10040722
push 0x101a10e8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x101a7bf4], 0
jne 0x10040709
push 0x1c
call fcn.100f8c40
mov esi, eax
add esp, 4
mov dword [ebp - 0x414], esi
test esi, esi
je 0x10040701
lea ecx, [esi + 4]
mov dword [esi], vtable._BaseModule::CCriticalSection.0
push ecx
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
jmp 0x10040703
xor esi, esi
mov dword [0x101a7bf4], esi
push 0x101a10e8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [0x101a7bf4]
test ecx, ecx
jne 0x10040722
xor eax, eax
jmp 0x10040786
mov eax, dword [0x101a7bf0]
test eax, eax
jne 0x10040786
mov eax, dword [ecx]
push ecx
call dword [eax]
cmp dword [0x101a7bf0], 0
jne 0x10040776
push 4
call fcn.100f8c40
add esp, 4
mov dword [ebp - 0x414], eax
mov byte [ebp - 4], 0xb
test eax, eax
je 0x10040760
mov ecx, eax
mov dword [eax], 0
call fcn.1009c010
jmp 0x10040762
xor eax, eax
mov byte [ebp - 4], 8
lea ecx, [ebp - 0x414]
xor edx, edx
lock or dword [ecx], edx
mov dword [0x101a7bf0], eax
mov eax, dword [0x101a7bf4]
push eax
mov ecx, dword [eax]
call dword [ecx + 4]
mov eax, dword [0x101a7bf0]
push 0
push str.halopet
push 0
push 0
push str.download_suc
mov ecx, eax
call fcn.1009c0b0
mov esi, dword [ebp - 0x430]
mov eax, dword [ebp - 0x418]
mov esi, dword [esi]
lea edx, [eax - 0x10]
sub esi, 0x10
cmp edx, esi
je 0x1004080e
cmp dword [esi + 0xc], 0
jl 0x100407f9
mov ecx, dword [edx]
cmp ecx, dword [esi]
jne 0x100407f9
push edx
call fcn.10019b20
add esp, 4
mov dword [ebp - 0x42c], eax
mov ecx, edi
lea edx, [esi + 0xc]
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x100407ec
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x42c]
mov ecx, dword [ebp - 0x430]
add eax, 0x10
mov dword [ecx], eax
jmp 0x10040808
push dword [eax - 0xc]
mov ecx, dword [ebp - 0x430]
push eax
call fcn.1001c8c0
mov eax, dword [ebp - 0x418]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x10040ad4
push 0x200
lea eax, [ebp - 0x410]
push 0
push eax
call fcn.101213d0
push 0x100
lea eax, [ebp - 0x410]
push eax
push dword [ebp - 0x418]
call fcn.1008ad30
add esp, 0x18
call fcn.10017d20
mov ecx, eax
test ecx, ecx
je 0x10040cb3
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x428], eax
lea eax, [ebp - 0x410]
mov byte [ebp - 4], 0xe
test eax, 0xffff0000
jne 0x1004088b
movzx eax, ax
lea ecx, [ebp - 0x428]
push eax
call fcn.10014c30
jmp 0x100408b6
lea ecx, [ebp - 0x410]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10040894
sub ecx, edx
lea eax, [ebp - 0x410]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x428]
call fcn.1001c8c0
mov eax, dword [ebp - 0x434]
mov esi, dword [ebp - 0x428]
push esi
mov byte [ebp - 4], 0xf
mov eax, dword [eax]
push dword [eax + 0x54]
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
mov ecx, dword [0x101a7bf4]
test eax, eax
jne 0x100409d0
test ecx, ecx
jne 0x10040944
push 0x101a10e8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x101a7bf4], 0
jne 0x1004092b
push 0x1c
call fcn.100f8c40
add esp, 4
mov dword [ebp - 0x42c], eax
test eax, eax
je 0x10040924
lea ecx, [eax + 4]
mov dword [eax], vtable._BaseModule::CCriticalSection.0
push ecx
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, dword [ebp - 0x42c]
jmp 0x10040926
xor eax, eax
mov dword [0x101a7bf4], eax
push 0x101a10e8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [0x101a7bf4]
test ecx, ecx
jne 0x10040944
xor eax, eax
jmp 0x100409a8
mov eax, dword [0x101a7bf0]
test eax, eax
jne 0x100409a8
mov eax, dword [ecx]
push ecx
call dword [eax]
cmp dword [0x101a7bf0], 0
jne 0x10040998
push 4
call fcn.100f8c40
add esp, 4
mov dword [ebp - 0x414], eax
mov byte [ebp - 4], 0x10
test eax, eax
je 0x10040982
mov ecx, eax
mov dword [eax], 0
call fcn.1009c010
jmp 0x10040984
xor eax, eax
mov byte [ebp - 4], 0xf
lea ecx, [ebp - 0x414]
xor edx, edx
lock or dword [ecx], edx
mov dword [0x101a7bf0], eax
mov eax, dword [0x101a7bf4]
push eax
mov ecx, dword [eax]
call dword [ecx + 4]
mov eax, dword [0x101a7bf0]
push 0
push str.halopet
push 0
push 0
push str.md5_suc
mov ecx, eax
call fcn.1009c0b0
mov eax, dword [ebp - 0x424]
mov dword [ebp - 0x424], eax
jmp 0x10040ab9
test ecx, ecx
jne 0x10040a34
push 0x101a10e8
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x101a7bf4], 0
jne 0x10040a1b
push 0x1c
call fcn.100f8c40
add esp, 4
mov dword [ebp - 0x42c], eax
test eax, eax
je 0x10040a14
lea ecx, [eax + 4]
mov dword [eax], vtable._BaseModule::CCriticalSection.0
push ecx
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, dword [ebp - 0x42c]
jmp 0x10040a16
xor eax, eax
mov dword [0x101a7bf4], eax
push 0x101a10e8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [0x101a7bf4]
test ecx, ecx
jne 0x10040a34
xor eax, eax
jmp 0x10040a98
mov eax, dword [0x101a7bf0]
test eax, eax
jne 0x10040a98
mov eax, dword [ecx]
push ecx
call dword [eax]
cmp dword [0x101a7bf0], 0
jne 0x10040a88
push 4
call fcn.100f8c40
add esp, 4
mov dword [ebp - 0x414], eax
mov byte [ebp - 4], 0x11
test eax, eax
je 0x10040a72
mov ecx, eax
mov dword [eax], 0
call fcn.1009c010
jmp 0x10040a74
xor eax, eax
mov byte [ebp - 4], 0xf
lea ecx, [ebp - 0x414]
xor edx, edx
lock or dword [ecx], edx
mov dword [0x101a7bf0], eax
mov eax, dword [0x101a7bf4]
push eax
mov ecx, dword [eax]
call dword [ecx + 4]
mov eax, dword [0x101a7bf0]
push 0
push str.halopet
push 0
push 0
push str.md5_fail
mov ecx, eax
call fcn.1009c0b0
mov dword [ebp - 0x424], 0
mov byte [ebp - 4], 8
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x10040ad4
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x438]
mov eax, edi
mov byte [ebp - 4], 4
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x100404e9
mov ecx, dword [edx]
push edx
jmp 0x100404e4
call fcn.10017d20
mov ecx, eax
test ecx, ecx
je 0x10040cbd
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x434], eax
mov eax, dword [ebp - 0x438]
mov esi, 0x1015f9a8
test eax, eax
mov byte [ebp - 4], 0xd
cmovne esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push 0
push 0
push eax
push esi
push 0
push 0xfde9
mov dword [ebp - 0x430], eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push eax
push 0
lea ecx, [ebp - 0x424]
mov dword [ebp - 0x428], eax
mov dword [ebp - 0x424], 0
call fcn.10018ab0
mov ecx, dword [ebp - 0x424]
mov dword [ebp - 0x414], eax
mov dword [ebp - 0x42c], 4
cmp dword [ecx - 4], 1
jle 0x10040b9a
push dword [ecx - 0xc]
lea ecx, [ebp - 0x424]
call fcn.100147b0
mov ecx, dword [ebp - 0x424]
push dword [ebp - 0x428]
push ecx
push dword [ebp - 0x430]
push esi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, dword [ebp - 0x414]
push dword [eax]
lea eax, [ebp - 0x434]
push str.download_fail__s
push eax
call fcn.1001ad60
mov edx, dword [ebp - 0x424]
add esp, 0xc
mov byte [ebp - 4], 0xc
add edx, 0xfffffff0
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10040bf2
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x434]
push 0
push str.halopet
push 0
push 0
push esi
call fcn.1001ae30
mov ecx, eax
call fcn.1009c0b0
mov byte [ebp - 4], 8
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x10040c2b
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x438]
mov eax, edi
mov byte [ebp - 4], 4
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10040c4c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x418]
mov eax, edi
mov byte [ebp - 4], 1
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10040c6d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x41c]
mov eax, edi
mov byte [ebp - 4], 0
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10040c8e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
xor esi, esi
jmp 0x10040531
push 0x80004005
call fcn.100142b0
push 0x80004005
call fcn.100142b0
push 0x80004005
call fcn.100142b0
push 0x80004005
call fcn.100142b0
push 0x80004005
call fcn.100142b0
int3