Function at 0x40f6e0
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x228
mov eax, dword [0x42f560]
xor eax, esp
mov dword [esp + 0x224], eax
mov eax, dword [esp + 0x230]
push ebp
mov ebp, dword [esp + 0x230]
mov ecx, dword [ebp + 0x67c]
push esi
mov dword [esp + 0x24], ebp
mov dword [esp + 0x18], ecx
cmp eax, 4
jne 0x40f71f
mov esi, dword [ebp + 0x318]
jmp 0x40f72e
mov edx, eax
imul edx, edx, 0x354
lea esi, [edx + ebp + 0x69c]
push eax
lea edx, [esp + 0x30]
mov ecx, ebp
call fcn.0040fc20
add esp, 4
test eax, eax
jne 0x40f748
xor esi, esi
jmp 0x40fa1b
push edi
lea edi, [esp + 0x30]
add edi, 0xfffffffe
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x40f750
mov eax, dword [0x42b220]
mov dword [edi], eax
lea eax, [esi + 0x284]
mov dword [esp + 0x20], eax
mov edx, eax
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40f770
lea edi, [esp + 0x30]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x40f784
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
push 0
push 0x80
push 3
push 0
mov ecx, eax
and ecx, 3
push 3
rep movsb byte es:[edi], byte [esi]
push 0x80000000
lea ecx, [esp + 0x4c]
push ecx
call ebx
mov edi, eax
cmp edi, 0xffffffff
je 0x40fa17
test edi, edi
je 0x40fa17
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, dword [ebp + 0x670]
mov esi, eax
lea edx, [esi + 1]
push edx
add ebp, 0x50020
push 0
push ebp
call fcn.0041a140
add esp, 0xc
push 0
lea eax, [esp + 0x18]
push eax
push esi
push ebp
push edi
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40fa0a
cmp esi, dword [esp + 0x14]
jne 0x40fa0a
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
test eax, eax
je 0x40fa17
push 0
push 0x80
push 4
push 0
push 0
push 0x40000000
lea ecx, [esp + 0x4c]
push ecx
call ebx
mov ebx, eax
mov dword [esp + 0x1c], ebx
cmp ebx, 0xffffffff
je 0x40fa17
test ebx, ebx
je 0x40fa17
movzx eax, word [ebp]
xor edx, edx
lea esi, [ebp + esi*2]
mov dword [esp + 0x28], esi
mov dword [esp + 0x10], 0
cmp dx, ax
je 0x40f97a
jmp 0x40f890
mov ecx, 0x5b
cmp cx, ax
jne 0x40f950
mov dword [esp + 0x18], 0
mov edi, str._ProgramFilesFolder_
xor ebx, ebx
lea ecx, [ecx]
mov eax, dword [edi + 0x40]
push eax
push ebp
push edi
mov dword [esp + 0x3c], eax
call fcn.00419f8a
add esp, 0xc
test eax, eax
je 0x40f8e0
inc dword [esp + 0x18]
add ebx, 0x24c
add edi, 0x24c
cmp ebx, 0x14ac
jb 0x40f8b0
jmp 0x40f950
mov edx, dword [esp + 0x30]
lea ebp, [ebp + edx*2]
mov edx, dword [esp + 0x18]
mov eax, edx
imul eax, eax, 0x24c
add eax, 0x430550
movzx ecx, word [eax]
xor edi, edi
cmp di, cx
je 0x40f933
mov edi, 0x5c
cmp di, cx
jne 0x40f919
mov ecx, edi
mov word [esi], cx
add esi, 2
inc dword [esp + 0x10]
mov cx, word [eax]
inc dword [esp + 0x10]
add eax, 2
mov word [esi], cx
movzx ecx, word [eax]
xor edi, edi
add esi, 2
cmp di, cx
jne 0x40f903
add dword [esp + 0x10], 2
mov eax, 0x5c
mov word [esi], ax
add esi, 2
mov ecx, eax
mov word [esi], cx
add esi, 2
cmp edx, 9
jb 0x40f961
mov dx, word [ebp]
mov word [esi], dx
add esi, 2
add ebp, 2
inc dword [esp + 0x10]
movzx eax, word [ebp]
xor ecx, ecx
cmp cx, ax
jne 0x40f890
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [esp + 0x1c]
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0x28]
push 0
lea edx, [esp + 0x18]
push edx
add esi, esi
push esi
push eax
push ebx
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40fa03
cmp esi, dword [esp + 0x14]
jne 0x40fa03
push ebx
call edi
test eax, eax
je 0x40fa17
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x2c]
mov edi, dword [esp + 0x20]
mov ebx, dword [sym.imp.USER32.dll_wsprintfW]
push ecx
lea edx, [eax + 0x20c]
push edx
add eax, 0x10c
push eax
push 0x4317b0
add edi, 0xe20
push str._s_s_s_s
push edi
call ebx
push edi
call fcn.0040e230
mov esi, eax
add esp, 0x1c
test esi, esi
jne 0x40fa19
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.RegMergeFile_failed_to_merge_Registries___d_
push edi
call ebx
add esp, 0xc
jmp 0x40fa19
push ebx
xor esi, esi
call edi
jmp 0x40fa13
push edi
xor esi, esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x40fa19
xor esi, esi
pop ebx
pop edi
mov ecx, dword [esp + 0x22c]
mov eax, esi
pop esi
pop ebp
xor ecx, esp
call fcn.00416a72
add esp, 0x228
ret