Function at 0x409881
Capabilities:
Allocate or change rwx memory
Resolve function by parsing pe exports
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
push ebx
push esi
push edi
and dword [ebp - 0x24], 0
jmp 0x40989d
mov eax, dword [section..ex_cod]
add eax, section..ex_cod
mov dword [0x409008], eax
mov eax, dword [0x409008]
mov ecx, entry0
sub ecx, dword [eax + 0x18]
mov dword [0x40900c], ecx
cmp dword [0x409010], 0
je 0x4098de
mov eax, dword [0x409008]
mov ecx, dword [0x40900c]
add ecx, dword [eax + 0x14]
mov dword [ebp - 0x34], ecx
jmp 0x409d75
mov dword [0x409010], 1
jmp 0x4098fc
cmp dword [ebp + 0xc], 1
je 0x409906
and dword [ebp + 8], 0
push 4
push 0x1000
push 0x104
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x14], eax
push 0x104
push dword [ebp - 0x14]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov ecx, dword [ebp - 0x14]
lea eax, [ecx + eax - 1]
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x54]
movsx eax, byte [eax]
cmp eax, 0x5c
je 0x40994c
mov eax, dword [ebp - 0x54]
dec eax
mov dword [ebp - 0x54], eax
jmp 0x409938
mov eax, dword [ebp - 0x54]
inc eax
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x54]
sub eax, dword [ebp - 0x14]
mov dword [ebp - 0x50], eax
push 4
push 0x1000
push 0x104
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 4], eax
mov ecx, dword [ebp - 0x50]
mov esi, dword [ebp - 0x14]
mov edi, dword [ebp - 4]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp - 4]
add eax, dword [ebp - 0x50]
and byte [eax + 1], 0
mov eax, dword [0x409004]
shl eax, 6
mov ecx, dword [0x40900c]
add ecx, eax
mov dword [ebp - 0x40], ecx
mov eax, dword [ebp - 0x40]
mov ecx, dword [0x40900c]
add ecx, dword [eax + 0x3c]
mov dword [ebp - 0x10], ecx
mov eax, dword [ebp - 0x10]
add eax, 0xf8
mov dword [ebp - 0x3c], eax
mov eax, dword [0x409008]
cmp dword [eax + 0x64], 0
je 0x409ad9
push 4
push 0x1000
mov eax, dword [0x409008]
push dword [eax + 4]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x38]
mov dword [0x409f38], eax
cmp dword [0x409f38], 0
jne 0x409a03
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov eax, dword [0x409008]
mov eax, dword [eax + 8]
mov dword [0x409f3c], eax
mov eax, dword [0x409008]
mov ecx, dword [0x40900c]
add ecx, dword [eax + 0x10]
mov eax, dword [0x409008]
mov esi, dword [ebp - 0x10]
mov eax, dword [eax + 0x78]
xor edx, edx
div dword [esi + 0x3c]
add ecx, edx
mov dword [0x409f34], ecx
push dword [0x409f38]
mov eax, dword [0x409008]
push dword [eax + 4]
push dword [0x409f34]
call fcn.004097a8
add esp, 0xc
jmp 0x409a5b
mov eax, dword [ebp - 0x24]
inc eax
mov dword [ebp - 0x24], eax
mov eax, dword [0x409008]
movzx eax, word [eax + 0x70]
cmp dword [ebp - 0x24], eax
jge 0x409ac4
mov eax, dword [ebp - 0x24]
imul eax, eax, 0x18
mov ecx, dword [0x409008]
mov ecx, dword [ecx + eax + 0x7c]
mov esi, dword [0x409f38]
mov eax, dword [ebp - 0x24]
imul eax, eax, 0x18
mov edx, dword [0x409008]
mov edi, dword [0x40900c]
add edi, dword [edx + eax + 0x80]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp - 0x24]
imul eax, eax, 0x18
mov ecx, dword [0x409008]
mov edx, dword [0x409f38]
add edx, dword [ecx + eax + 0x7c]
mov dword [0x409f38], edx
jmp 0x409a54
push 0x8000
push 0
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x409bc3
mov eax, dword [0x409008]
mov ecx, dword [0x40900c]
add ecx, dword [eax + 0x10]
mov eax, dword [0x409008]
sub ecx, dword [eax + 0xc]
mov eax, dword [0x409008]
mov esi, dword [ebp - 0x10]
mov eax, dword [eax + 0x78]
xor edx, edx
div dword [esi + 0x3c]
add ecx, edx
mov dword [ebp - 0x38], ecx
and dword [ebp - 0x24], 0
jmp 0x409b11
mov eax, dword [ebp - 0x24]
inc eax
mov dword [ebp - 0x24], eax
mov eax, dword [0x409008]
movzx eax, word [eax + 0x70]
cmp dword [ebp - 0x24], eax
jge 0x409bc3
mov eax, dword [ebp - 0x24]
imul eax, eax, 0x18
mov ecx, dword [0x409008]
cmp dword [ecx + eax + 0x74], 0
je 0x409bbe
mov eax, dword [ebp - 0x24]
imul eax, eax, 0x18
mov ecx, dword [0x409008]
cmp dword [ecx + eax + 0x7c], 0
jbe 0x409bbe
mov eax, dword [ebp - 0x24]
imul eax, eax, 0x18
mov ecx, dword [0x409008]
mov edx, dword [0x40900c]
add edx, dword [ecx + eax + 0x80]
mov dword [0x409f38], edx
mov eax, dword [ebp - 0x24]
imul eax, eax, 0x18
mov ecx, dword [0x409008]
mov eax, dword [ecx + eax + 0x7c]
mov dword [0x409f3c], eax
mov eax, dword [ebp - 0x24]
imul eax, eax, 0x18
mov ecx, dword [0x409008]
mov edx, dword [ebp - 0x38]
add edx, dword [ecx + eax + 0x78]
mov dword [0x409f34], edx
push dword [0x409f38]
mov eax, dword [ebp - 0x24]
imul eax, eax, 0x18
mov ecx, dword [0x409008]
push dword [ecx + eax + 0x7c]
push dword [0x409f34]
call fcn.004097a8
add esp, 0xc
jmp 0x409b0a
mov eax, dword [0x409008]
mov ecx, dword [0x40900c]
add ecx, dword [eax + 0x24]
mov dword [ebp - 0x4c], ecx
mov eax, dword [ebp - 0x4c]
cmp dword [eax + 0xc], 0
je 0x409d64
mov eax, dword [0x409008]
cmp dword [eax + 0x24], 0
je 0x409d64
lea eax, [ebp - 0x44]
push eax
push 0x40
push 0x14
push dword [ebp - 0x4c]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov eax, dword [ebp - 0x4c]
mov ecx, dword [0x40900c]
add ecx, dword [eax + 0xc]
mov dword [ebp - 0xc], ecx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jne 0x409c32
push 8
push 0
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jne 0x409c70
mov edi, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
add eax, dword [ebp - 0x50]
mov edx, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov eax, ecx
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 8
push 0
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov dword [ebp - 0x2c], eax
cmp dword [ebp - 0x2c], 0
jne 0x409c7e
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov eax, dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x2c]
mov dword [eax + 8], ecx
mov eax, dword [ebp - 0x4c]
mov dword [eax + 4], 0xcdc31337
mov eax, dword [ebp - 0x4c]
mov ecx, dword [0x40900c]
add ecx, dword [eax + 0x10]
mov dword [ebp - 0x20], ecx
mov eax, dword [ebp - 0x4c]
cmp dword [eax], 0
jne 0x409cb0
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x18], eax
jmp 0x409cbe
mov eax, dword [ebp - 0x4c]
mov ecx, dword [0x40900c]
add ecx, dword [eax]
mov dword [ebp - 0x18], ecx
mov eax, dword [ebp - 0x18]
cmp dword [eax], 0
je 0x409d56
and dword [ebp - 0x58], 0
mov eax, dword [ebp - 0x18]
mov eax, dword [eax]
and eax, 0x80000000
test eax, eax
je 0x409cf8
mov eax, dword [ebp - 0x18]
mov eax, dword [eax]
and eax, 0xffff
movzx eax, ax
push eax
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x58], eax
jmp 0x409d18
mov eax, dword [ebp - 0x18]
mov eax, dword [eax]
add eax, dword [0x40900c]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
inc eax
inc eax
push eax
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x58], eax
cmp dword [ebp - 0x58], 0
jne 0x409d26
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
lea eax, [ebp - 0x44]
push eax
push 0x40
push 4
push dword [ebp - 0x20]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x58]
mov dword [eax], ecx
mov eax, dword [ebp - 0x18]
add eax, 4
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x20]
add eax, 4
mov dword [ebp - 0x20], eax
jmp 0x409cbe
mov eax, dword [ebp - 0x4c]
add eax, 0x14
mov dword [ebp - 0x4c], eax
jmp 0x409bd4
mov eax, dword [0x409008]
mov ecx, dword [0x40900c]
add ecx, dword [eax + 0x14]
mov dword [ebp - 0x34], ecx
push 0x8000
push 0
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0x8000
push 0
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [ebp - 0x34]
pop edi
pop esi
pop ebx
add esp, 0x5c
pop ebp
push eax
mov eax, dword [0x409008]
cmp dword [eax + 0x14], 0
jne 0x409db0
pop eax
xor eax, eax
inc eax
ret
pop eax
jmp eax