Function at 0x40a840
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
sub esp, 0x3c
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x18]
add ecx, dword [eax + 0x11]
mov dword [ebp - 0x20], ecx
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x1c]
add eax, dword [ecx + 0x15]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x30], 0
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 5]
mov dword [esp + 4], eax
mov dword [esp + 0xc], 0x40
mov dword [esp + 8], 0x1000
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
sub esp, 0x10
mov dword [ebp - 0x28], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x34], 0x63bde5df
mov edi, dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
jmp 0x40a8c0
mov dword [ebp - 0x34], eax
nop
nop
nop
nop
mov eax, dword [ebp - 0x34]
cmp eax, 0x7f2ab324
jg 0x40a8f0
cmp eax, 0x9c988c7d
jg 0x40a930
cmp eax, 0x8def7d60
jne 0x40a8c0
inc dword [ebp - 0x2c]
mov dword [ebp - 0x34], 0xd06fca90
jmp 0x40a8c0
cmp eax, 0x7f2ab325
jne 0x40a8c0
call fcn.0040d510
mov eax, dword [ebp - 0x24]
movzx eax, byte [eax]
mov ecx, eax
not ecx
mov edx, ecx
and edx, 0xfc
and eax, 3
add eax, edx
not eax
or eax, ecx
cmp eax, 0xffffffff
mov eax, 0xcdb31f63
jne 0x40a8b9
mov eax, 0xf11dae23
jmp 0x40a8b9
cmp eax, 0x63bde5de
jg 0x40a9a4
cmp eax, 0x5d909471
jg 0x40a9c7
cmp eax, 0x4d26be8a
jg 0x40aa16
cmp eax, 0x462f9a20
jg 0x40aa2d
cmp eax, 0x40cd4f5b
jg 0x40aa56
cmp eax, 0xa1ebc26e
jg 0x40aa79
cmp eax, 0x9c988c7e
jne 0x40a8c0
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
call dword [sym.imp.KERNEL32.dll_VirtualFree]
sub esp, 0xc
mov dword [ebp - 0x34], 0xf668938a
jmp 0x40a8c0
cmp eax, 0x63bde5df
jne 0x40a8c0
mov eax, 0xdf424bb6
cmp dword [ebp - 0xc], 0
jne 0x40a9bf
mov eax, 0xbc7b07bd
mov dword [ebp - 0x34], eax
jmp 0x40a8c0
cmp eax, 0x5d909472
jne 0x40a8c0
mov eax, dword [ebp - 0x24]
inc eax
mov ecx, dword [ebp - 0x14]
mov dword [esp + 4], eax
mov dword [esp], ecx
mov dword [esp + 8], 0x20
call fcn.00403360
mov eax, dword [ebp - 0x24]
movzx eax, byte [eax]
mov ecx, eax
not ecx
and ecx, 0xfffffffe
xor eax, 1
or eax, ecx
cmp eax, 0xffffffff
mov eax, 0xa1ebc26f
jne 0x40aa0e
mov eax, 0x7f2ab325
mov dword [ebp - 0x34], eax
jmp 0x40a8c0
cmp eax, 0x4d26be8b
jne 0x40a8c0
mov dword [ebp - 0x34], 0xf668938a
jmp 0x40a8c0
cmp eax, 0x462f9a21
jne 0x40a8c0
mov eax, 0x3663f702
sub eax, dword [ebp - 0x2c]
mov ecx, 0x3663f703
sub ecx, eax
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x34], 0x8def7d60
jmp 0x40a8c0
cmp eax, 0x40cd4f5c
jne 0x40a8c0
mov eax, 0x4d26be8b
cmp dword [ebp - 0x28], 0
jne 0x40aa71
mov eax, 0xe43288cd
mov dword [ebp - 0x34], eax
jmp 0x40a8c0
cmp eax, 0xbc7b07bc
jg 0x40aaae
cmp eax, 0xa1ebc26f
jne 0x40a8c0
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x24]
mov ecx, dword [ecx + 1]
add ecx, eax
mov dword [esp + 4], ecx
mov dword [esp], eax
call fcn.00409850
mov dword [ebp - 0x34], 0x7f2ab325
jmp 0x40a8c0
cmp eax, 0xc3bf08ac
jg 0x40aace
cmp eax, 0xbc7b07bd
jne 0x40a8c0
mov esi, dword [edi]
mov dword [ebp - 0x34], 0x40cd4f5c
jmp 0x40a8c0
cmp eax, 0xcdb31f62
jg 0x40aae5
cmp eax, 0xc3bf08ad
jne 0x40a8c0
jmp 0x40acfc
cmp eax, 0x3a1275cd
jg 0x40ab44
cmp eax, 0x3542f710
jg 0x40ab61
cmp eax, 0xd06fca8f
jg 0x40ab78
cmp eax, 0xcdb31f63
jne 0x40a8c0
mov eax, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x1c]
mov edx, 0xe2faca41
sub edx, dword [ecx + 1]
lea eax, [edx + eax + 0x1d0535bf]
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp - 0x28]
mov edx, dword [ebp - 0x24]
mov edx, dword [edx + 0x19]
add edx, ecx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], ecx
call fcn.00409d30
mov dword [ebp - 0x34], 0xf11dae23
jmp 0x40a8c0
cmp eax, 0x3a1275ce
jne 0x40a8c0
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x34], 0xc3bf08ad
jmp 0x40a8c0
cmp eax, 0x3542f711
jne 0x40a8c0
mov dword [ebp - 0x34], 0x40cd4f5c
jmp 0x40a8c0
cmp eax, 0xdf424bb5
jg 0x40ab96
cmp eax, 0xd06fca90
jne 0x40a8c0
mov dword [ebp - 0x34], 0xfe5d42c4
jmp 0x40a8c0
cmp eax, 0xe1859e38
jg 0x40abbb
cmp eax, 0xdf424bb6
jne 0x40a8c0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x34], 0xfe5d42c4
jmp 0x40a8c0
cmp eax, 0xe43288cc
jg 0x40ac05
cmp eax, 0xe1859e39
jne 0x40a8c0
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax + 5]
mov edx, dword [ebp - 0x28]
add edx, dword [eax + 1]
add eax, 0xd
mov dword [esp + 8], ecx
mov dword [esp + 4], eax
mov dword [esp], edx
call fcn.00403360
mov eax, dword [ebp - 0x20]
mov ecx, dword [eax + 5]
lea eax, [eax + ecx + 0xd]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x34], 0x40028c
jmp 0x40a8c0
cmp eax, 0xec528415
jg 0x40ac2a
cmp eax, 0xe43288cd
jne 0x40a8c0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x34], 0xc3bf08ad
jmp 0x40a8c0
cmp eax, 0xf11dae22
jg 0x40ac48
cmp eax, 0xec528416
jne 0x40a8c0
mov dword [ebp - 0x34], 0xe43288cd
jmp 0x40a8c0
cmp eax, 0xf6689389
jg 0x40ac8f
cmp eax, 0xf11dae23
jne 0x40a8c0
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x1c]
add eax, dword [ecx + 0x11]
mov ecx, dword [ecx + 0xd]
mov edx, dword [ebp - 0x28]
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call fcn.0040a2e0
test eax, eax
mov eax, 0x3542f711
js 0x40ac87
mov eax, 0x3a1275ce
mov dword [ebp - 0x34], eax
jmp 0x40a8c0
cmp eax, 0xf668938a
je 0x40acba
cmp eax, 0xfe5d42c4
jne 0x40ace5
mov ecx, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x1c]
mov eax, 0xe1859e39
cmp ecx, dword [edx + 0xd]
jb 0x40acb2
mov eax, 0x5d909472
mov dword [ebp - 0x34], eax
jmp 0x40a8c0
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
call dword [sym.imp.KERNEL32.dll_VirtualFree]
sub esp, 0xc
mov dword [ebp - 0x34], 0xec528416
jmp 0x40a8c0
cmp eax, 0x40028c
jne 0x40a8c0
mov dword [ebp - 0x34], 0x8def7d60
jmp 0x40a8c0
mov eax, dword [ebp - 0x10]
add esp, 0x3c
pop esi
pop edi
pop ebp
ret