Function at 0x404990
Capabilities:
Check if file exists
Delete file
Move file
Print debug messages

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5517ac
mov eax, dword fs:[0]
push eax
sub esp, 0x100
mov eax, dword [0x5a0800]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov edi, ecx
mov dword [ebp - 0xec], edi
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc8], eax
mov dword [ebp - 0xfc], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xe8], eax
mov dword [ebp - 0xf8], eax
lea eax, [edi + 0x18]
push 0x55bae8
push eax
mov dword [ebp - 0xd8], eax
lea eax, [ebp - 0xa8]
push eax
mov dword [ebp - 0xd4], edi
call fcn.004013d0
mov al, 1
mov dword [ebp - 4], 0
mov byte [ebp - 0xc1], al
mov byte [ebp - 0xc9], al
mov dword [ebp - 0x90], 0
mov dword [ebp - 0x8c], 0
mov dword [ebp - 0x88], 0
push 8
mov byte [ebp - 4], al
mov dword [ebp - 0x84], 0
mov dword [ebp - 0x80], 0
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x78], 0
mov dword [ebp - 0x74], 0
call fcn.004e6c7e
lea ecx, [ebp - 0x84]
mov dword [eax + 4], 0
mov dword [ebp - 0x84], eax
mov dword [eax], ecx
xorps xmm0, xmm0
mov dword [ebp - 0x70], 0
lea eax, [ebp - 0x70]
mov dword [ebp - 0x6c], 0
push 2
push eax
mov dword [ebp - 0x68], 0
movups xmmword [ebp - 0x64], xmm0
mov dword [ebp - 0x4c], 0
movq qword [ebp - 0x54], xmm0
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 0
call fcn.004c374f
lea eax, [ebp - 0x40]
push eax
call fcn.004c3a0e
add esp, 0x1c
mov esi, dword [ebp + 0x18]
mov byte [ebp - 4], 4
mov byte [ebp - 0x18], 0
test esi, esi
je 0x404b39
lea eax, [ebp - 0x90]
mov dword [ebp - 0xd0], eax
mov eax, dword [ebp - 0x8c]
nop
lea ecx, [ebp - 0xd0]
push ecx
push eax
cmp eax, dword [ebp - 0x88]
je 0x404b20
lea eax, [ebp - 0x90]
push eax
call fcn.00402080
mov eax, dword [ebp - 0x8c]
add esp, 0xc
add eax, 8
mov dword [ebp - 0x8c], eax
jmp 0x404b31
lea ecx, [ebp - 0x90]
call fcn.00401870
mov eax, dword [ebp - 0x8c]
sub esi, 1
jne 0x404af0
mov esi, dword [ebp + 0x18]
xorps xmm0, xmm0
mov dword [ebp - 0xb0], 0
movups xmmword [ebp - 0xc0], xmm0
mov dword [ebp - 0xac], 0xf
mov byte [ebp - 0xc0], 0
push dword [ebp - 0xd8]
mov ecx, edi
mov byte [ebp - 4], 6
call fcn.004046b0
test al, al
jne 0x404d69
mov byte [ebp - 0xc1], al
lea eax, [ebp - 0x70]
mov byte [ebp - 4], 7
push eax
call fcn.004c376b
add esp, 4
test eax, eax
jne 0x405413
cmp dword [ebp - 0x44], 0x7fffffff
je 0x405424
lea eax, [ebp - 0x70]
mov byte [ebp - 0x18], 1
push eax
call fcn.004c37cb
lea eax, [ebp - 0x40]
push eax
call fcn.004c39bc
mov eax, dword [ebp - 0x8c]
add esp, 8
mov esi, dword [ebp - 0x90]
mov dword [ebp - 0xc8], eax
cmp esi, eax
je 0x404c10
cmp dword [esi + 4], 0
je 0x40543e
call sub.KERNEL32.dll_GetCurrentThreadId
cmp dword [esi + 4], eax
je 0x405413
push 0
push dword [esi + 4]
push dword [esi]
call fcn.004c35c0
add esp, 0xc
test eax, eax
jne 0x405437
mov dword [esi], eax
mov dword [esi + 4], eax
add esi, 8
cmp esi, dword [ebp - 0xc8]
jne 0x404bd1
lea eax, [ebp - 0x40]
push eax
call fcn.004c39e1
lea eax, [ebp - 0x70]
push eax
call fcn.004c3707
mov esi, dword [ebp - 0x74]
add esp, 8
mov edx, dword [ebp - 0x80]
test esi, esi
je 0x404c7c
nop
mov ecx, dword [ebp - 0x78]
mov eax, dword [ebp - 0x7c]
dec ecx
add ecx, esi
dec eax
and ecx, eax
mov eax, dword [edx + ecx*4]
mov dword [ebp - 0xc8], eax
mov ecx, dword [eax + 0x24]
test ecx, ecx
je 0x404c6d
mov edx, dword [ecx]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov eax, dword [ebp - 0xc8]
mov dword [eax + 0x24], 0
mov esi, dword [ebp - 0x74]
mov edx, dword [ebp - 0x80]
sub esi, 1
mov dword [ebp - 0x74], esi
jne 0x404c30
mov dword [ebp - 0x78], 0
test edx, edx
je 0x404cd4
mov esi, dword [ebp - 0x7c]
test esi, esi
je 0x404ca2
mov eax, dword [edx + esi*4 - 4]
dec esi
test eax, eax
je 0x404c9e
push 0x28
push eax
call fcn.004e6cae
mov edx, dword [ebp - 0x80]
add esp, 8
test esi, esi
jne 0x404c87
mov eax, dword [ebp - 0x7c]
lea ecx, [eax*4]
mov eax, edx
cmp ecx, 0x1000
jb 0x404cca
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40541a
push ecx
push edx
call fcn.004e6cae
add esp, 8
mov eax, dword [ebp - 0x84]
push 8
push eax
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x80], 0
mov dword [ebp - 0x84], 0
call fcn.004e6cae
mov edx, dword [ebp - 0x90]
add esp, 8
test edx, edx
je 0x4052ff
mov ecx, dword [ebp - 0x8c]
mov eax, edx
cmp eax, ecx
je 0x404d31
nop word [eax + eax]
cmp dword [eax + 4], 0
jne 0x40541f
add eax, 8
cmp eax, ecx
jne 0x404d20
mov ecx, dword [ebp - 0x88]
mov eax, edx
sub ecx, edx
and ecx, 0xfffffff8
cmp ecx, 0x1000
jb 0x404d5a
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40541a
push ecx
push edx
call fcn.004e6cae
add esp, 8
jmp 0x4052ff
mov ecx, dword [ebp - 0xd8]
mov eax, ecx
cmp dword [ecx + 0x14], 0xf
jbe 0x404d79
mov eax, dword [ecx]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x404f83
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
je 0x404f83
xor al, al
mov byte [ebp - 0xc1], al
lea eax, [ebp - 0x70]
mov byte [ebp - 4], 8
push eax
call fcn.004c376b
add esp, 4
test eax, eax
jne 0x405413
cmp dword [ebp - 0x44], 0x7fffffff
je 0x405424
lea eax, [ebp - 0x70]
mov byte [ebp - 0x18], 1
push eax
call fcn.004c37cb
lea eax, [ebp - 0x40]
push eax
call fcn.004c39bc
mov eax, dword [ebp - 0x8c]
add esp, 8
mov esi, dword [ebp - 0x90]
mov dword [ebp - 0xc8], eax
cmp esi, eax
je 0x404e32
cmp dword [esi + 4], 0
je 0x40543e
call sub.KERNEL32.dll_GetCurrentThreadId
cmp dword [esi + 4], eax
je 0x405413
push 0
push dword [esi + 4]
push dword [esi]
call fcn.004c35c0
add esp, 0xc
test eax, eax
jne 0x405437
mov dword [esi], eax
mov dword [esi + 4], eax
add esi, 8
cmp esi, dword [ebp - 0xc8]
jne 0x404df3
lea eax, [ebp - 0x40]
push eax
call fcn.004c39e1
lea eax, [ebp - 0x70]
push eax
call fcn.004c3707
mov esi, dword [ebp - 0x74]
add esp, 8
mov edx, dword [ebp - 0x80]
test esi, esi
je 0x404e9d
mov ecx, dword [ebp - 0x78]
mov eax, dword [ebp - 0x7c]
dec ecx
add ecx, esi
dec eax
and ecx, eax
mov eax, dword [edx + ecx*4]
mov dword [ebp - 0xc8], eax
mov ecx, dword [eax + 0x24]
test ecx, ecx
je 0x404e8e
mov edx, dword [ecx]
cmp ecx, eax
setne al
movzx eax, al
push eax
call dword [edx + 0x10]
mov eax, dword [ebp - 0xc8]
mov dword [eax + 0x24], 0
mov esi, dword [ebp - 0x74]
mov edx, dword [ebp - 0x80]
sub esi, 1
mov dword [ebp - 0x74], esi
jne 0x404e51
mov dword [ebp - 0x78], 0
test edx, edx
je 0x404ef5
mov esi, dword [ebp - 0x7c]
test esi, esi
je 0x404ec3
mov eax, dword [edx + esi*4 - 4]
dec esi
test eax, eax
je 0x404ebf
push 0x28
push eax
call fcn.004e6cae
mov edx, dword [ebp - 0x80]
add esp, 8
test esi, esi
jne 0x404ea8
mov eax, dword [ebp - 0x7c]
lea ecx, [eax*4]
mov eax, edx
cmp ecx, 0x1000
jb 0x404eeb
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40541a
push ecx
push edx
call fcn.004e6cae
add esp, 8
mov eax, dword [ebp - 0x84]
push 8
push eax
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x80], 0
mov dword [ebp - 0x84], 0
call fcn.004e6cae
mov edx, dword [ebp - 0x90]
add esp, 8
test edx, edx
je 0x4052ff
mov ecx, dword [ebp - 0x8c]
mov eax, edx
cmp eax, ecx
je 0x404f51
nop dword [eax + eax]
cmp dword [eax + 4], 0
jne 0x40541f
add eax, 8
cmp eax, ecx
jne 0x404f40
mov ecx, dword [ebp - 0x88]
mov eax, edx
sub ecx, edx
and ecx, 0xfffffff8
cmp ecx, 0x1000
jb 0x404d5a
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40541a
jmp 0x404d5a
lea eax, [ebp - 0xa8]
mov ecx, edi
push eax
call fcn.00406750
xor eax, eax
mov dword [ebp - 0xd0], eax
cmp eax, esi
jge 0x405241
cmp dword [ebp - 0x94], 0xf
lea eax, [ebp - 0xa8]
push 0
cmova eax, dword [ebp - 0xa8]
push 0x20
push 4
push 0
push 3
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0xe4], eax
cmp eax, 0xffffffff
jne 0x404fe0
push str._XIMAO___DownloadByParts_m_bCancel__true_r_n
jmp 0x405237
push 0x58260a
push 0x38
call fcn.004e6cbc
mov esi, eax
add esp, 8
mov dword [ebp - 0xdc], esi
test esi, esi
je 0x405232
cmp dword [ebp + 0x18], 1
mov eax, dword [ebp - 0xd0]
mov ecx, dword [ebp - 0xe4]
mov dword [esi + 0xc], 0xffffffff
mov dword [esi + 0x30], 0
mov dword [esi + 8], 0
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 0
mov dword [esi + 0x18], 0
mov dword [esi + 0x1c], 0
mov dword [esi + 0x20], 0
mov dword [esi + 0x24], 0
mov dword [esi + 0x28], 0
mov dword [esi + 0x2c], 0
mov byte [esi], 0
mov dword [esi + 4], 0
mov dword [esi + 8], eax
mov dword [esi + 0xc], ecx
mov dword [ebp - 0xdc], esi
mov dword [esi + 4], edi
jne 0x4050ca
mov ecx, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
sub ecx, 1
mov dword [esi + 0x10], 0
mov eax, edx
mov dword [esi + 0x14], 0
sbb eax, 0
mov dword [esi + 0x18], ecx
mov dword [esi + 0x1c], eax
mov eax, dword [ebp + 8]
mov dword [esi + 0x28], eax
mov dword [esi + 0x2c], edx
cmp eax, 0xffffffff
jne 0x4050b1
test edx, edx
jne 0x4050b1
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], edx
xorps xmm0, xmm0
movlpd qword [ebp - 0xf4], xmm0
mov eax, dword [ebp - 0xf0]
mov ecx, dword [ebp - 0xf4]
jmp 0x405145
push dword [ebp + 0x14]
cdq
push dword [ebp + 0x10]
push edx
push eax
call fcn.004e6eb0
mov ecx, edx
mov dword [esi + 0x10], eax
mov dword [ebp - 0xf0], eax
mov dword [esi + 0x14], ecx
mov eax, dword [edi + 0x6c]
mov dword [ebp - 0xe0], ecx
dec eax
mov ecx, dword [ebp - 0xd0]
cmp ecx, eax
jge 0x40510d
push dword [ebp + 0x14]
lea eax, [ecx + 1]
push dword [ebp + 0x10]
cdq
push edx
push eax
call fcn.004e6eb0
jmp 0x405119
mov eax, dword [ebp - 0xc8]
mov edx, dword [ebp - 0xe8]
mov ecx, dword [ebp - 0xf0]
sub eax, 1
mov dword [esi + 0x18], eax
sbb edx, 0
sub eax, ecx
mov dword [esi + 0x1c], edx
sbb edx, dword [ebp - 0xe0]
add eax, 1
mov dword [esi + 0x28], eax
mov eax, dword [ebp - 0xe0]
adc edx, 0
mov dword [esi + 0x2c], edx
push 0
push 0
push eax
push ecx
push dword [ebp - 0xe4]
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
mov eax, dword [edi + 0x34]
lea ecx, [edi + 0x30]
cmp eax, dword [ecx + 8]
je 0x40516a
mov dword [eax], esi
add dword [ecx + 4], 4
jmp 0x405177
lea edx, [ebp - 0xdc]
push edx
push eax
call fcn.00401720
lea eax, [ebp - 0x104]
mov dword [ebp - 0x104], edi
push eax
lea eax, [ebp - 0x10c]
mov dword [ebp - 0x100], esi
push eax
lea ecx, [ebp - 0x90]
mov byte [ebp - 4], 9
call fcn.004021b0
mov ecx, dword [ebp - 0x10c]
test ecx, ecx
je 0x40520d
or eax, 0xffffffff
lock xadd dword [ecx + 4], eax
jne 0x40520d
mov edx, dword [ecx + 0x78]
test edx, edx
je 0x4051c4
mov eax, dword [edx]
push ecx
mov ecx, edx
call dword [eax]
jmp 0x40520d
mov eax, dword [ecx]
push 1
call dword [eax]
jmp 0x40520d
lea eax, [edi + 0x68]
mov dword [ebp - 4], 6
push eax
call fcn.004015c0
add esp, 4
lock inc dword [eax]
mov eax, dword [ebp - 0xd0]
mov esi, dword [ebp + 0x18]
inc eax
jmp 0x404f93
push str._XIMAO___DownloadByParts_pPackageInfo__NULL_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov byte [edi + 0x70], 1
lea eax, [ebp - 0x70]
mov byte [ebp - 4], 0xb
push eax
call fcn.004c376b
add esp, 4
test eax, eax
jne 0x405413
cmp dword [ebp - 0x44], 0x7fffffff
je 0x405424
lea eax, [ebp - 0x70]
mov byte [ebp - 0x18], 1
push eax
call fcn.004c37cb
lea eax, [ebp - 0x40]
push eax
call fcn.004c39bc
mov eax, dword [ebp - 0x8c]
add esp, 8
mov esi, dword [ebp - 0x90]
mov dword [ebp - 0xd4], eax
cmp esi, eax
je 0x4052d4
cmp dword [esi + 4], 0
je 0x40543e
call sub.KERNEL32.dll_GetCurrentThreadId
cmp dword [esi + 4], eax
je 0x405413
push 0
push dword [esi + 4]
push dword [esi]
call fcn.004c35c0
add esp, 0xc
test eax, eax
jne 0x405437
mov dword [esi], eax
mov dword [esi + 4], eax
add esi, 8
cmp esi, dword [ebp - 0xd4]
jne 0x405295
lea eax, [ebp - 0x40]
push eax
call fcn.004c39e1
lea eax, [ebp - 0x70]
push eax
call fcn.004c3707
add esp, 8
lea ecx, [ebp - 0x84]
call fcn.00402e20
lea ecx, [ebp - 0x90]
call fcn.004034e0
lea eax, [edi + 0x68]
push eax
call fcn.004015b0
mov esi, eax
add esp, 4
mov eax, dword [esi]
nop
test eax, eax
je 0x405324
push 0x64
mov ecx, edi
call fcn.00406490
mov eax, dword [esi]
nop
test eax, eax
jne 0x405314
mov eax, dword [edi + 0x34]
mov esi, dword [edi + 0x30]
mov dword [ebp - 0xd4], eax
cmp esi, eax
je 0x405368
mov edi, eax
mov eax, dword [esi]
cmp byte [eax], 0
jne 0x40534f
push str._XIMAO___DownloadByParts_m_packageParts_bSuccess_false_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov byte [ebp - 0xc1], 0
push 0x38
push dword [esi]
call fcn.004e6cae
add esi, 4
add esp, 8
cmp esi, edi
jne 0x405336
mov edi, dword [ebp - 0xec]
mov eax, dword [edi + 0x30]
cmp eax, dword [edi + 0x34]
je 0x405373
mov dword [edi + 0x34], eax
mov al, byte [ebp - 0xc1]
mov byte [edi + 0x72], al
mov byte [edi + 0x70], 0
test al, al
je 0x4053b9
push str._XIMAO___DownloadByParts_MoveFileA_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov ecx, dword [ebp - 0xd8]
cmp dword [ecx + 0x14], 0xf
jbe 0x40539d
mov ecx, dword [ecx]
cmp dword [ebp - 0x94], 0xf
lea eax, [ebp - 0xa8]
push ecx
cmova eax, dword [ebp - 0xa8]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileA]
mov ecx, dword [ebp - 0x94]
cmp ecx, 0xf
jbe 0x4053ef
mov edx, dword [ebp - 0xa8]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x4053e5
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x405432
push ecx
push edx
call fcn.004e6cae
add esp, 8
mov al, byte [ebp - 0xc1]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.004e6d11
mov esp, ebp
pop ebp
ret 0x14
push 5
call fcn.004c411e
call fcn.004f7238
call fcn.00511460
push 6
mov dword [ebp - 0x44], SysReAllocString
call fcn.004c411e
call fcn.004f7238
push 2
call fcn.004c411e
push 1
call fcn.004c411e
int3