Function at 0x401080
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [0x421004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x41f7d8
lea eax, [ebp - 0xc]
push str.code.txt
push eax
call fcn.00405749
add esp, 0xc
test eax, eax
je 0x4010dc
push eax
push str.Error_opening_file:__d._n
push 2
call fcn.00403ac2
add esp, 4
push eax
call fcn.00401020
add esp, 0xc
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401303
mov esp, ebp
pop ebp
ret
push 2
push 0
push dword [ebp - 0xc]
call fcn.00403ee9
push dword [ebp - 0xc]
call fcn.004039e4
push dword [ebp - 0xc]
mov esi, eax
mov dword [ebp - 0x18], esi
call fcn.004055d9
mov eax, esi
add esp, 0x14
cdq
sub eax, edx
mov ebx, eax
sar ebx, 1
mov dword [ebp - 0x1c], ebx
mov edi, dword [ebp - 0x18]
inc edi
mov ecx, 1
push ecx
push edi
call fcn.004039ef
add esp, 8
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
test eax, eax
jne 0x40115f
push str.Failed_to_allocate_memory._n
push 2
call fcn.00403ac2
add esp, 4
push eax
call fcn.00401020
push dword [ebp - 0xc]
call fcn.00403bbd
add esp, 0xc
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401303
mov esp, ebp
pop ebp
ret
push dword [ebp - 0xc]
push esi
push 1
push esi
push eax
call fcn.004054c5
push dword [ebp - 0xc]
call fcn.00403bbd
add esp, 0x18
mov eax, dword [ebp - 0x1c]
push eax
call fcn.0040a0ee
add esp, 4
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
test eax, eax
jne 0x4011c6
push str.Failed_to_allocate_memory._n
push 2
call fcn.00403ac2
add esp, 4
push eax
call fcn.00401020
add esp, 8
push dword [ebp - 0x14]
call fcn.00405790
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401303
mov esp, ebp
pop ebp
ret
xor esi, esi
test ebx, ebx
je 0x4011f1
nop dword [eax]
add eax, esi
push eax
mov eax, dword [ebp - 0x14]
push str._2hhx
lea eax, [eax + esi*2]
push eax
call fcn.00401050
inc esi
add esp, 0xc
cmp esi, ebx
jae 0x4011f1
mov eax, dword [ebp - 0x10]
jmp 0x4011d0
mov esi, dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push str.Kernel32.dll
call esi
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.VirtualProtect
push eax
call edi
lea ecx, [ebp - 8]
push ecx
push 0x40
push ebx
push dword [ebp - 0x10]
call eax
test eax, eax
jne 0x401260
push str.Failed_to_change_memory_protection._n
push 2
call fcn.00403ac2
add esp, 4
push eax
call fcn.00401020
add esp, 8
push dword [ebp - 0x14]
call fcn.00405790
add esp, 4
push dword [ebp - 0x10]
call fcn.00405790
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401303
mov esp, ebp
pop ebp
ret
push str.Kernel32.dll
call esi
push str.CreateThread
push eax
call edi
push 0
push 0
push 0
push dword [ebp - 0x10]
push 0
push 0
call eax
mov ebx, eax
test ebx, ebx
jne 0x4012c6
push str.Failed_to_spawn_thread._n
push 2
call fcn.00403ac2
add esp, 4
push eax
call fcn.00401020
add esp, 8
push dword [ebp - 0x14]
call fcn.00405790
add esp, 4
push dword [ebp - 0x10]
call fcn.00405790
add esp, 4
lea eax, [ebx + 1]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401303
mov esp, ebp
pop ebp
ret
push str.Kernel32.dll
call esi
push 0xffffffffffffffff
push ebx
push str.WaitForSingleObject
push eax
call edi
call eax
push dword [ebp - 0x14]
call fcn.00405790
add esp, 4
push dword [ebp - 0x10]
call fcn.00405790
add esp, 4
mov ecx, dword [ebp - 4]
xor eax, eax
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.00401303
mov esp, ebp
pop ebp
ret