Function at 0x47a340
Capabilities:
Delete file
Move file

Disassembly:
sub esp, 0xd58
push ebx
push ebp
push esi
mov ebx, ecx
push edi
push 0x8000
lea ecx, [esp + 0x28]
call fcn.004b9680
xor esi, esi
mov ecx, 0x24
xor eax, eax
lea edi, [esp + 0x38]
mov dword [esp + 0x34], esi
mov byte [esp + 0x5d8], al
rep stosd dword es:[edi], eax
mov ecx, 0x1e3
lea edi, [esp + 0x5d9]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov eax, dword [esp + 0xd6c]
mov edx, 0x56b730
cmp eax, esi
mov dword [esp + 0x14], 0xffffffff
mov dword [esp + 0x18], esi
mov dword [esp + 0x10], edx
je 0x47a8cb
cmp dword [esp + 0xd70], esi
je 0x47a8cb
mov eax, dword [ebx + 0x14b4]
cmp eax, esi
je 0x47a3dd
mov ecx, dword [ebx + 0x14b8]
cmp ecx, 1
jle 0x47a3dd
push 0x47a250
push 0x30
push ecx
push eax
call dword [sym.imp.MSVCRT.dll_qsort]
add esp, 0x10
mov ecx, dword [0x5a1a04]
lea eax, [esp + 0x5d8]
lea ebp, [ebx + 4]
push eax
push ebp
call fcn.0051b610
test eax, eax
jne 0x47a421
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], 0x56b730
cmp eax, 0xffffffff
je 0x47a8cf
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x14], 0xffffffff
jmp 0x47a8cf
push esi
push esi
push esi
lea ecx, [esp + 0x5e4]
push 1
push ecx
mov ecx, dword [0x596208]
call fcn.00475c90
push ebp
push ebp
push 0x5965b8
push str._shistorydownloads_s_s1.hst
lea edx, [esp + 0xd8]
push 0x103
push edx
call dword [sym.imp.MSVCRT.dll__snprintf]
add esp, 0x18
lea eax, [esp + 0xc8]
lea ecx, [esp + 0x10]
push 2
push 0x40000000
push eax
call fcn.00412c80
test al, al
jne 0x47a498
lea ecx, [esp + 0xc8]
push ecx
push str.HistoryCenter:__s_open_failed
push 1
push 0x596558
call fcn.004aa400
add esp, 0x10
jmp 0x47a3f8
mov edi, dword [sym.imp.MSVCRT.dll_strncpy]
push 0x3f
lea edx, [esp + 0x3c]
push str._C_opyright_2003__MetaQuotes_Software_Corp.
push edx
call edi
push 0xb
lea eax, [esp + 0x88]
push ebp
push eax
mov byte [esp + 0x8f], 0
call edi
mov ecx, dword [esp + 0x658]
add esp, 0x18
mov dword [esp + 0x88], ecx
mov ecx, dword [0x596208]
push 1
push ebp
mov byte [esp + 0x8b], 0
mov dword [esp + 0x3c], 0x190
mov dword [esp + 0x8c], 1
call fcn.004760b0
lea edx, [esp + 0x34]
push 0x94
push edx
lea ecx, [esp + 0x18]
mov dword [esp + 0x94], eax
call fcn.00412d40
cmp eax, 0x94
je 0x47a574
mov eax, dword [esp + 0x14]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
or ebx, 0xffffffff
cmp eax, ebx
je 0x47a534
push eax
call edi
mov dword [esp + 0x14], ebx
lea eax, [esp + 0xc8]
mov dword [esp + 0x18], esi
push eax
push str.HistoryCenter:__s_write_failed
push 1
push 0x596558
call fcn.004aa400
mov eax, dword [esp + 0x24]
add esp, 0x10
cmp eax, ebx
mov dword [esp + 0x10], 0x56b730
je 0x47a8cf
push eax
call edi
mov dword [esp + 0x14], ebx
jmp 0x47a8cf
mov eax, dword [ebx + 0x14b8]
xor edi, edi
cmp eax, esi
jle 0x47a76c
jmp 0x47a588
xor esi, esi
mov ecx, dword [esp + 0xd70]
mov eax, dword [ecx]
cmp eax, esi
jne 0x47a3f8
mov edx, dword [ebx + 0x14b4]
lea esi, [edi + edi*2]
shl esi, 4
mov ecx, dword [edx + esi]
lea eax, [edx + esi]
cmp ecx, 2
je 0x47a76a
mov edx, dword [eax + 8]
lea ecx, [eax + 0xc]
mov eax, dword [eax + 4]
push ecx
push edx
push eax
push ebp
push ebp
push 0x5965b8
push str._shistorydownloads_s_s__04d__02d__s.dat
lea ecx, [esp + 0x1e8]
push 0x103
push ecx
call dword [sym.imp.MSVCRT.dll__snprintf]
mov eax, dword [ebx + 0x14b4]
add esp, 0x24
lea edx, [esp + 0x24]
push edx
lea ecx, [eax + esi + 0xc]
lea edx, [esp + 0x1d0]
push ecx
push edx
mov ecx, ebx
call fcn.0047a8f0
test eax, eax
je 0x47a84a
test edi, edi
jne 0x47a67e
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x10]
test ecx, ecx
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], edi
je 0x47a682
test eax, eax
je 0x47a682
mov eax, dword [eax]
mov ecx, dword [0x596208]
lea edx, [esp + 0x1c]
push edx
push eax
push edi
push 1
push ebp
call fcn.00476a00
mov esi, eax
test esi, esi
je 0x47a67e
mov eax, dword [esp + 0x1c]
test eax, eax
jle 0x47a675
lea ecx, [eax + eax*4]
lea edx, [eax + ecx*2]
mov ecx, dword [esp + 0x20]
mov ecx, dword [ecx]
cmp ecx, dword [esi + edx*4 - 0x2c]
jne 0x47a661
dec eax
mov dword [esp + 0x1c], eax
lea edx, [eax + eax*4]
lea ecx, [esp + 0x10]
lea eax, [eax + edx*2]
shl eax, 2
push eax
push esi
call fcn.00412d40
push esi
call fcn.004c2eb0
add esp, 4
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x2c]
mov esi, ecx
push ecx
push eax
lea ecx, [esp + 0x18]
call fcn.00412d40
cmp eax, esi
jne 0x47a874
mov eax, dword [ebx + 0x14b8]
inc edi
cmp edi, eax
mov dword [esp + 0x20], edi
jne 0x47a73e
mov eax, 0xba2e8ba3
mov dword [esp + 0x1c], 0
mul dword [esp + 0x2c]
mov eax, dword [esp + 0x28]
shr edx, 5
lea ecx, [edx + edx*4]
lea edx, [edx + ecx*2]
lea ecx, [esp + 0x10]
test ecx, ecx
lea edi, [eax + edx*4 - 0x2c]
je 0x47a73e
test edi, edi
je 0x47a73e
mov eax, dword [edi]
mov ecx, dword [0x596208]
lea edx, [esp + 0x1c]
add eax, 0x3c
push edx
push 0
push eax
push 1
push ebp
call fcn.00476a00
mov esi, eax
test esi, esi
je 0x47a73e
mov eax, dword [esp + 0x1c]
test eax, eax
jle 0x47a735
mov ecx, dword [edi]
mov edx, dword [esi]
cmp ecx, edx
jne 0x47a721
lea edx, [eax + eax*4]
lea eax, [eax + edx*2]
lea edx, [esi + 0x2c]
lea ecx, [eax*4 - 1]
push ecx
push edx
jmp 0x47a72c
lea ecx, [eax + eax*4]
lea edx, [eax + ecx*2]
shl edx, 2
push edx
push esi
lea ecx, [esp + 0x18]
call fcn.00412d40
push esi
call fcn.004c2eb0
add esp, 4
mov eax, dword [esp + 0xd6c]
push 0
push 0x8aa4
push 0x111
push eax
call dword [sym.imp.USER32.dll_PostMessageA]
mov edi, dword [esp + 0x20]
mov eax, dword [ebx + 0x14b8]
cmp edi, eax
jl 0x47a586
xor esi, esi
mov eax, dword [esp + 0x14]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp eax, 0xffffffff
je 0x47a786
push eax
call ebx
mov dword [esp + 0x14], 0xffffffff
mov ecx, 0xc1
xor eax, eax
lea edi, [esp + 0x2d4]
mov word [esp + 0x2d0], si
rep stosd dword es:[edi], eax
lea edx, [esp + 0x2d0]
mov ecx, 0x593d48
push edx
mov dword [esp + 0x1c], esi
call fcn.0042f040
lea eax, [esp + 0x2ec]
push ebp
push eax
push 0x5965b8
push str._shistory_s_s1.hst
lea ecx, [esp + 0x1dc]
push 0x103
push ecx
call dword [sym.imp.MSVCRT.dll__snprintf]
add esp, 0x18
lea edx, [esp + 0x1cc]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea eax, [esp + 0x1cc]
lea ecx, [esp + 0xc8]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_MoveFileA]
mov ecx, dword [0x596208]
push 1
push ebp
call fcn.00475fb0
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], 0x56b730
cmp eax, 0xffffffff
je 0x47a82b
push eax
call ebx
mov dword [esp + 0x14], 0xffffffff
lea ecx, [esp + 0x24]
mov dword [esp + 0x18], esi
call fcn.004b96b0
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xd58
ret 8
mov eax, dword [esp + 0x14]
mov dword [esp + 0x10], 0x56b730
cmp eax, 0xffffffff
je 0x47a86a
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x14], 0xffffffff
mov dword [esp + 0x18], 0
jmp 0x47a8d3
mov eax, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
or edi, 0xffffffff
cmp eax, edi
je 0x47a88c
push eax
call esi
mov dword [esp + 0x14], edi
lea ecx, [esp + 0xc8]
xor ebx, ebx
push ecx
push str.HistoryCenter:__s_write_failed
push 1
push 0x596558
mov dword [esp + 0x28], ebx
call fcn.004aa400
mov eax, dword [esp + 0x24]
add esp, 0x10
cmp eax, edi
mov dword [esp + 0x10], 0x56b730
je 0x47a8c5
push eax
call esi
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], ebx
jmp 0x47a8d3
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], esi
lea ecx, [esp + 0x24]
call fcn.004b96b0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xd58
ret 8