Function at 0x409570
Capabilities:
Delete file
Move file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
mov edi, dword [ebp + 0x1c]
xorps xmm0, xmm0
mov esi, edx
mov dword [ebp - 8], ecx
movq qword [ebp - 0x10], xmm0
mov dword [ebp - 4], 1
cmp byte [edi], 0
jne 0x4095be
push str.MsDelta.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [esi], eax
mov byte [edi], 1
mov eax, dword [esi]
test eax, eax
je 0x4095be
push str.ApplyDeltaW
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
jmp 0x4095c1
mov ecx, dword [ebp + 8]
cmp dword [ecx], 0
jne 0x4095d7
push 1
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 0x18]
mov ebx, dword [ebp + 0xc]
mov esi, dword [ebp + 0x10]
movzx eax, word [edi]
add eax, eax
push eax
push dword [ebx]
push dword [esi]
call fcn.0043c9e0
movzx eax, word [edi]
add esp, 0xc
add eax, eax
push eax
mov eax, dword [ebp + 0x14]
push dword [ebx]
push dword [eax]
call fcn.0043c9e0
mov edx, dword [ebx]
lea ecx, [ebp - 0x10]
add esp, 0xc
add edx, 8
call fcn.00406000
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov edi, dword [ebp - 0x10]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
test edi, edi
je 0x409841
mov ebx, dword [ebp - 0xc]
add ebx, 0xe
mov dword [ebp + 0x1c], edi
mov eax, dword [ebp - 8]
push 0
push 1
push dword [ebx + 2]
mov eax, dword [eax + 4]
push 2
push eax
mov ecx, dword [eax]
call dword [ecx + 0x28]
mov ecx, dword [ebp - 8]
mov dword [ecx], eax
movzx eax, word [ebx - 2]
lea eax, [eax*2 + 2]
push eax
mov eax, dword [ebp + 0x18]
push dword [ebx + 2]
movzx ecx, word [eax]
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
lea eax, [eax + ecx*2]
push eax
call fcn.0043c9e0
movzx eax, word [ebx]
add esp, 0xc
lea eax, [eax*2 + 2]
push eax
mov eax, dword [ebp + 0x18]
push dword [ebx + 0xa]
movzx ecx, word [eax]
mov eax, dword [esi]
lea eax, [eax + ecx*2]
push eax
call fcn.0043c9e0
mov eax, dword [ebx + 6]
add esp, 0xc
movzx ecx, word [eax]
cmp ecx, 0x52
je 0x4096ac
cmp ecx, 0x72
jne 0x40975e
cmp word [eax + 2], 0x41
jne 0x40975e
movzx ecx, word [eax + 4]
cmp ecx, 0x57
je 0x4096c9
cmp ecx, 0x77
jne 0x40975e
cmp word [eax + 6], 0
jne 0x40975e
movzx eax, word [ebx - 2]
cmp ax, word [ebx]
jne 0x409747
mov edx, dword [ebx + 2]
mov esi, eax
mov eax, dword [ebx + 0xa]
add esi, esi
sub esi, 4
jb 0x409701
nop dword [eax]
mov ecx, dword [edx]
cmp ecx, dword [eax]
jne 0x40970a
add edx, 4
add eax, 4
sub esi, 4
jae 0x4096f0
cmp esi, 0xfffffffc
je 0x4097f7
mov cl, byte [edx]
cmp cl, byte [eax]
jne 0x409747
cmp esi, 0xfffffffd
je 0x4097f7
mov cl, byte [edx + 1]
cmp cl, byte [eax + 1]
jne 0x409747
cmp esi, 0xfffffffe
je 0x4097f7
mov cl, byte [edx + 2]
cmp cl, byte [eax + 2]
jne 0x409747
cmp esi, 0xffffffff
je 0x4097f7
mov cl, byte [edx + 3]
cmp cl, byte [eax + 3]
je 0x4097f7
mov eax, dword [ebp + 0xc]
push 1
push dword [eax]
mov eax, dword [ebp + 0x10]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
jmp 0x4097ec
mov edx, dword [ebx - 0xa]
test edx, edx
je 0x409780
mov ecx, dword [ebp - 0xc]
xor eax, eax
nop word [eax + eax]
cmp dword [ecx], edx
je 0x409858
inc eax
add ecx, 0x28
cmp eax, edi
jb 0x409770
xor esi, esi
mov eax, dword [ebp + 0xc]
push dword [eax]
mov eax, dword [ebp + 0x10]
push dword [eax]
mov eax, dword [ebp + 8]
push esi
push 0
push 0
mov eax, dword [eax]
call eax
mov dword [ebp - 4], eax
test eax, eax
jne 0x4097ec
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 3
jne 0x4097ec
mov eax, dword [ebp + 0x18]
movzx edx, word [ebx - 2]
add dx, word [eax]
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax]
call fcn.00405eb0
mov eax, dword [ebp + 0xc]
push dword [eax]
mov eax, dword [ebp + 0x10]
push dword [eax]
mov eax, dword [ebp + 8]
push esi
push 0
push 0
mov eax, dword [eax]
call eax
mov dword [ebp - 4], eax
mov edx, 0x5c
mov eax, dword [ebp + 0x18]
movzx ecx, word [eax]
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov word [eax + ecx*2 - 2], dx
mov eax, dword [ebp + 0x10]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
mov esi, dword [ebp + 0x10]
add ebx, 0x28
sub dword [ebp + 0x1c], 1
jne 0x409636
mov esi, dword [ebp - 0xc]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
add esi, 0x14
push dword [esi - 4]
push 0
push dword [0x45764c]
call ebx
push dword [esi]
push 0
push dword [0x45764c]
call ebx
push dword [esi + 4]
push 0
push dword [0x45764c]
call ebx
lea esi, [esi + 0x28]
sub edi, 1
jne 0x409813
push dword [ebp - 0xc]
push 0
push dword [0x45764c]
call ebx
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
movzx eax, word [ecx + 0xc]
mov esi, dword [ebp + 0x14]
lea eax, [eax*2 + 2]
push eax
mov eax, dword [ebp + 0x18]
push dword [ecx + 0x10]
movzx ecx, word [eax]
mov eax, dword [esi]
lea eax, [eax + ecx*2]
push eax
call fcn.0043c9e0
mov esi, dword [esi]
add esp, 0xc
jmp 0x409782