Function at 0x4012cf
Capabilities:
Allocate or change rwx memory

Disassembly:
pop eax
and eax, esp
call 0x40120d
dec eax
pop eax
xor eax, esi
pop eax
mov esi, dword [ebp + 8]
test esi, esi
jne 0x401221
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebx
call 0x401228
dec ebx
pop ebx
or ebx, edx
call 0x401231
dec ebx
pop ebx
sbb ebx, ebp
pop ebx
mov eax, 0xdead
cmp word [esi], ax
je 0x40124b
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ecx
call 0x401252
dec ecx
pop ecx
call 0x401259
dec ecx
pop ecx
or ecx, ebp
add ecx, ebx
pop ecx
xor eax, eax
xor edx, edx
cmp ax, word [esi + 8]
jae 0x4012c1
xor edi, edi
jmp 0x401270
push esi
sbb esi, ebp
and esi, ebx
call 0x40127b
inc esi
pop esi
cmp eax, esi
jne 0x401281
dec esi
sbb esi, esp
pop esi
movzx eax, dx
lea eax, [eax + eax*4]
add eax, dword [esi + 0xc]
mov ecx, dword [esi + eax*4 + 0x28]
test ecx, ecx
je 0x4012b4
mov eax, dword [esi + eax*4 + 0x24]
add eax, ecx
cmp edi, eax
cmovbe edi, eax
push ecx
call 0x4012a7
dec ecx
pop ecx
call 0x4012ae
dec ecx
pop ecx
xor ecx, edx
or ecx, esp
pop ecx
inc edx
cmp dx, word [esi + 8]
jb 0x401270
mov dword [ebp - 8], edi
mov edi, dword [ebp + 0xc]
push ebp
call 0x4012c8
dec ebp
pop ebp
call 0x4012cf
dec ebp
pop ebp
sbb ebp, edi
xor ebp, esp
pop ebp
push 0x40
push 0x3000
push dword [ebp - 8]
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [edi + 8], eax
mov dword [edi + 4], eax
push edi
add edi, edx
call 0x4012f6
dec edi
pop edi
sbb edi, ebx
jmp 0x4012fd
and edi, esi
inc edi
pop edi
cmp dword [edi + 8], 0
jne 0x401313
mov eax, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [ebp + 0x10], 0
je 0x401337
movzx eax, word [esi + 8]
lea eax, [eax + eax*4]
add eax, dword [esi + 0xc]
lea eax, [eax*4 + 0x24]
push eax
push esi
push dword [edi + 4]
call fcn.00402140
add esp, 0xc
push ebx
sbb ebx, ebx
call 0x401340
inc ebx
pop ebx
xor ebx, ebx
or ebx, edx
or ebx, esp
add ebx, esp
nop
pop ebx
xor edx, edx
xor eax, eax
mov dword [ebp - 8], edx
cmp ax, word [esi + 8]
jae 0x4013be
push esi
call 0x40135f
dec esi
pop esi
or esi, esi
sbb esi, ebp
sbb esi, esi
sbb esi, ebx
add esi, edx
nop
pop esi
movzx eax, dx
lea eax, [eax + eax*4]
add eax, dword [esi + 0xc]
mov edx, dword [esi + eax*4 + 0x28]
lea ecx, [esi + eax*4]
cmp dword [ecx + 0x30], edx
cmovb edx, dword [ecx + 0x30]
test edx, edx
je 0x401404
mov eax, dword [ecx + 0x2c]
add eax, esi
push edx
push eax
mov eax, dword [edi + 4]
add eax, dword [ecx + 0x24]
push eax
call fcn.00402140
add esp, 0xc
push edx
call 0x4013a4
dec edx
pop edx
call 0x4013ab
dec edx
pop edx
or edx, esp
and edx, edx
pop edx
mov edx, dword [ebp - 8]
inc edx
mov dword [ebp - 8], edx
cmp dx, word [esi + 8]
jb 0x401358
push eax
call 0x4013c5
dec eax
pop eax
call 0x4013cc
dec eax
pop eax
or eax, edi
xor eax, eax
pop eax
mov eax, dword [edi + 4]
cmp eax, dword [esi + 4]
je 0x401544
push ebp
or ebp, esi
and ebp, eax
add ebp, edi
add ebp, eax
xor ebp, ebx
cmp eax, ebp
jne 0x4013ee
dec ebp
add ebp, esp
nop
pop ebp
test byte [esi + 2], 1
je 0x401410
mov eax, 2
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 3
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
add edi, esp
and edi, ecx
sbb edi, edx
or edi, ecx
call 0x40141f
dec edi
pop edi
or edi, edx
nop
pop edi
cmp dword [esi + 0x1c], 0
je 0x401668
cmp dword [esi + 0x20], 0
je 0x401668
push ebx
call 0x40143f
dec ebx
pop ebx
call 0x401446
dec ebx
pop ebx
or ebx, ecx
sbb ebx, ecx
pop ebx
mov edx, dword [esi + 0x1c]
mov eax, dword [esi + 0x20]
add edx, dword [edi + 4]
add eax, 0xfffffff8
add eax, edx
mov dword [ebp - 8], edx
mov dword [ebp - 0xc], eax
push ebp
xor ebp, ebp
add ebp, esi
call 0x40146b
dec ebp
pop ebp
sbb ebp, edi
add ebp, ecx
and ebp, edi
nop
pop ebp
cmp edx, dword [ebp - 0xc]
jae 0x401530
lea ecx, [ecx]
push ecx
call 0x401487
inc ecx
pop ecx
add ecx, ebx
or ecx, eax
xor ecx, ebx
add ecx, esi
sbb ecx, esp
nop
pop ecx
mov edi, dword [edx + 4]
lea eax, [edx + 4]
sub edi, 8
mov dword [ebp - 0x10], eax
shr edi, 1
lea esi, [edx + 8]
je 0x401508
push ebx
xor ebx, ebx
call 0x4014b0
dec ebx
pop ebx
and ebx, ebx
jmp 0x4014b7
and ebx, ebx
nop
pop ebx
movzx edx, word [esi]
mov eax, edx
and eax, 0xf000
cmp eax, 0x3000
jne 0x4014e8
mov eax, dword [ebp + 0xc]
and edx, 0xfff
mov ebx, dword [ebp + 8]
mov ecx, dword [eax + 4]
add edx, ecx
mov eax, dword [ebp - 8]
sub ecx, dword [ebx + 4]
mov eax, dword [eax]
add dword [edx + eax], ecx
push eax
or eax, esp
xor eax, esi
xor eax, esi
call 0x4014f5
dec eax
pop eax
sbb eax, ebx
add eax, ecx
nop
pop eax
add esi, 2
dec edi
jne 0x4014a7
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x10]
add edx, dword [eax]
mov dword [ebp - 8], edx
push esi
and esi, edi
call 0x401516
dec esi
pop esi
call 0x40151d
dec esi
pop esi
sbb esi, esi
pop esi
cmp edx, dword [ebp - 0xc]
jb 0x401480
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
push edx
xor edx, eax
call 0x401539
inc edx
pop edx
call 0x401540
inc edx
pop edx
and edx, ebp
pop edx
push ebp
call 0x40154b
dec ebp
pop ebp
xor ebp, ecx
call 0x401554
dec ebp
pop ebp
and ebp, eax
pop ebp
cmp dword [esi + 0x14], 0
je 0x4016f3
cmp dword [esi + 0x18], 0
je 0x4016f3
push ecx
xor ecx, edi
add ecx, esp
call 0x401577
dec ecx
pop ecx
jmp 0x40157c
and ecx, ebp
inc ecx
pop ecx
mov edx, dword [edi + 4]
add edx, dword [esi + 0x14]
mov dword [ebp - 8], edx
push ebx
add ebx, ebp
or ebx, ebx
or ebx, ebx
call 0x401596
dec ebx
pop ebx
jmp 0x40159b
nop
pop ebx
cmp dword [edx + 0xc], 0
je 0x4016dc
push edi
and edi, esi
call 0x4015b0
inc edi
pop edi
or edi, edi
or edi, ecx
cmp eax, edi
jne 0x4015ba
dec edi
pop edi
mov eax, dword [edi + 4]
add eax, dword [edx + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x10], eax
test eax, eax
je 0x4016d0
push edx
call 0x4015da
dec edx
pop edx
call 0x4015e1
dec edx
pop edx
and edx, ebp
and edx, esp
pop edx
mov edx, dword [ebp - 8]
mov esi, dword [edx + 0x10]
add esi, dword [edi + 4]
cmp dword [edx + 4], 0
mov dword [ebp + 0xc], esi
je 0x401630
push edi
xor edi, esp
call 0x401602
dec edi
pop edi
call 0x401609
dec edi
pop edi
add edi, eax
pop edi
mov eax, dword [edx]
test eax, eax
je 0x4016c4
mov esi, dword [edi + 4]
add esi, eax
push ebp
add ebp, eax
and ebp, ecx
call 0x401627
dec ebp
pop ebp
jmp 0x40162c
add ebp, ebp
nop
pop ebp
push eax
sbb eax, ecx
call 0x401639
inc eax
pop eax
call 0x401640
inc eax
pop eax
sbb eax, esp
pop eax
sub dword [ebp + 0xc], esi
push ebx
call 0x40164e
dec ebx
pop ebx
xor ebx, ebx
call 0x401657
dec ebx
pop ebx
and ebx, esi
pop ebx
mov ecx, dword [esi]
test ecx, ecx
je 0x4016a5
jns 0x401674
movzx eax, cx
jmp 0x40167c
mov eax, 5
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 4]
add eax, 2
add eax, ecx
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ecx, dword [ebp + 0xc]
mov dword [ecx + esi], eax
push eax
call 0x401693
dec eax
pop eax
and eax, eax
call 0x40169c
dec eax
pop eax
or eax, esi
pop eax
add esi, 4
jmp 0x401647
push ecx
call 0x4016ac
dec ecx
pop ecx
sbb ecx, ebp
call 0x4016b5
dec ecx
pop ecx
xor ecx, ebp
pop ecx
mov edx, dword [ebp - 8]
add edx, 0x14
jmp 0x401586
mov eax, 0xd
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 0xc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push ebp
call 0x4016e3
inc ebp
pop ebp
add ebp, edx
add ebp, ebp
cmp eax, ebp
jne 0x4016ed
dec ebp
xor ebp, ecx
pop ebp
mov esi, dword [ebp + 8]
push eax
sbb eax, esi
xor eax, edi
call 0x4016fe
dec eax
pop eax
and eax, esi
jmp 0x401706
pop eax
mov dword [ebp - 4], 0
push ebp
or ebp, edi
call 0x401717
dec ebp
pop ebp
call 0x40171e
dec ebp
pop ebp
add ebp, esi
pop ebp
xor edx, edx
xor eax, eax
mov dword [ebp + 0xc], edx
cmp ax, word [esi + 8]
jae 0x40181b
push edx
and edx, edx
xor edx, ebp
call 0x40173e
dec edx
pop edx
and edx, ebp
jmp 0x401745
inc edx
pop edx
movzx eax, dx
lea eax, [eax + eax*4]
add eax, dword [esi + 0xc]
lea edx, [esi + eax*4]
push esi
call 0x40175a
inc esi
pop esi
call 0x401761
inc esi
pop esi
and esi, eax
add esi, esp
pop esi
mov eax, dword [edx + 0x34]
test al, 0x20
je 0x401776
or eax, 0x60000000
mov dword [edx + 0x34], eax
push ecx
xor ecx, ecx
call 0x40177f
dec ecx
pop ecx
call 0x401786
dec ecx
pop ecx
or ecx, esp
pop ecx
mov eax, dword [edx + 0x34]
shr eax, 0x1d
cmp eax, 6
ja case.0x401795.5
jmp dword [eax*4 + 0x401848]
mov dword [ebp - 4], 0x10
jmp 0x4017c7
mov dword [ebp - 4], 2
jmp 0x4017c7
mov dword [ebp - 4], 0x20
jmp 0x4017c7
mov dword [ebp - 4], 4
jmp 0x4017c7
mov dword [ebp - 4], 0x40
push esi
xor esi, edx
call 0x4017d0
dec esi
pop esi
add esi, ebx
or esi, ecx
jmp 0x4017da
pop esi
lea eax, [ebp - 4]
push eax
push dword [ebp - 4]
mov eax, dword [edx + 0x24]
push dword [edx + 0x28]
add eax, dword [edi + 4]
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x401839
push edi
call 0x4017fd
dec edi
pop edi
add edi, edi
call 0x401806
dec edi
pop edi
add edi, esp
pop edi
mov edx, dword [ebp + 0xc]
inc edx
mov dword [ebp + 0xc], edx
cmp dx, word [esi + 8]
jb 0x401733
push ebx
call 0x401822
inc ebx
pop ebx
add ebx, esp
xor ebx, ebx
cmp eax, ebx
jne 0x40182c
dec ebx
sbb ebx, edi
pop ebx
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0xf
pop ebx
mov esp, ebp
pop ebp
ret