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
lea ebp, [esp - 0x30c]
sub esp, 0x38c
mov eax, dword [0x411080]
xor eax, ebp
mov dword [ebp + 0x308], eax
mov eax, dword [ebp + 0x31c]
push ebx
xor ebx, ebx
push 0x103
mov dword [ebp - 0x2c], eax
lea eax, [ebp + 1]
push ebx
push eax
mov byte [ebp], bl
call fcn.00402360
add esp, 0xc
push 0x104
lea eax, [ebp]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x401058
or eax, 0xffffffff
jmp 0x40139c
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 - 4], eax
cmp eax, 0xffffffff
je 0x401050
push esi
push edi
push 0xc
pop edi
push ebx
push eax
mov dword [ebp - 0x18], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x1c], eax
cmp eax, edi
jbe 0x4010ee
mov dword [ebp - 0x10], 0xfffffff4
push 2
push ebx
push dword [ebp - 0x10]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x18]
push eax
push 4
lea eax, [ebp - 8]
push eax
push dword [ebp - 4]
mov dword [ebp - 8], ebx
mov dword [ebp - 0x24], ebx
call esi
push ebx
lea eax, [ebp - 0x18]
push eax
push 4
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 4]
call esi
cmp dword [ebp - 8], 0x4f4a4f4d
jne 0x4010e5
cmp dword [ebp - 0x24], 0x4f4a4f4a
je 0x4010ee
inc edi
dec dword [ebp - 0x10]
cmp edi, dword [ebp - 0x1c]
jb 0x40109e
push ebx
lea eax, [ebp - 0x18]
push eax
push 4
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 4]
mov dword [ebp - 0xc], ebx
call esi
mov eax, dword [ebp - 0xc]
lea ecx, [eax + edi]
cmp ecx, dword [ebp - 0x1c]
jbe 0x401114
or eax, 0xffffffff
jmp 0x40139a
push eax
call fcn.004022cb
pop ecx
mov dword [ebp - 8], eax
cmp eax, ebx
je 0x401370
mov eax, dword [ebp - 0xc]
push 2
add eax, edi
push ebx
neg eax
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0xc]
push dword [ebp - 8]
push dword [ebp - 4]
call esi
push dword [ebp - 4]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
lea eax, [ebp + 0x104]
push eax
push 0x104
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea eax, [ebp + 0x104]
push eax
call fcn.00402240
pop ecx
lea ecx, [ebp + 0x104]
cmp byte [eax + ecx - 1], 0x5c
je 0x401193
mov eax, ecx
push 0x40d218
push eax
call fcn.00402150
pop ecx
pop ecx
push 0xff
lea eax, [ebp + 0x209]
push ebx
push eax
mov dword [ebp - 0x10], ebx
mov byte [ebp + 0x208], bl
call fcn.00402360
add esp, 0xc
or edi, 0xffffffff
push dword [ebp - 0x10]
lea eax, [ebp + 0x104]
push eax
lea eax, [ebp + 0x208]
push str._srnsetup_d.exe
push eax
call fcn.004020b1
add esp, 0x10
inc dword [ebp - 0x10]
lea eax, [ebp + 0x208]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x4011f1
cmp dword [ebp - 0x10], 0xc8
jl 0x4011b4
jmp 0x40121b
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 edi, eax
or eax, 0xffffffff
cmp edi, eax
je 0x40139a
push dword [ebp - 0x2c]
lea ecx, [ebp - 0x28]
call fcn.00401900
lea eax, [ebp - 0x20]
push eax
call fcn.004016d0
pop ecx
push dword [ebp - 0x2c]
lea ecx, [ebp - 0x3c]
call fcn.00401900
push eax
push 0x40d204
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x34]
push str._orgexename_
push eax
call fcn.00401de0
add esp, 0xc
push eax
lea eax, [ebp - 0x44]
push eax
call fcn.00401d90
add esp, 0xc
push eax
lea eax, [ebp - 0x14]
push eax
call fcn.00401d40
add esp, 0xc
push eax
lea ecx, [ebp - 0x28]
call fcn.00401990
lea ecx, [ebp - 0x14]
call fcn.004018e0
lea ecx, [ebp - 0x44]
call fcn.004018e0
lea ecx, [ebp - 0x34]
call fcn.004018e0
lea ecx, [ebp - 0x3c]
call fcn.004018e0
lea ecx, [ebp - 0x20]
call fcn.004018e0
cmp edi, 0xffffffff
je 0x40135d
push ebx
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0xc]
mov dword [ebp - 0x1c], ebx
push dword [ebp - 8]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call esi
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0xc]
jne 0x401331
push 0x38
lea eax, [ebp - 0x7c]
push ebx
push eax
call fcn.00402360
lea eax, [ebp + 0x208]
add esp, 0xc
cmp byte [ebp - 0x21], 0xff
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x80], 0x3c
mov dword [ebp - 0x7c], 0x40
mov dword [ebp - 0x78], ebx
mov dword [ebp - 0x74], str.open
lea eax, [ebp - 0x28]
jne 0x401306
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x6c], eax
lea eax, [ebp - 0x80]
push eax
mov dword [ebp - 0x68], ebx
mov dword [ebp - 0x64], 1
call dword [sym.imp.SHELL32.dll_ShellExecuteExA]
test eax, eax
je 0x401331
push 0xffffffffffffffff
push dword [ebp - 0x48]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp - 0x48]
call esi
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 0x40135d
push 4
push ebx
lea eax, [ebp + 0x208]
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
push dword [ebp - 8]
call fcn.004020a6
pop ecx
lea ecx, [ebp - 0x28]
call fcn.004018e0
jmp 0x401376
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 4], ebx
je 0x401380
push dword [ebp - 4]
call esi
push str._StubSelfUpdate
push dword [ebp - 0x2c]
call fcn.00402020
pop ecx
pop ecx
test eax, eax
je 0x401398
call fcn.004014b0
xor eax, eax
pop edi
pop esi
mov ecx, dword [ebp + 0x308]
xor ecx, ebp
pop ebx
call fcn.0040234b
add ebp, 0x30c
leave
ret 0x10