Function at 0x100022fe
Capabilities:
Clear file content
Enumerate pe sections
Get file size
Parse pe header
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1818
call sub.ntdll.dll__chkstk
push ecx
push ecx
lea eax, [ebp - 0x818]
push eax
mov dword [ebp - 0xc], ecx
push ecx
mov ecx, dword [ebp + 8]
lea edx, [ebp - 0x1818]
call fcn.10006ce6
mov edx, str.setup
lea ecx, [ebp - 0x818]
call fcn.10006920
test eax, eax
jne 0x10002366
mov edx, str.install
lea ecx, [ebp - 0x818]
call fcn.10006920
test eax, eax
jne 0x10002366
mov edx, str.update
lea ecx, [ebp - 0x818]
call fcn.10006920
test eax, eax
je 0x10002594
push ebx
push edi
xor ebx, ebx
push ebx
push 0x8000000
push 3
push ebx
push 1
push 0x80000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x10002592
push esi
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov ecx, ebx
call fcn.10006b40
push 0
mov esi, eax
lea eax, [ebp - 0x18]
push eax
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100023ba
cmp dword [ebp - 0x18], ebx
je 0x100023c5
mov ecx, esi
call fcn.10006b50
xor esi, esi
xor ebx, ebx
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
je 0x10002591
mov eax, 0x5a4d
xor edi, edi
xor edx, edx
cmp word [esi], ax
jne 0x1000242b
mov ecx, dword [esi + 0x3c]
add ecx, esi
cmp dword [ecx], 0x4550
jne 0x1000242b
movzx edx, word [ecx + 0x14]
movzx eax, word [ecx + 6]
and dword [ebp + 8], edi
add edx, 0x18
add edx, ecx
mov dword [ebp - 4], eax
test eax, eax
je 0x10002428
mov eax, dword [edx + 0x24]
and eax, 0x60000020
cmp eax, 0x60000020
je 0x10002426
mov eax, dword [ebp + 8]
inc eax
add edx, 0x28
mov dword [ebp + 8], eax
cmp eax, dword [ebp - 4]
jb 0x10002406
jmp 0x10002428
mov edi, edx
mov edx, dword [ecx + 0x28]
and dword [ebp + 8], 0
xor ecx, ecx
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx + 0x3c]
add eax, ecx
mov dword [ebp - 4], eax
movzx eax, word [eax + 0x14]
mov ecx, dword [ebp - 4]
add eax, 0x18
add eax, ecx
movzx ecx, word [ecx + 6]
mov dword [ebp - 8], ecx
test ecx, ecx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x10], eax
je 0x10002487
mov eax, dword [eax + 0x24]
and eax, 0x60000020
cmp eax, 0x60000020
je 0x10002484
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 8]
inc dword [ebp + 8]
add eax, 0x28
cmp dword [ebp + 8], ecx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x10], eax
jb 0x1000245c
jmp 0x10002487
mov ecx, dword [ebp - 0x10]
test edi, edi
je 0x1000258a
test ecx, ecx
je 0x1000258a
mov eax, dword [edi + 0x10]
cmp eax, dword [ecx + 0x10]
jne 0x100024b3
mov eax, dword [ebp - 4]
sub edx, dword [edi + 0xc]
mov eax, dword [eax + 0x28]
sub eax, dword [ecx + 0xc]
cmp edx, eax
je 0x1000258a
mov edi, dword [ebp - 0xc]
lea eax, [ebp - 0xc]
push dword [edi + 4]
mov edx, ebx
push eax
lea eax, [ebp - 4]
push eax
mov ecx, esi
call fcn.10003b1e
mov edx, dword [edi + 4]
lea eax, [ebp - 8]
push eax
lea eax, [ebp + 8]
push eax
push ecx
push esi
push dword [ebp - 0xc]
push dword [ebp - 4]
push ecx
push dword [ebp + 0xc]
mov ecx, dword [edi]
call fcn.10005908
test eax, eax
je 0x10002582
lea edx, [ebp - 0x1818]
lea ecx, [ebp - 0x1018]
call fcn.100068b0
mov edx, 0x10007314
lea ecx, [ebp - 0x1018]
call fcn.100068e0
lea edx, [ebp - 0x818]
lea ecx, [ebp - 0x1018]
call fcn.100068e0
mov edx, str..exe
lea ecx, [ebp - 0x1018]
call fcn.100068e0
xor ebx, ebx
push ebx
push 0x80
push 4
push ebx
push ebx
push 0x40000000
lea eax, [ebp - 0x1018]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x1000257a
push ebx
lea eax, [ebp + 0xc]
push eax
push dword [ebp - 8]
mov dword [ebp + 0xc], ebx
push dword [ebp + 8]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp + 8]
call fcn.10006b50
mov ecx, dword [ebp - 4]
call fcn.10006b50
mov ecx, esi
call fcn.10006b50
pop esi
pop edi
pop ebx
leave
ret 0xc