Function at 0x40bda0
Capabilities:
Check if file exists
Create directory
Delete file
Generate random numbers via winapi
Get file attributes
Move file

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x888
mov eax, dword [0x499100]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x888], eax
mov dword [ebp - 0x880], edi
cmp byte [edi + 0xd5], 0
lea esi, [edi + 0x18]
mov dword [ebp - 0x87c], esi
mov eax, esi
je 0x40bdf4
cmp dword [esi + 0x14], 8
lea ebx, [esi + 0x14]
mov dword [ebp - 0x884], ebx
jb 0x40bded
mov eax, dword [esi]
mov ecx, 0x487b00
jmp 0x40be0a
cmp dword [eax + 0x14], 8
lea ebx, [eax + 0x14]
mov dword [ebp - 0x884], ebx
jb 0x40be05
mov eax, dword [eax]
mov ecx, str.Installing__s...
push eax
push ecx
call fcn.00408df0
add esp, 8
mov eax, esi
cmp dword [ebx], 8
jb 0x40be1d
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40c2b2
cmp dword [ebx], 8
mov edi, esi
jb 0x40be36
mov edi, dword [esi]
lea ecx, [ebp - 0x66c]
mov edx, 0x104
mov eax, ecx
sub edi, eax
lea eax, [edx + 0x7ffffefa]
test eax, eax
je 0x40be63
movzx eax, word [edi + ecx]
test ax, ax
je 0x40be63
mov word [ecx], ax
add ecx, 2
sub edx, 1
jne 0x40be45
lea eax, [ecx - 2]
test edx, edx
push 0x2f
cmovne eax, ecx
xor ecx, ecx
mov word [eax], cx
lea eax, [ebp - 0x66c]
push eax
call fcn.0046bedb
add esp, 8
test eax, eax
je 0x40be8f
xor ecx, ecx
mov word [eax], cx
add eax, 2
jmp 0x40be95
lea eax, [ebp - 0x66c]
cmp dword [ebx], 8
mov edi, esi
mov dword [ebp - 0x87c], eax
jb 0x40bea4
mov edi, dword [esi]
lea ecx, [ebp - 0x464]
mov edx, 0x104
mov eax, ecx
sub edi, eax
lea eax, [edx + 0x7ffffefa]
test eax, eax
je 0x40bed1
movzx eax, word [edi + ecx]
test ax, ax
je 0x40bed1
mov word [ecx], ax
add ecx, 2
sub edx, 1
jne 0x40beb3
lea eax, [ecx - 2]
test edx, edx
push str..old
cmovne eax, ecx
xor ecx, ecx
push 0x208
mov word [eax], cx
lea eax, [ebp - 0x464]
push eax
call fcn.00408e70
cmp dword [ebx], 8
mov eax, esi
jb 0x40befd
mov eax, dword [esi]
lea ecx, [ebp - 0x464]
push ecx
push eax
call fcn.00407eb0
add esp, 8
test al, al
jne 0x40bf6d
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x20
jne 0x40bf44
push dword [ebp - 0x87c]
push str.Update_failed:__s_is_still_in_use.__Close_all_programs_and_try_again.
call fcn.00408df0
add esp, 8
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ae1f
mov esp, ebp
pop ebp
ret
call esi
push eax
push dword [ebp - 0x87c]
push str.Update_failed:_Couldnt_backup__s__error__d_
call fcn.00408df0
add esp, 0xc
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ae1f
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x464]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40bf76
mov edi, dword [ebp - 0x880]
lea eax, [ebp - 0x464]
sub ecx, edx
sar ecx, 1
push ecx
push eax
lea ecx, [edi + 0x48]
call fcn.0040ff90
mov byte [ebp - 0x876], 0
nop dword [eax]
nop word [eax + eax]
cmp byte [edi + 0xd5], 0
mov ecx, esi
je 0x40c041
cmp dword [ebx], 8
jb 0x40bfc6
mov ecx, dword [esi]
cmp dword [edi + 0x44], 8
lea eax, [edi + 0x30]
jb 0x40bfd1
mov eax, dword [eax]
push ecx
push eax
push dword [ebp - 0x888]
call fcn.00411010
mov ebx, eax
add esp, 0xc
test ebx, ebx
sete al
mov byte [ebp - 0x875], al
test ebx, ebx
jne 0x40c071
mov ecx, dword [ebp - 0x884]
mov eax, esi
cmp dword [ecx], 8
jb 0x40c001
mov eax, dword [esi]
lea ecx, [ebp - 0x18]
push ecx
push eax
call fcn.00412570
add esp, 8
test al, al
je 0x40c1f9
lea ecx, [edi + 0x94]
mov edi, 0x10
lea edx, [ebp - 0x18]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x40c1c3
add ecx, 4
add edx, 4
sub edi, 4
jae 0x40c024
mov edi, dword [ebp - 0x880]
jmp 0x40c06b
cmp dword [ebx], 8
jb 0x40c048
mov ecx, dword [esi]
cmp dword [edi + 0x44], 8
lea eax, [edi + 0x30]
jb 0x40c053
mov eax, dword [eax]
push ecx
push eax
call fcn.00407eb0
add esp, 8
mov byte [ebp - 0x875], al
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov al, byte [ebp - 0x875]
test al, al
jne 0x40c3a8
cmp ebx, 0x20
jne 0x40c270
cmp byte [ebp - 0x876], al
jne 0x40c23a
lea eax, [ebp - 0x54]
mov byte [ebp - 0x876], 1
push eax
push 0x28
push dword [0x49b5dc]
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
push 0
push 0
push 0x28
lea eax, [ebp - 0x54]
push eax
lea eax, [ebp - 0x2c]
push 0x14
push eax
call fcn.00418570
lea eax, [ebp - 0x874]
push eax
lea eax, [ebp - 0x2c]
push eax
call fcn.00412740
mov ebx, dword [ebp - 0x884]
xor eax, eax
add esp, 0x20
mov word [ebp - 0x864], ax
mov edi, esi
cmp dword [ebx], 8
jb 0x40c0e7
mov edi, dword [esi]
lea ecx, [ebp - 0x25c]
mov edx, 0x104
mov eax, ecx
sub edi, eax
lea eax, [edx + 0x7ffffefa]
test eax, eax
je 0x40c114
movzx eax, word [edi + ecx]
test ax, ax
je 0x40c114
mov word [ecx], ax
add ecx, 2
sub edx, 1
jne 0x40c0f6
lea eax, [ecx - 2]
test edx, edx
push 0x487ac0
cmovne eax, ecx
xor ecx, ecx
push 0x208
mov word [eax], cx
lea eax, [ebp - 0x25c]
push eax
call fcn.00408e70
lea eax, [ebp - 0x874]
push eax
push 0x208
lea eax, [ebp - 0x25c]
push eax
call fcn.00408e70
push 0x487ac4
push 0x208
lea eax, [ebp - 0x25c]
push eax
call fcn.00408e70
cmp dword [ebx], 8
mov eax, esi
jb 0x40c16e
mov eax, dword [esi]
mov edi, dword [sym.imp.KERNEL32.dll_MoveFileW]
lea ecx, [ebp - 0x25c]
push ecx
push eax
call edi
test eax, eax
je 0x40c23a
cmp dword [ebx], 8
mov eax, esi
jb 0x40c18f
mov eax, dword [esi]
push eax
lea eax, [ebp - 0x25c]
push eax
call fcn.00407eb0
add esp, 8
test al, al
je 0x40c229
push 4
push 0
lea eax, [ebp - 0x25c]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExW]
mov edi, dword [ebp - 0x880]
jmp 0x40bfb0
push dword [ebp - 0x87c]
push str.Update_failed:_Integrity_check_of_patched__s_failed
call fcn.00408df0
mov edi, dword [ebp - 0x880]
add esp, 8
xor al, al
mov dword [edi + 0xd0], 5
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ae1f
mov esp, ebp
pop ebp
ret
push dword [ebp - 0x87c]
push str.Update_failed:_Couldnt_verify_integrity_of_patched__s
call fcn.00408df0
add esp, 8
mov dword [edi + 0xd0], 5
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ae1f
mov esp, ebp
pop ebp
ret
cmp dword [ebx], 8
jb 0x40c230
mov esi, dword [esi]
push esi
lea eax, [ebp - 0x25c]
push eax
call edi
push dword [ebp - 0x87c]
push str.Update_failed:__s_is_still_in_use.__Close_all_programs_and_try_again.
call fcn.00408df0
mov edi, dword [ebp - 0x880]
add esp, 8
xor al, al
mov dword [edi + 0xd0], 5
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ae1f
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
cmovne ebx, eax
push ebx
push dword [ebp - 0x87c]
push str.Update_failed:_Couldnt_update__s__error__d_
call fcn.00408df0
mov edi, dword [ebp - 0x880]
add esp, 0xc
xor al, al
mov dword [edi + 0xd0], 5
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ae1f
mov esp, ebp
pop ebp
ret
cmp byte [edi + 0xd5], 0
je 0x40c2e3
cmp dword [ebx], 8
jb 0x40c2c2
mov esi, dword [esi]
push esi
push str.Update_failed:_Source_file__s_not_found
call fcn.00408df0
add esp, 8
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ae1f
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x884]
mov ebx, esi
cmp dword [ecx], 8
jb 0x40c2f2
mov ebx, dword [esi]
movzx eax, word [ebx]
mov edi, ebx
test ax, ax
je 0x40c332
mov ecx, eax
mov esi, 0x5c
cmp cx, si
je 0x40c30e
cmp cx, 0x2f
jne 0x40c31e
xor eax, eax
push eax
push ebx
mov word [edi], ax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov word [edi], si
movzx eax, word [edi + 2]
add edi, 2
mov ecx, eax
test ax, ax
jne 0x40c303
mov esi, dword [ebp - 0x87c]
mov edi, dword [ebp - 0x880]
push 0
push 0x487364
lea ecx, [edi + 0x48]
call fcn.0040ff90
mov ebx, dword [ebp - 0x884]
mov ecx, esi
cmp dword [ebx], 8
jb 0x40c356
mov ecx, dword [esi]
cmp dword [edi + 0x44], 8
lea eax, [edi + 0x30]
jb 0x40c361
mov eax, dword [eax]
push ecx
push eax
call fcn.00407eb0
add esp, 8
test al, al
jne 0x40c3a8
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebx], 8
jb 0x40c37c
mov esi, dword [esi]
push eax
push esi
push str.Update_failed:_Couldnt_install__s__error__d_
call fcn.00408df0
add esp, 0xc
mov dword [edi + 0xd0], 5
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046ae1f
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov al, 1
mov dword [edi + 0xd0], 6
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0046ae1f
mov esp, ebp
pop ebp
ret