Function at 0x474560
Capabilities:
Allocate or change rwx memory

Disassembly:
sub esp, 0x18
push ebx
push ebp
push esi
mov esi, dword [esp + 0x2c]
push edi
push 0x40
lea edi, [esi + esi*4]
push 0x1000
shl edi, 1
xor ebx, ebx
push edi
mov dword [esp + 0x1c], ecx
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ecx, edi
mov ebp, eax
mov edx, ecx
mov eax, 0x90909090
mov edi, ebp
mov dword [esp + 0x1c], ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
cmp esi, ebx
rep stosb byte es:[edi], al
jle 0x4745ea
mov eax, dword [esp + 0x2c]
lea esi, [ebx + eax]
push esi
call fcn.00473730
mov edx, dword [esp + 0x20]
mov ecx, eax
add ebx, eax
add esp, 4
lea edi, [edx + ebp]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x34]
mov esi, dword [esp + 0x1c]
lea edx, [eax + ecx]
mov eax, dword [esp + 0x30]
add esi, edx
cmp ebx, eax
mov dword [esp + 0x1c], esi
jl 0x4745a6
mov esi, eax
xor edi, edi
xor ebx, ebx
cmp esi, edi
mov dword [esp + 0x18], edi
jle 0x474754
mov eax, dword [esp + 0x2c]
lea esi, [ebx + eax]
push esi
call fcn.00473730
mov ecx, dword [esp + 0x14]
add esp, 4
mov dword [esp + 0x14], eax
push eax
push esi
call fcn.00474470
test eax, eax
jne 0x47465e
mov ecx, dword [esp + 0x14]
push ecx
push esi
mov esi, dword [esp + 0x18]
mov ecx, esi
call fcn.004744d0
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x20], eax
cmp eax, ecx
jb 0x474644
mov edx, dword [esp + 0x30]
add edx, ecx
cmp eax, edx
jb 0x474693
sub eax, edi
lea edx, [edi + ebx]
sub eax, ebx
lea ecx, [edx + ebp]
sub eax, ebp
sub eax, 5
mov byte [ecx], 0xe9
mov dword [ecx + 1], eax
jmp 0x474731
cmp eax, 1
je 0x47470e
cmp eax, 2
jne 0x4746df
mov eax, dword [esp + 0x14]
push eax
push esi
mov esi, dword [esp + 0x18]
mov ecx, esi
call fcn.004744d0
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x20], eax
cmp eax, ecx
jb 0x4746bf
mov edx, dword [esp + 0x30]
add edx, ecx
cmp eax, edx
jae 0x4746bf
push eax
push ecx
mov ecx, esi
call fcn.00474510
mov dl, byte [esp + 0x18]
mov cl, byte [esp + 0x2c]
sub al, dl
mov dl, byte [esp + 0x20]
imul byte [esp + 0x34]
sub al, cl
lea ecx, [edi + ebx]
sub al, bl
add al, dl
sub al, 2
mov byte [ecx + ebp + 1], al
jmp 0x474731
lea edx, [edi + ebx]
sub eax, edi
sub eax, ebx
mov cl, byte [edx + ebp]
lea esi, [edx + ebp]
sub eax, ebp
add cl, 0x10
mov byte [esi], 0xf
sub eax, 6
mov byte [esi + 1], cl
mov dword [esi + 2], eax
jmp 0x474731
cmp eax, 3
jne 0x474709
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push eax
push esi
call fcn.004744d0
mov ecx, 0xfffffffa
lea edx, [edi + ebx]
sub ecx, edi
sub ecx, ebx
sub ecx, ebp
add eax, ecx
mov dword [edx + ebp + 2], eax
jmp 0x474731
cmp eax, 4
jne 0x474731
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
push eax
push esi
call fcn.004744d0
mov ecx, 0xfffffffb
lea edx, [edi + ebx]
sub ecx, edi
sub ecx, ebx
sub ecx, ebp
add eax, ecx
mov dword [edx + ebp + 1], eax
mov ecx, dword [esp + 0x14]
mov esi, dword [esp + 0x18]
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x30]
add ebx, ecx
inc esi
add edi, edx
cmp ebx, eax
mov dword [esp + 0x18], esi
jl 0x4745fa
mov esi, eax
mov ebx, dword [esp + 0x2c]
lea eax, [esp + 0x24]
push eax
push 0x40
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov ecx, esi
mov eax, 0x90909090
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
mov edx, dword [esp + 0x24]
and ecx, 3
rep stosb byte es:[edi], al
mov eax, ebp
lea ecx, [esp + 0x24]
sub eax, ebx
push ecx
push edx
sub eax, 5
push esi
push ebx
mov byte [ebx], 0xe9
mov dword [ebx + 1], eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov eax, dword [esp + 0x1c]
pop edi
add ebp, eax
sub ebx, ebp
mov byte [ebp], 0xe9
lea ecx, [ebx + esi - 5]
pop esi
mov dword [ebp + 1], ecx
pop ebp
pop ebx
add esp, 0x18
ret 0xc