Function at 0x40d840
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x38
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x38], 0x96f92c0a
mov esi, dword [sym.imp.ADVAPI32.dll_AccessCheckByType]
jmp 0x40d8a0
mov eax, dword [ebp - 0x2c]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x28]
mov ecx, dword [ecx]
add eax, dword [ecx + 0x11]
mov ecx, dword [ebp - 0x28]
mov ecx, dword [ecx]
mov ecx, dword [ecx + 0xd]
mov edx, dword [ebp - 0x1c]
mov edx, dword [edx]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call fcn.0040d110
add esp, 0xc
mov dword [ebp - 0x38], 0xcadaff46
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, dword [ebp - 0x38]
cmp eax, 0x76baf564
jg 0x40d980
cmp eax, 0x74640705
jg 0x40d990
cmp eax, 0x7365fc87
jg 0x40d9b2
cmp eax, 0x6667cfad
jg 0x40da08
cmp eax, 0x5b9a60dd
jg 0x40da2c
cmp eax, 0x5929f322
jg 0x40db3d
cmp eax, 0x455c44c8
jg 0x40db62
cmp eax, 0x3ab689e5
jg 0x40db8e
cmp eax, 0x2d88f9f8
jg 0x40dba5
cmp eax, 0x2c6de5d3
jg 0x40dbd9
cmp eax, 0x20dba689
jg 0x40dc11
cmp eax, 0x1bd9769d
jg 0x40dc83
cmp eax, 0x671c338
jg 0x40dc93
cmp eax, 0x21aedca
jg 0x40dcb4
cmp eax, 0x1a7718d
jg 0x40dd1b
cmp eax, 0xfaeed81e
jg 0x40dd32
cmp eax, 0x974f5c26
jg 0x40dd49
cmp eax, 0x96f92c0a
jne 0x40d8a0
mov dword [ebp - 0x38], 0x5b9a60de
jmp 0x40d8a0
cmp eax, 0x76baf565
jne 0x40d8a0
jmp 0x40d85e
cmp eax, 0x74640706
jne 0x40d8a0
mov eax, dword [ebp - 0x18]
mov eax, dword [eax]
inc eax
mov ecx, dword [ebp - 0x18]
mov dword [ecx], eax
mov dword [ebp - 0x38], 0x455c44c9
jmp 0x40d8a0
cmp eax, 0x7365fc88
jne 0x40d8a0
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
inc eax
mov ecx, dword [ebp - 0x30]
mov ecx, dword [ecx]
sub esp, 0xc
mov dword [esp + 4], eax
mov dword [esp], ecx
mov dword [esp + 8], 0x20
call fcn.00402b50
add esp, 0xc
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
movzx eax, byte [eax]
mov ecx, eax
xor ecx, 0xfe
test eax, ecx
mov eax, 0x974f5c27
jne 0x40da00
mov eax, 0x2d88f9f9
mov dword [ebp - 0x38], eax
jmp 0x40d8a0
cmp eax, 0x6667cfae
jne 0x40d8a0
mov al, byte [ebp - 0xe]
test al, al
mov eax, 0xf79ba2d4
jne 0x40da24
mov eax, 0x99d9eeab
mov dword [ebp - 0x38], eax
jmp 0x40d8a0
cmp eax, 0x5b9a60de
jne 0x40d8a0
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x34], esp
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x30], esp
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x2c], esp
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x28], esp
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x24], esp
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x20], esp
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x1c], esp
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x18], esp
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x14], esp
mov eax, dword [ebp - 0x30]
mov dword [eax], edi
mov eax, dword [ebp - 0x2c]
mov dword [eax], ebx
mov eax, dword [ebp - 0x2c]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x28]
mov dword [ecx], eax
mov eax, dword [ebp - 0x2c]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x28]
mov ecx, dword [ecx]
add eax, dword [ecx + 0x11]
mov ecx, dword [ebp - 0x24]
mov dword [ecx], eax
mov eax, dword [ebp - 0x2c]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x28]
mov ecx, dword [ecx]
add eax, dword [ecx + 0x15]
mov ecx, dword [ebp - 0x20]
mov dword [ecx], eax
mov eax, dword [ebp - 0x1c]
mov dword [eax], 0
mov eax, dword [ebp - 0x14]
mov dword [eax], 0
mov eax, dword [ebp - 0x28]
mov eax, dword [eax]
mov eax, dword [eax + 5]
sub esp, 0x10
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]
mov ecx, dword [ebp - 0x1c]
mov dword [ecx], eax
mov eax, dword [ebp - 0x1c]
cmp dword [eax], 0
setne byte [ebp - 0xe]
mov dword [ebp - 0x38], 0x6667cfae
jmp 0x40d8a0
cmp eax, 0x5929f323
jne 0x40d8a0
mov ecx, dword [ebp - 0x1c]
mov eax, 0x2c6de5d4
cmp dword [ecx], 0
jne 0x40db5a
mov eax, 0xcb9560c6
mov dword [ebp - 0x38], eax
jmp 0x40d8a0
cmp eax, 0x455c44c9
jne 0x40d8a0
mov eax, dword [ebp - 0x18]
mov ecx, dword [eax]
mov eax, dword [ebp - 0x28]
mov edx, dword [eax]
mov eax, 0x3ab689e6
cmp ecx, dword [edx + 0xd]
jb 0x40db86
mov eax, 0x7365fc88
mov dword [ebp - 0x38], eax
jmp 0x40d8a0
cmp eax, 0x3ab689e6
jne 0x40d8a0
mov dword [ebp - 0x38], 0x21aedcb
jmp 0x40d8a0
cmp eax, 0x2d88f9f9
jne 0x40d8a0
call fcn.0040e940
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
movzx eax, byte [eax]
not eax
or eax, 0xfffffffc
cmp eax, 0xffffffff
mov eax, 0xb4423a9a
jne 0x40dbd1
mov eax, 0xd83129f1
mov dword [ebp - 0x38], eax
jmp 0x40d8a0
cmp eax, 0x2c6de5d4
jne 0x40d8a0
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax]
sub esp, 0xc
mov dword [esp], eax
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov dword [ebp - 0x38], 0xcb9560c6
jmp 0x40d8a0
cmp eax, 0x20dba68a
jne 0x40d8a0
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov eax, dword [eax + 5]
mov dword [ebp - 0x3c], eax
mov ecx, dword [ebp - 0x24]
mov ecx, dword [ecx]
add ecx, 0xd
mov edx, dword [ebp - 0x1c]
mov edx, dword [edx]
mov eax, ebx
mov ebx, edi
mov edi, esi
mov esi, dword [ebp - 0x24]
mov esi, dword [esi]
add edx, dword [esi + 1]
mov esi, edi
mov edi, ebx
mov ebx, eax
sub esp, 0xc
mov eax, dword [ebp - 0x3c]
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call fcn.00402b50
add esp, 0xc
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x24]
mov ecx, dword [ecx]
mov ecx, dword [ecx + 5]
lea eax, [eax + ecx + 0xd]
mov ecx, dword [ebp - 0x24]
mov dword [ecx], eax
mov dword [ebp - 0x38], 0x21aedcb
jmp 0x40d8a0
cmp eax, 0x1bd9769e
jne 0x40d8a0
jmp 0x40e08c
cmp eax, 0x671c339
jne 0x40d8a0
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x34]
mov dword [ecx], eax
mov dword [ebp - 0x38], 0x9a2e2318
jmp 0x40d8a0
cmp eax, 0x21aedcb
jne 0x40d8a0
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov edi, dword [eax + 5]
mov ecx, dword [ebp - 0x24]
mov ecx, dword [ecx]
add ecx, 0xd
mov edx, dword [ebp - 0x1c]
mov edx, dword [edx]
mov eax, esi
mov esi, dword [ebp - 0x24]
mov esi, dword [esi]
add edx, dword [esi + 1]
mov esi, eax
sub esp, 0xc
mov dword [esp + 8], edi
mov edi, dword [ebp + 0xc]
mov dword [esp + 4], ecx
mov dword [esp], edx
call fcn.00402b50
add esp, 0xc
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x24]
mov ecx, dword [ecx]
mov ecx, dword [ecx + 5]
lea eax, [eax + ecx + 0xd]
mov ecx, dword [ebp - 0x24]
mov dword [ecx], eax
mov dword [ebp - 0x38], 0x1a7718e
jmp 0x40d8a0
cmp eax, 0x1a7718e
jne 0x40d8a0
mov dword [ebp - 0x38], 0x74640706
jmp 0x40d8a0
cmp eax, 0xfaeed81f
jne 0x40d8a0
mov dword [ebp - 0x38], 0x5929f323
jmp 0x40d8a0
cmp eax, 0x99d9eeaa
jg 0x40dd8b
cmp eax, 0x974f5c27
jne 0x40d8a0
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x20]
mov ecx, dword [ecx]
add eax, dword [ecx + 1]
mov ecx, dword [ebp - 0x1c]
mov ecx, dword [ecx]
sub esp, 8
mov dword [esp + 4], eax
mov dword [esp], ecx
call fcn.0040c5c0
add esp, 8
mov dword [ebp - 0x38], 0x2d88f9f9
jmp 0x40d8a0
cmp eax, 0x9a2e2317
jg 0x40ddaf
cmp eax, 0x99d9eeab
jne 0x40d8a0
mov eax, esi
mov esi, dword [eax]
mov esi, eax
mov dword [ebp - 0x38], 0x5929f323
jmp 0x40d8a0
cmp eax, 0xa3602fa7
jg 0x40ddd7
cmp eax, 0x9a2e2318
jne 0x40d8a0
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x34]
mov dword [ecx], eax
mov dword [ebp - 0x38], 0xa3602fa8
jmp 0x40d8a0
cmp eax, 0xb4423a99
jg 0x40ddf5
cmp eax, 0xa3602fa8
jne 0x40d8a0
mov dword [ebp - 0x38], 0x1bd9769e
jmp 0x40d8a0
cmp eax, 0xcabe7e4e
jg 0x40de52
cmp eax, 0xb4423a9a
jne 0x40d8a0
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x28]
mov ecx, dword [ecx]
sub eax, dword [ecx + 1]
mov ecx, dword [ebp - 0x14]
mov dword [ecx], eax
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x20]
mov ecx, dword [ecx]
add eax, dword [ecx + 0x19]
mov ecx, dword [ebp - 0x14]
mov ecx, dword [ecx]
mov edx, dword [ebp - 0x1c]
mov edx, dword [edx]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call fcn.0040cb80
add esp, 0xc
mov dword [ebp - 0x38], 0xd83129f1
jmp 0x40d8a0
cmp eax, 0xcadaff45
jg 0x40de70
cmp eax, 0xcabe7e4f
jne 0x40d8a0
mov dword [ebp - 0x38], 0x9a2e2318
jmp 0x40d8a0
cmp eax, 0xcb9560c5
jg 0x40dec4
cmp eax, 0xcadaff46
jne 0x40d8a0
mov eax, dword [ebp - 0x2c]
mov eax, dword [eax]
mov ecx, dword [ebp - 0x28]
mov ecx, dword [ecx]
add eax, dword [ecx + 0x11]
mov ecx, dword [ebp - 0x28]
mov ecx, dword [ecx]
mov ecx, dword [ecx + 0xd]
mov edx, dword [ebp - 0x1c]
mov edx, dword [edx]
sub esp, 0xc
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call fcn.0040d110
add esp, 0xc
test eax, eax
sets byte [ebp - 0xd]
mov dword [ebp - 0x38], 0xdda5aa01
jmp 0x40d8a0
cmp eax, 0xd1a26c63
jg 0x40deeb
cmp eax, 0xcb9560c6
jne 0x40d8a0
mov eax, dword [ebp - 0x34]
mov dword [eax], 0
mov dword [ebp - 0x38], 0x1bd9769e
jmp 0x40d8a0
cmp eax, 0xd83129f0
jg 0x40dfd6
cmp eax, 0xd1a26c64
jne 0x40d8a0
mov eax, 4
call fcn.00416a40
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x40], esp
mov eax, 4
call fcn.00416a40
mov edx, esp
mov eax, 4
call fcn.00416a40
mov esi, esp
mov eax, 4
call fcn.00416a40
mov ecx, esp
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x44], esp
mov eax, 4
call fcn.00416a40
mov dword [ebp - 0x3c], esp
mov eax, 4
call fcn.00416a40
mov eax, 4
call fcn.00416a40
mov eax, dword [ebp - 0x40]
mov dword [eax], edi
mov dword [edx], ebx
mov dword [esi], ebx
mov eax, dword [edx]
add eax, dword [ebx + 0x11]
mov dword [ecx], eax
mov eax, dword [edx]
mov ecx, dword [esi]
add eax, dword [ecx + 0x15]
mov ecx, dword [ebp - 0x44]
mov dword [ecx], eax
mov eax, dword [ebp - 0x3c]
mov dword [eax], 0
mov dword [esp], 0
mov eax, dword [esi]
mov esi, dword [sym.imp.ADVAPI32.dll_AccessCheckByType]
mov eax, dword [eax + 5]
sub esp, 0x10
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]
mov ecx, dword [ebp - 0x3c]
mov dword [ecx], eax
mov dword [ebp - 0x38], 0x5b9a60de
jmp 0x40d8a0
cmp eax, 0xdda5aa00
jg 0x40dff4
cmp eax, 0xd83129f1
jne 0x40d8a0
mov dword [ebp - 0x38], 0xcadaff46
jmp 0x40d8a0
cmp eax, 0xe14b5e5b
jg 0x40e01f
cmp eax, 0xdda5aa01
jne 0x40d8a0
mov al, byte [ebp - 0xd]
test al, al
mov eax, 0xfaeed81f
jne 0x40e017
mov eax, 0xcabe7e4f
mov dword [ebp - 0x38], eax
jmp 0x40d8a0
cmp eax, 0xf58f6c33
jg 0x40e03d
cmp eax, 0xe14b5e5c
jne 0x40d8a0
mov dword [ebp - 0x38], 0x455c44c9
jmp 0x40d8a0
cmp eax, 0xf58f6c34
je 0x40e060
cmp eax, 0xf7881380
jne 0x40e075
mov eax, dword [ebp - 0x18]
mov dword [eax], 0
mov dword [ebp - 0x38], 0xe14b5e5c
jmp 0x40d8a0
mov eax, dword [ebp - 0x18]
mov dword [eax], 0
mov dword [ebp - 0x38], 0xf7881380
jmp 0x40d8a0
cmp eax, 0xf79ba2d4
jne 0x40d8a0
mov dword [ebp - 0x38], 0xf7881380
jmp 0x40d8a0
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret