Function at 0x40e790
Capabilities:
Create process on windows
Get common file path
Read file on windows
Write and execute a file
Write file on windows

Disassembly:
sub esp, 0xad4
mov eax, dword [0x42f278]
xor eax, esp
mov dword [esp + 0xacc], eax
mov eax, dword [0x4377bc]
push ebx
push ebp
push esi
push edi
xor ebp, ebp
push 0x618
lea ecx, [esp + 0x4c4]
push ebp
push ecx
mov dword [esp + 0x34], eax
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x30], ebp
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x20], ebp
call fcn.00416890
push 0x208
lea edx, [esp + 0xc0]
push ebp
push edx
call fcn.00416890
add esp, 0x18
push 0x104
lea eax, [esp + 0x2bc]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [esp + 0x2b8]
push 0x42bc2c
push ecx
call fcn.00411180
mov esi, eax
add esp, 8
cmp esi, ebp
je 0x40eb78
push 2
push 0xffffffffffffffff
push 0xfffffffffffffff9
push esi
call fcn.004105d8
push esi
call fcn.00410ed0
push esi
push 2
mov ebx, edx
lea edx, [esp + 0x3c]
push 1
push edx
mov edi, eax
call fcn.004109fa
add esp, 0x24
cmp eax, 2
jne 0x40ebb3
push esi
push 1
lea eax, [esp + 0x2c]
push 1
push eax
call fcn.004109fa
add esp, 0x10
cmp eax, 1
jne 0x40ebb3
push esi
push 4
push eax
lea ecx, [esp + 0x1c]
push ecx
call fcn.004109fa
add esp, 0x10
cmp eax, 4
jne 0x40ebb3
cmp word [esp + 0x20], 0xfffe
jne 0x40eb78
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
push ebp
push edx
push eax
push esi
call fcn.004105d8
sub edi, dword [esp + 0x20]
sbb ebx, dword [esp + 0x24]
push edi
mov dword [esp + 0x44], edi
mov dword [esp + 0x48], ebx
call fcn.00410ff7
add esp, 0x14
cmp eax, ebp
mov dword [esp + 0x1c], eax
je 0x40eb78
push esi
push edi
push 1
push eax
call fcn.004109fa
push esi
call fcn.00411205
add esp, 0x14
lea ecx, [esp + 0xb0]
push ecx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea edi, [esp + 0xb0]
add edi, 0xfffffffe
jmp 0x40e900
mov ax, word [edi + 2]
add edi, 2
cmp ax, bp
jne 0x40e900
mov ecx, 6
mov esi, str.sfmkdecd.exe
rep movsd dword es:[edi], dword [esi]
lea eax, [esp + 0xb0]
movsw word es:[edi], word [esi]
xor ebx, ebx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bp
jne 0x40e926
sub eax, edx
lea edx, [esp + 0xb0]
sar eax, 1
push ebp
push edx
mov esi, eax
call fcn.0041231c
add esp, 8
cmp eax, 0xffffffff
je 0x40ea0b
lea eax, [esp + esi*2 + 0xa8]
mov dword [esp + 0x2c], eax
mov ecx, dword [esp + 0x2c]
push 0xa
lea edx, [esp + 0x94]
push edx
push ebx
mov word [ecx], bp
call fcn.00413123
lea eax, [esp + 0x9c]
add esp, 0xc
mov edx, eax
nop
mov cx, word [eax]
add eax, 2
cmp cx, bp
jne 0x40e980
lea edi, [esp + 0xb0]
sub eax, edx
add edi, 0xfffffffe
jmp 0x40e9a0
mov cx, word [edi + 2]
add edi, 2
cmp cx, bp
jne 0x40e9a0
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
lea eax, [esp + 0xb0]
rep movsb byte es:[edi], byte [esi]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
cmp cx, bp
jne 0x40e9c6
mov ecx, dword [str..exe]
mov edx, dword [0x42c5a4]
mov dword [eax], ecx
mov cx, word [0x42c5a8]
mov dword [eax + 4], edx
lea edx, [esp + 0xb0]
push ebp
push edx
mov word [eax + 8], cx
add ebx, 1
call fcn.0041231c
add esp, 8
cmp eax, 0xffffffff
jne 0x40e95c
lea eax, [esp + 0xb0]
push 0x42bc64
push eax
call fcn.00411180
mov esi, eax
add esp, 8
cmp esi, ebp
je case.default.0x40ea5b
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x1c]
push esi
push ecx
push 1
push edx
call fcn.00410b74
push esi
call fcn.00411205
add esp, 0x14
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov ecx, dword [esp + 0x28]
add ecx, 0xffffffff
cmp ecx, 4
ja case.default.0x40ea5b
jmp dword [ecx*4 + 0x40ec2c]
lea ecx, [esp + 0x2b8]
push ecx
push eax
lea edx, [esp + 0xb8]
push edx
lea eax, [esp + 0x4cc]
push str.__s___I__d__F___s___D
push eax
call fcn.004112ba
add esp, 0x14
jmp 0x40eb33
mov ecx, dword [0x4377c4]
mov edx, dword [0x4377c0]
push ecx
push edx
lea ecx, [esp + 0x2c0]
push ecx
push eax
lea edx, [esp + 0xc0]
push edx
push str.__s___I__d__F___s___S__I64d
jmp 0x40eb23
mov ecx, dword [0x4377c4]
mov edx, dword [0x4377c0]
push ecx
push edx
lea ecx, [esp + 0x2c0]
push ecx
push eax
lea edx, [esp + 0xc0]
push edx
push str.__s___I__d__F___s___R__I64d
jmp 0x40eb23
mov ecx, dword [0x4377c4]
mov edx, dword [0x4377c0]
push ecx
push edx
lea ecx, [esp + 0x2c0]
push ecx
push eax
lea edx, [esp + 0xc0]
push edx
push str.__s___I__d__F___s___U__I64d
jmp 0x40eb23
mov ecx, dword [0x4377c4]
mov edx, dword [0x4377c0]
push ecx
push edx
lea ecx, [esp + 0x2c0]
push ecx
push eax
lea edx, [esp + 0xc0]
push edx
push str.__s___I__d__F___s___T__I64d
lea eax, [esp + 0x4d8]
push eax
call fcn.004112ba
add esp, 0x1c
push 0x44
lea ecx, [esp + 0x4c]
push ebp
push ecx
call fcn.00416890
add esp, 0xc
lea edx, [esp + 0x38]
push edx
lea eax, [esp + 0x4c]
push eax
push ebp
push ebp
push 0x20
push ebp
push ebp
push ebp
lea ecx, [esp + 0x4e0]
push ecx
push ebp
mov dword [esp + 0x70], 0x44
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
mov eax, dword [esp + 0x1c]
push eax
call fcn.00410f1a
add esp, 4
lea ecx, [esp + 0xb0]
push ebp
push ecx
call fcn.0041231c
add esp, 8
cmp eax, 0xffffffff
je 0x40eb9a
lea ecx, [esp + 0xb0]
call fcn.00403de0
mov ecx, dword [esp + 0xadc]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004104f3
add esp, 0xad4
ret
push 0x40
push str.fread
push 0x4372f0
mov dword [0x4372ec], 0xd5
call fcn.00410502
push 0x104
lea edx, [esp + 0x2c8]
push edx
push 0x437378
mov word [0x437370], bp
mov dword [0x437370], 4
call fcn.00410502
push 0x104
push str....._src_sfslfdec_sfmkcore.c
push 0x437580
mov word [0x43757e], bp
call fcn.00410502
add esp, 0x24
mov word [0x437786], bp
mov dword [0x437374], 0x13f5
jmp 0x40eb78