Function at 0x477a10
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 0x10]
push ebx
push edi
xor edi, edi
mov dword [ebp - 4], edi
cmp eax, edi
je 0x477a26
mov dword [eax], edi
mov eax, dword [ebp + 0x14]
cmp eax, edi
je 0x477a2f
mov dword [eax], edi
mov ebx, dword [ebp + 0x18]
cmp ebx, edi
je 0x477a38
mov dword [ebx], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x5614f0], eax
je 0x477a53
pop edi
mov eax, 0x10dd
pop ebx
mov esp, ebp
pop ebp
ret 0x14
mov eax, dword [0x5614f4]
cmp eax, edi
jne 0x477d61
mov ecx, dword [ebp + 8]
cmp ecx, edi
jne 0x477a74
pop edi
mov eax, 6
pop ebx
mov esp, ebp
pop ebp
ret 0x14
push esi
mov esi, dword [ecx]
cmp esi, edi
jne 0x477a94
pop esi
mov eax, 6
pop edi
mov dword [0x5614f4], eax
mov dword [0x5614f8], ecx
pop ebx
mov esp, ebp
pop ebp
ret 0x14
cmp byte [esi], 0xff
mov dword [ebp - 8], edi
mov dword [ebp - 0x10], edi
jne 0x477ab7
cmp byte [esi + 1], 0x25
jne 0x477ab7
mov edi, dword [esi + 2]
mov edx, edi
mov ecx, esi
call fcn.00477010
test al, al
je 0x477ab7
mov esi, dword [edi]
cmp byte [esi], 0xeb
jne 0x477aef
movsx eax, byte [esi + 1]
lea esi, [esi + eax + 2]
mov al, byte [esi]
cmp al, 0xff
jne 0x477ae4
cmp byte [esi + 1], 0x25
jne 0x477ae4
mov edi, dword [esi + 2]
mov edx, edi
mov ecx, esi
call fcn.00477010
test al, al
je 0x477aef
mov esi, dword [edi]
jmp 0x477aef
cmp al, 0xe9
jne 0x477aef
mov ecx, dword [esi + 1]
lea esi, [esi + ecx + 5]
mov ecx, dword [ebp + 0xc]
mov edi, ecx
test ecx, ecx
jne 0x477aff
xor eax, eax
mov dword [ebp + 0xc], eax
jmp 0x477b5c
cmp byte [ecx], 0xff
jne 0x477b1a
cmp byte [ecx + 1], 0x25
jne 0x477b1a
mov ebx, dword [ecx + 2]
mov edx, ebx
call fcn.00477010
test al, al
je 0x477b1a
mov edi, dword [ebx]
cmp byte [edi], 0xeb
jne 0x477b54
movsx edx, byte [edi + 1]
mov al, byte [edi + edx + 2]
lea edi, [edi + edx + 2]
cmp al, 0xff
jne 0x477b49
cmp byte [edi + 1], 0x25
jne 0x477b49
mov ebx, dword [edi + 2]
mov edx, ebx
mov ecx, edi
call fcn.00477010
test al, al
je 0x477b54
mov edi, dword [ebx]
jmp 0x477b54
cmp al, 0xe9
jne 0x477b54
mov eax, dword [edi + 1]
lea edi, [edi + eax + 5]
mov ebx, dword [ebp + 0x18]
mov dword [ebp + 0xc], edi
mov eax, edi
cmp eax, esi
jne 0x477b72
cmp dword [0x5614e8], 0
jne 0x477d54
jmp 0x477d23
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x477b7b
mov dword [ecx], esi
test ebx, ebx
je 0x477b81
mov dword [ebx], eax
push 0x18
call sub.MSVCR100.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x477b9e
mov dword [ebp - 4], 8
jmp 0x477d23
mov eax, esi
call fcn.00477320
mov dword [ebp - 8], eax
test eax, eax
jne 0x477bb8
mov dword [ebp - 4], 8
jmp 0x477d23
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x477bc1
mov dword [ecx], eax
xor ecx, ecx
mov dword [eax + 0x38], ecx
mov dword [eax + 0x3c], ecx
mov ebx, eax
add eax, 0x1e
mov edi, esi
mov dword [ebp - 0x18], eax
mov dword [ebp - 0xc], eax
jmp 0x477bdb
mov ebx, dword [ebp + 0x18]
lea ecx, [ebp + 0x14]
push ecx
push 0
push edi
lea edx, [ebp - 0xc]
push edx
push ebx
mov dword [ebp - 4], edi
mov dword [ebp + 0x14], 0
call fcn.00476c60
mov edi, eax
mov eax, dword [ebp + 0x14]
sub eax, dword [ebp - 4]
add eax, edi
add ebx, eax
mov eax, dword [ebp - 8]
mov dword [ebp + 0x18], ebx
mov cl, byte [ebp + 0x18]
sub cl, al
add cl, cl
mov ebx, edi
sub ebx, esi
add cl, cl
mov dl, bl
add cl, cl
and dl, 7
xor cl, dl
mov byte [eax + 0x38], cl
mov eax, dword [ebp - 4]
push eax
call fcn.00477100
add esp, 4
test eax, eax
jne 0x477c38
cmp ebx, 5
jb 0x477bd8
jmp 0x477c5a
cmp ebx, 5
jae 0x477c5a
lea ecx, [ecx]
cmp byte [edi], 0x90
jne 0x477c51
inc edi
mov ebx, edi
sub ebx, esi
cmp ebx, 5
jb 0x477c40
jmp 0x477c5a
cmp ebx, 5
jb 0x477d13
mov eax, dword [ebp + 0x18]
cmp eax, dword [ebp - 0xc]
jbe 0x477c63
int3
mov ecx, dword [ebp - 8]
mov edi, dword [ebp - 0x18]
sub al, cl
push ebx
mov byte [ecx + 0x36], bl
add ecx, 0x20
push esi
push ecx
mov byte [edi], al
call sub.MSVCR100.dll_memcpy
add esp, 0xc
cmp ebx, 0x19
jbe 0x477c8f
mov dword [ebp - 4], 6
jmp 0x477d23
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 0xc]
mov dword [edx + 0x44], eax
movzx eax, byte [edi]
add eax, edx
lea ecx, [esi + ebx]
mov dword [edx + 0x40], ecx
lea edx, [eax + 5]
mov byte [eax], 0xe9
sub ecx, edx
mov dword [eax + 1], ecx
mov ecx, dword [ebp - 0xc]
push ecx
add eax, 5
push eax
call fcn.004770d0
add esp, 8
lea edx, [ebp - 0x14]
push edx
push 0x40
push ebx
xor edi, edi
push esi
mov dword [ebp - 0x14], edi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x477ce0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 4], eax
jmp 0x477d23
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 8]
mov dword [eax + 0xc], esi
mov dword [eax + 4], edi
mov dword [eax + 0x10], edx
mov edx, dword [0x561500]
mov dword [eax + 8], ecx
mov ecx, dword [ebp - 0x14]
pop esi
pop edi
mov dword [eax + 0x14], ecx
mov dword [eax], edx
mov dword [0x561500], eax
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 0x14
cmp dword [0x5614e8], 0
mov dword [ebp - 4], 9
jne 0x477d2b
mov eax, dword [ebp - 4]
mov dword [0x5614f4], eax
mov edi, dword [ebp - 8]
test edi, edi
je 0x477d44
call fcn.004774b0
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x477d44
mov dword [eax], 0
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x477d54
push eax
call sub.MSVCR100.dll_void___cdecl_operator_delete_void__
add esp, 4
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 4]
mov dword [0x5614f8], ecx
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret 0x14