Function at 0x422851
Capabilities:
Check if file exists
Create directory
Delete file
Get file attributes

Disassembly:
push 0x24
mov eax, 0x4afc70
call fcn.0046c338
mov esi, ecx
mov dword [ebp - 0x30], esi
push str.DownloadArmUpdate...
lea ecx, [ebp - 0x24]
call fcn.00402829
and dword [ebp - 4], 0
lea edx, [ebp - 0x24]
push 0
push 2
pop ecx
call fcn.004174d1
or dword [ebp - 4], 0xffffffff
pop ecx
mov ecx, dword [ebp - 0x24]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov edi, dword [0x518f88]
xor ebx, ebx
test edi, edi
je 0x422e95
inc ebx
cmp dword [edi + 0x1c], ebx
je 0x4228e0
push str.not_supported_self_update_type
lea ecx, [ebp - 0x24]
call fcn.00402829
push 0
push 2
lea edx, [ebp - 0x24]
mov dword [ebp - 4], ebx
pop ecx
call fcn.004174d1
pop ecx
mov ecx, dword [ebp - 0x24]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov ecx, 0x518f84
call fcn.00440248
xor eax, eax
jmp 0x422e97
mov eax, dword [esi + 0x28]
sub eax, 0x10
push eax
call fcn.00402d9f
add eax, 0x10
pop ecx
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x14]
mov dword [ebp - 4], 2
push eax
mov ecx, esi
call fcn.0042177f
mov ebx, eax
test ebx, ebx
je 0x42291e
cmp dword [edi + 0x18], 0
je 0x42291e
mov ecx, dword [edi + 8]
cmp dword [ecx - 0xc], 0
jne 0x422b2c
mov eax, dword [edi + 4]
lea ecx, [ebp - 0x14]
push dword [eax - 0xc]
push eax
call fcn.004025c6
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x422944
lea eax, [ebp - 0x14]
push eax
jmp 0x422b24
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
test eax, eax
jne 0x422b20
call dword [sym.imp.KERNEL32.dll_GetLastError]
push str.failed_to_delete_existing_ARM_update_file
lea ecx, [ebp - 0x18]
mov esi, eax
call fcn.00402829
push esi
push 2
lea edx, [ebp - 0x18]
mov byte [ebp - 4], 3
pop ecx
call fcn.004174d1
pop ecx
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x18]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov eax, dword [ebp - 0x30]
add eax, 0x28
push 0x4ecda4
push eax
lea eax, [ebp - 0x24]
push eax
call fcn.00402459
add esp, 0xc
push 0
mov byte [ebp - 4], 4
call fcn.0048ab6e
pop ecx
push eax
call fcn.0048aad9
pop ecx
call fcn.0048aab8
mov esi, eax
call fcn.004524e1
push eax
lea ecx, [ebp - 0x18]
call fcn.00402899
push esi
mov byte [ebp - 4], 5
lea eax, [ebp - 0x18]
push dword [ebp - 0x24]
push str._s_d
push eax
call fcn.004027d2
add esp, 0x10
push 0
push dword [ebp - 0x18]
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
mov esi, eax
cmp esi, 0xa1
je 0x422aa6
cmp esi, 3
je 0x422aa6
lea eax, [edi + 4]
push eax
lea eax, [ebp - 0x2c]
push 0x4d0aa0
push eax
call fcn.004023f1
add esp, 0xc
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x18]
mov eax, dword [eax]
push dword [eax - 0xc]
push eax
call fcn.004025c6
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00402e64
push str.Will_attempt_self_update_download:
lea ecx, [ebp - 0x2c]
call fcn.00402829
push esi
lea eax, [ebp - 0x18]
mov byte [ebp - 4], 8
push eax
push 2
lea edx, [ebp - 0x2c]
pop ecx
call fcn.00416da0
pop ecx
pop ecx
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00402e64
lea eax, [ebp - 0x18]
lea ecx, [edi + 8]
push eax
call fcn.00402e14
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x14]
call fcn.00402e14
mov ecx, dword [ebp - 0x18]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov byte [ebp - 4], 2
mov ecx, dword [ebp - 0x24]
lea ecx, [ecx - 0x10]
call fcn.00402e64
jmp 0x422b2c
push str.Dismissing_self_update__SHCreateDirectoryEx_failed:
lea ecx, [ebp - 0x2c]
call fcn.00402829
push esi
lea eax, [ebp - 0x18]
mov byte [ebp - 4], 6
push eax
push 2
lea edx, [ebp - 0x2c]
pop ecx
call fcn.00416da0
pop ecx
pop ecx
mov byte [ebp - 4], 5
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov ecx, 0x518f84
call fcn.00440248
lea eax, [ebp - 0xd]
mov byte [ebp - 0xd], 0
push eax
push esi
push str.Get_ARM_Payload
mov ecx, 0x518e58
call fcn.00409e80
mov ecx, dword [ebp - 0x18]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov ecx, dword [ebp - 0x24]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.00402e64
jmp 0x4228d9
lea ecx, [ebp - 0x14]
push ecx
lea ecx, [edi + 8]
call fcn.00402e14
mov eax, dword [edi + 0xc]
sub eax, 0x10
push eax
call fcn.00402d9f
add eax, 0x10
pop ecx
mov dword [ebp - 0x1c], eax
mov byte [ebp - 4], 9
test ebx, ebx
jne 0x422d27
mov dword [ebp - 0x24], 1
call fcn.004524e1
push eax
lea ecx, [ebp - 0x18]
call fcn.00402899
lea eax, [ebp - 0x2c]
mov byte [ebp - 4], 0xa
mov edx, dword [0x518e2c]
mov ecx, reloc.OLEAUT32.dll_SysReAllocString
and dword [ebp - 0x2c], ebx
push eax
lea eax, [ebp - 0x18]
push eax
push str.ARM_Update_3
call fcn.004443cf
mov esi, dword [ebp - 0x18]
add esp, 0xc
cmp dword [esi - 0xc], ebx
jne 0x422be5
mov edx, dword [0x518e2c]
lea eax, [ebp - 0x2c]
and dword [ebp - 0x2c], ebx
mov ecx, reloc.OLEAUT32.dll_SysReAllocString
push eax
lea eax, [ebp - 0x18]
push eax
push str.ARM_Update_2
call fcn.004443cf
mov esi, dword [ebp - 0x18]
add esp, 0xc
cmp dword [esi - 0xc], ebx
jne 0x422be5
mov edx, dword [0x518e2c]
lea eax, [ebp - 0x2c]
and dword [ebp - 0x2c], ebx
mov ecx, reloc.OLEAUT32.dll_SysReAllocString
push eax
lea eax, [ebp - 0x18]
push eax
push str.ARM_Update
call fcn.004443cf
mov esi, dword [ebp - 0x18]
add esp, 0xc
cmp dword [esi - 0xc], ebx
je 0x422c24
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x1c]
call fcn.00402e14
push str.ARM_update_redirected_to:
lea ecx, [ebp - 0x2c]
call fcn.00402829
push 0
lea eax, [ebp - 0x1c]
mov byte [ebp - 4], 0xb
push eax
push 2
lea edx, [ebp - 0x2c]
pop ecx
call fcn.00416da0
pop ecx
pop ecx
mov byte [ebp - 4], 0xa
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov edx, dword [ebp - 0x1c]
lea eax, [ebp - 0x24]
push 0x927c0
push eax
lea ecx, [ebp - 0x14]
call fcn.0041f2a0
pop ecx
pop ecx
cmp eax, 6
mov ecx, 0x518e58
lea eax, [ebp - 0xd]
push eax
jne 0x422d0a
xor ebx, ebx
push ebx
push str.BITS_ARM_Payload
mov byte [ebp - 0xd], bl
call fcn.00409e80
push str.download_BITs_success:
lea ecx, [ebp - 0x2c]
call fcn.00402829
push ebx
lea eax, [edi + 8]
mov byte [ebp - 4], 0xc
push eax
push 2
lea edx, [ebp - 0x2c]
pop ecx
call fcn.00416da0
pop ecx
pop ecx
mov byte [ebp - 4], 0xa
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00402e64
push dword [edi + 0x50]
mov edx, dword [edi + 0x14]
mov ecx, dword [ebp - 0x14]
call fcn.0042ef54
mov ebx, eax
mov byte [ebp - 0xd], 0
pop ecx
mov ecx, 0x518e58
test ebx, ebx
jne 0x422cc9
inc eax
mov dword [edi + 0x18], eax
mov ebx, eax
lea eax, [ebp - 0xd]
push eax
push 0
push str.SUCCESS_BITS
push str.Get_ARM_Payload
call fcn.00409e40
jmp 0x422d1b
lea eax, [ebp - 0xd]
push eax
push ebx
push str.Signature_Validation_Error
call fcn.00409e80
push str.invalid_after_BITs_download:
lea ecx, [ebp - 0x2c]
call fcn.00402829
push ebx
lea eax, [ebp - 0x14]
mov byte [ebp - 4], 0xd
push eax
push 2
lea edx, [ebp - 0x2c]
pop ecx
call fcn.00416da0
pop ecx
pop ecx
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00402e64
xor ebx, ebx
jmp 0x422d1b
push dword [ebp - 0x24]
mov byte [ebp - 0xd], 0
push str.BITS_ARM_Payload
call fcn.00409e80
lea ecx, [esi - 0x10]
mov byte [ebp - 4], 9
call fcn.00402e64
cmp dword [0x518f40], 0
jne 0x422e7f
test ebx, ebx
jne 0x422e7f
mov esi, dword [0x5193ec]
lea ecx, [ebp - 0x2c]
push str.WinINet_ARM_Payload
call fcn.00402829
mov byte [ebp - 4], 0xe
test esi, esi
je 0x422d5d
mov eax, dword [edi + 0x14]
cdq
jmp 0x422d6b
xorps xmm0, xmm0
movlpd qword [ebp - 0x28], xmm0
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x28]
lea ecx, [ebp - 0x2c]
push ecx
mov ecx, dword [ebp - 0x30]
push edx
push eax
xor eax, eax
test esi, esi
setne al
push eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.00425097
mov byte [ebp - 4], 9
mov ebx, eax
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00402e64
test ebx, ebx
je 0x422e50
push dword [edi + 0x50]
mov edx, dword [edi + 0x14]
mov ecx, dword [ebp - 0x14]
call fcn.0042ef54
mov esi, eax
pop ecx
test esi, esi
jne 0x422e0f
push str.valid_after_BB_download:
lea ecx, [ebp - 0x30]
mov dword [edi + 0x18], 1
call fcn.00402829
push esi
lea eax, [ebp - 0x14]
mov byte [ebp - 4], 0xf
push eax
push 2
lea edx, [ebp - 0x30]
pop ecx
call fcn.00416da0
pop ecx
pop ecx
mov byte [ebp - 4], 9
mov ecx, dword [ebp - 0x30]
lea ecx, [ecx - 0x10]
call fcn.00402e64
lea eax, [ebp - 0xd]
mov byte [ebp - 0xd], 0
push eax
push esi
push str.SUCCESS_WININET
push str.Get_ARM_Payload
mov ecx, 0x518e58
call fcn.00409e40
jmp 0x422e7f
lea eax, [ebp - 0xd]
xor ebx, ebx
push eax
push esi
push str.Signature_Validation_Error
mov ecx, 0x518e58
mov byte [ebp - 0xd], bl
call fcn.00409e80
push str.invalid_after_BB_download:
lea ecx, [ebp - 0x30]
call fcn.00402829
push esi
lea eax, [ebp - 0x14]
mov byte [ebp - 4], 0x10
push eax
push 2
lea edx, [ebp - 0x30]
pop ecx
call fcn.00416da0
pop ecx
pop ecx
mov ecx, dword [ebp - 0x30]
jmp 0x422e77
push str.BB_download_failed:
lea ecx, [ebp - 0x2c]
call fcn.00402829
push 0
lea eax, [ebp - 0x1c]
mov byte [ebp - 4], 0x11
push eax
push 2
lea edx, [ebp - 0x2c]
pop ecx
call fcn.00416da0
pop ecx
pop ecx
mov ecx, dword [ebp - 0x2c]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov ecx, dword [ebp - 0x1c]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx - 0x10]
call fcn.00402e64
mov eax, ebx
call fcn.0046c301
ret