Function at 0x401000
Capabilities:
Check if file exists
Create process on windows
Delete file
Get common file path
Get file size
Move file
Read file on windows
Write and execute a file
Write file on windows

Disassembly:
push ebp
sub esp, 0x308
lea ebp, [esp - 4]
mov eax, dword [0x413070]
xor eax, ebp
mov dword [ebp + 0x308], eax
push 0x84
mov eax, 0x40e090
call fcn.0040276e
mov eax, dword [ebp + 0x31c]
xor ebx, ebx
push 0x103
mov dword [ebp - 0x2c], eax
lea eax, [ebp + 1]
push ebx
push eax
mov byte [ebp], bl
call fcn.004027e0
add esp, 0xc
push 0x104
lea eax, [ebp]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x401063
or eax, 0xffffffff
jmp 0x4013de
push ebx
push 0x80
push 3
push ebx
push 3
push 0x81
lea eax, [ebp]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x10], eax
cmp eax, 0xffffffff
je 0x40105b
push 0xc
pop edi
push ebx
push eax
mov dword [ebp - 0x28], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x14], eax
cmp eax, edi
jbe 0x4010f7
mov dword [ebp - 0x20], 0xfffffff4
push 2
push ebx
push dword [ebp - 0x20]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x28]
push eax
push 4
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x10]
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x38], ebx
call esi
push ebx
lea eax, [ebp - 0x28]
push eax
push 4
lea eax, [ebp - 0x38]
push eax
push dword [ebp - 0x10]
call esi
cmp dword [ebp - 0x18], 0x4f4a4f4d
jne 0x4010ee
cmp dword [ebp - 0x38], 0x4f4a4f4a
je 0x4010f7
inc edi
dec dword [ebp - 0x20]
cmp edi, dword [ebp - 0x14]
jb 0x4010a7
push ebx
lea eax, [ebp - 0x28]
push eax
push 4
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x10]
mov dword [ebp - 0x1c], ebx
call esi
mov eax, dword [ebp - 0x1c]
lea ecx, [eax + edi]
cmp ecx, dword [ebp - 0x14]
ja 0x40105b
push eax
call fcn.004020c1
pop ecx
mov dword [ebp - 0x18], eax
cmp eax, ebx
je 0x4013b4
mov eax, dword [ebp - 0x1c]
push 2
add eax, edi
push ebx
neg eax
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x1c]
push dword [ebp - 0x18]
push dword [ebp - 0x10]
call esi
push dword [ebp - 0x10]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
lea eax, [ebp + 0x104]
push eax
push 0x104
mov dword [ebp - 0x10], ebx
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea eax, [ebp + 0x104]
push eax
call fcn.004022f0
pop ecx
lea ecx, [ebp + 0x104]
cmp byte [eax + ecx - 1], 0x5c
je 0x401198
mov eax, ecx
push 0x40f228
push eax
call fcn.00402200
pop ecx
pop ecx
push 0xff
lea eax, [ebp + 0x209]
push ebx
push eax
mov dword [ebp - 0x20], ebx
mov byte [ebp + 0x208], bl
call fcn.004027e0
add esp, 0xc
or esi, 0xffffffff
push dword [ebp - 0x20]
lea eax, [ebp + 0x104]
push eax
lea eax, [ebp + 0x208]
push str._srnsetup_d.exe
push eax
call fcn.00402161
add esp, 0x10
inc dword [ebp - 0x20]
lea eax, [ebp + 0x208]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x4011f6
cmp dword [ebp - 0x20], 0xc8
jl 0x4011b9
jmp 0x401220
push ebx
push 0x80
push 1
push ebx
push 3
push 0x1f01ff
lea eax, [ebp + 0x208]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
or eax, 0xffffffff
cmp esi, eax
je 0x4013de
push dword [ebp - 0x2c]
lea ecx, [ebp - 0x34]
call fcn.004019b0
lea eax, [ebp - 0x3c]
push eax
mov dword [ebp - 4], ebx
call fcn.00401710
pop ecx
push dword [ebp - 0x2c]
lea ecx, [ebp - 0x4c]
mov byte [ebp - 4], 1
call fcn.004019b0
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x44]
push str._orgexename_
push eax
mov byte [ebp - 4], 2
call fcn.00401e90
push 0x40f204
push eax
lea eax, [ebp - 0x54]
push eax
mov byte [ebp - 4], 3
call fcn.00401e40
push dword [ebp - 0x14]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x24]
push eax
call fcn.00401df0
add esp, 0x24
push eax
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], 5
call fcn.00401a40
lea ecx, [ebp - 0x24]
mov byte [ebp - 4], 4
call fcn.00401990
lea ecx, [ebp - 0x54]
mov byte [ebp - 4], 3
call fcn.00401990
lea ecx, [ebp - 0x44]
mov byte [ebp - 4], 2
call fcn.00401990
lea ecx, [ebp - 0x4c]
mov byte [ebp - 4], 1
call fcn.00401990
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], bl
call fcn.00401990
cmp esi, 0xffffffff
je 0x40139d
push ebx
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x1c]
mov dword [ebp - 0x14], ebx
push dword [ebp - 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call edi
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x1c]
jne 0x401371
push 0x38
lea eax, [ebp - 0x8c]
push ebx
push eax
call fcn.004027e0
lea eax, [ebp + 0x208]
add esp, 0xc
cmp byte [ebp - 0x2d], 0xff
mov dword [ebp - 0x80], eax
mov dword [ebp - 0x90], 0x3c
mov dword [ebp - 0x8c], 0x40
mov dword [ebp - 0x88], ebx
mov dword [ebp - 0x84], str.open
lea eax, [ebp - 0x34]
jne 0x401343
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x7c], eax
lea eax, [ebp - 0x90]
push eax
mov dword [ebp - 0x78], ebx
mov dword [ebp - 0x74], 1
call dword [sym.imp.SHELL32.dll_ShellExecuteExA]
test eax, eax
je 0x401371
push 0xffffffffffffffff
push dword [ebp - 0x58]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp - 0x58]
call edi
push 0x3e8
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp + 0x208]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x40139d
push 4
push ebx
lea eax, [ebp + 0x208]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
push dword [ebp - 0x18]
call fcn.00402156
or dword [ebp - 4], 0xffffffff
pop ecx
lea ecx, [ebp - 0x34]
call fcn.00401990
jmp 0x4013ba
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x10], ebx
je 0x4013c4
push dword [ebp - 0x10]
call edi
push str._StubSelfUpdate
push dword [ebp - 0x2c]
call fcn.004020d0
pop ecx
pop ecx
test eax, eax
je 0x4013dc
call fcn.004014f0
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x308]
xor ecx, ebp
call fcn.0040275f
add ebp, 0x30c
leave
ret 0x10