Function at 0x10049370
Capabilities:
Check if file exists
Delete file
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1006cb6d
mov eax, dword fs:[0]
push eax
sub esp, 0x44
push ebx
push esi
push edi
mov eax, dword [0x100ad040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x40], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 4], 0
lea eax, [ebp - 0x10]
mov edi, dword [ebp + 8]
xor ebx, ebx
push eax
push 0x10093cf4
push 0x1009666c
mov dword [ebp - 0x3c], ebx
push edi
mov dword [ebp - 0x40], ebx
mov dword [ebp - 0x10], ebx
call dword [sym.imp.msi.dll_MsiGetSummaryInformationW]
lea edx, [ebx + 2]
cmp eax, 0xea
jne 0x10049410
mov esi, dword [ebp - 0x10]
xor ecx, ecx
inc esi
mov eax, esi
mov dword [ebp - 0x10], esi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ebx, eax
lea eax, [ebp - 0x10]
push eax
push ebx
push 0x1009666c
mov dword [ebp - 0x3c], ebx
push edi
mov dword [ebp - 0x40], esi
call dword [sym.imp.msi.dll_MsiGetSummaryInformationW]
mov edi, dword [ebp - 0x3c]
movzx ebx, word [ebx]
add edi, 2
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x10], edi
movzx eax, word [edi]
test ax, ax
jne 0x1004942b
xor edx, edx
jmp 0x10049452
mov ecx, edi
mov edx, eax
nop
cmp dx, bx
je 0x10049445
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x10049430
xor ecx, ecx
mov edx, edi
xor eax, eax
lea edi, [ecx + 2]
mov word [ecx], ax
mov dword [ebp - 0x10], edi
xor ecx, ecx
mov dword [ebp - 0x24], edx
mov eax, edx
mov dword [ebp - 0x20], ecx
cmp word [edx], cx
je 0x1004946e
lea eax, [eax + 2]
inc ecx
cmp word [eax], 0
jne 0x10049461
mov dword [ebp - 0x20], ecx
movzx eax, word [edi]
test ax, ax
jne 0x10049493
push 0xa
lea edx, [ebp - 0x14]
mov dword [ebp - 0x14], 0xffffffff
xor ecx, ecx
call fcn.1002dc60
add esp, 4
mov dword [ebp - 0x18], eax
xor esi, esi
jmp 0x10049501
mov edx, edi
mov ecx, eax
cmp cx, bx
je 0x100494ac
movzx eax, word [edx + 2]
add edx, 2
mov ecx, eax
test ax, ax
jne 0x10049497
xor edx, edx
xor eax, eax
mov dword [ebp - 0x14], 0xffffffff
mov word [edx], ax
mov ecx, edi
movzx esi, word [edx + 2]
lea edi, [edx + 2]
push 0xa
lea edx, [ebp - 0x14]
mov dword [ebp - 0x10], edi
call fcn.1002dc60
add esp, 4
mov dword [ebp - 0x18], eax
test si, si
jne 0x100494dd
xor esi, esi
jmp 0x10049501
mov ecx, esi
mov esi, edi
cmp cx, bx
je 0x100494f6
movzx eax, word [edi + 2]
add edi, 2
mov ecx, eax
test ax, ax
jne 0x100494e1
xor edi, edi
xor eax, eax
mov word [edi], ax
add edi, 2
mov dword [ebp - 0x10], edi
push 0xa
lea edx, [ebp - 0x2c]
mov dword [ebp - 0x2c], 0xffffffff
mov ecx, esi
call fcn.1002dc60
add esp, 4
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x4c], 0
mov byte [ebp - 4], 1
push 0x19000
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ebx, eax
mov dword [ebp - 0x50], 0x19000
movzx eax, word [edi]
mov dword [ebp - 0x4c], ebx
test ax, ax
je 0x1004973f
mov esi, dword [ebp - 0x28]
mov ecx, edi
mov edx, eax
cmp dx, si
je 0x1004956d
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x10049558
xor ecx, ecx
xor eax, eax
mov word [ecx], ax
lea eax, [ecx + 2]
mov dword [ebp - 0x2c], eax
test edi, edi
je 0x1004973f
xor esi, esi
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x44], esi
mov byte [ebp - 4], 2
sub eax, edi
mov edi, dword [ebp - 0x20]
xor ecx, ecx
sar eax, 1
add edi, 3
add edi, eax
mov edx, 2
mov eax, edi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x48], edi
mov edi, eax
mov dword [ebp - 0x44], eax
mov ecx, edi
cmp word [edi], si
je 0x100495cb
add ecx, 2
cmp word [ecx], 0
jne 0x100495c2
mov edx, dword [ebp - 0x10]
push 0xffffffffffffffff
call fcn.10013e00
mov ecx, dword [ebp - 0x18]
add esp, 4
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x24]
xor ecx, ecx
mov word [eax], cx
mov ecx, eax
push 0xffffffffffffffff
call fcn.10013e00
mov ecx, dword [ebp - 0x14]
add esp, 4
mov edx, eax
call fcn.100286f0
mov eax, dword [ebp - 0x18]
cmp dword [ebp - 0x14], eax
jne 0x1004965e
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmp eax, 1
jne 0x100496e0
push 0
push 0x80
push 3
push 0
push eax
push 0x40000000
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x1004963c
xor esi, esi
jmp 0x1004965e
push 0
push 0
push dword [ebp - 0x30]
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 2
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x100496dd
push 0
lea eax, [ebp - 0x1c]
push eax
push 0x19000
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x100496c1
push 0
lea ecx, [ebp - 0x38]
push ecx
push eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x1c]
push eax
push 0x19000
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x1c]
test eax, eax
jne 0x10049698
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edi, dword [ebp - 0x44]
push edi
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x34]
jmp 0x100495e1
mov edi, dword [ebp - 0x44]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 4], 1
test edi, edi
je 0x100496f6
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov edi, dword [ebp - 0x2c]
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x48], 0
movzx eax, word [edi]
test ax, ax
je 0x1004973f
mov ecx, edi
mov edx, eax
cmp dx, word [ebp - 0x28]
je 0x10049729
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x10049713
xor ecx, ecx
xor eax, eax
mov dword [ebp - 0x10], edi
mov word [ecx], ax
lea eax, [ecx + 2]
mov dword [ebp - 0x2c], eax
test edi, edi
jne 0x10049580
mov byte [ebp - 4], 0
test ebx, ebx
je 0x1004974e
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 4], 0xffffffff
push dword [ebp - 0x3c]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x3c], 0
xor eax, eax
mov dword [ebp - 0x40], 0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4