Function at 0x4d6681
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call

Disassembly:
sub esp, 0x10
mov eax, dword [esp + 0x14]
mov edx, dword [0x4e05c0]
push ebx
push ebp
push esi
push edi
xor esi, esi
sar eax, 5
mov dword [esp + 0x14], edx
mov edi, 0x20
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], edi
test eax, eax
je 0x4d66f2
jmp 0x4d66b1
inc esi
add edi, edi
shr eax, 1
mov ecx, esi
jne 0x4d66b1
mov dword [esp + 0x10], esi
mov dword [esp + 0x18], edi
cmp ecx, 0x1b
jl 0x4d66f2
push str.TWINBASIC_COMPILER_ERROR:_codegen_memory_block_request_too_large.
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov esi, eax
push 0
push esi
call fcn.00408d89
push esi
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
push 0x3e8
call esi
jmp 0x4d66e9
mov ebp, dword [sym.imp.KERNEL32.dll_Sleep]
lea ebx, [edx + 0x18]
lea ebx, [ebx + esi*4]
lea ecx, [ecx]
mov ecx, dword [ebx]
test ecx, ecx
je 0x4d6729
cmp ecx, 0xffffffff
jne 0x4d6712
push 0
call ebp
jmp 0x4d6723
or edx, 0xffffffff
mov eax, ecx
lock cmpxchg dword [ebx], edx
cmp eax, ecx
je 0x4d687a
mov ecx, dword [ebx]
test ecx, ecx
jne 0x4d6707
call fcn.004d6912
mov edx, eax
mov dword [esp + 0x1c], edx
mov ecx, dword [edx + 0x1ba]
cmp edi, ecx
jbe 0x4d68a6
test ecx, ecx
je 0x4d67fe
shr ecx, 5
xor edi, edi
test ecx, ecx
je 0x4d6758
inc edi
shr ecx, 1
jne 0x4d6753
mov eax, dword [edx + 0x1b6]
mov edx, 0x1f
shr eax, 5
push 8
push 8
lea ecx, [eax + eax*4]
mov eax, edi
mov esi, ecx
and eax, 0x1f
and ecx, 7
shr esi, 3
add esi, dword [esp + 0x1c]
shl dx, cl
not dx
shl ax, cl
and dx, word [esi + 0x84]
or dx, ax
mov word [esi + 0x84], dx
push dword [0x4e05c4]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
je 0x4d67b3
xor eax, eax
mov dword [esi], eax
mov dword [esi + 4], eax
jmp 0x4d67b5
xor esi, esi
mov eax, dword [esp + 0x1c]
mov eax, dword [eax + 0x1b6]
mov dword [esi + 4], eax
mov eax, dword [esp + 0x14]
add eax, 0x18
lea edi, [eax + edi*4]
jmp 0x4d67d1
mov edx, dword [edi]
cmp edx, 0xffffffff
jne 0x4d67de
push 0
call ebp
jmp 0x4d67d1
mov dword [esi], edx
mov ecx, esi
mov eax, edx
lock cmpxchg dword [edi], ecx
cmp eax, edx
jne 0x4d67d1
mov eax, dword [esp + 0x1c]
mov edi, dword [esp + 0x18]
mov dword [eax + 0x1ba], 0
mov eax, edi
mov esi, edi
and eax, 0x1ffffff
je 0x4d6811
sub esi, eax
add esi, 0x2000000
push 0x40
push 0x3000
push esi
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
jne 0x4d6892
mov esi, dword [esp + 0x10]
add edi, edi
inc esi
mov dword [esp + 0x18], edi
add ebx, 4
mov dword [esp + 0x10], esi
cmp esi, 0x1b
jl 0x4d6701
mov eax, dword [esp + 0x14]
cmp byte [eax + 0x14], 0
jne 0x4d6871
push str.TWINBASIC_COMPILER_ERROR:_codegen_memory_block_is_fragmented.__Please_restart_the_compiler.
mov byte [eax + 0x14], 1
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov esi, eax
push 0
push esi
call fcn.00408d89
push esi
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
lea esp, [esp]
push 0x3e8
call ebp
jmp 0x4d6871
mov eax, dword [ecx]
push ecx
mov dword [ebx], eax
mov esi, dword [ecx + 4]
push 0
push dword [0x4e05c4]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x4d68f7
mov edx, dword [esp + 0x1c]
mov dword [edx + 0x1ba], esi
mov esi, dword [esp + 0x10]
mov dword [edx + 0x1b6], eax
mov eax, dword [edx + 0x1b6]
mov ebp, 0x1f
mov ebx, dword [esp + 0x14]
and esi, 0x1f
shr eax, 5
lea ecx, [eax + eax*4]
mov eax, ecx
and ecx, 7
shr eax, 3
shl bp, cl
not bp
shl si, cl
and bp, word [eax + ebx + 0x84]
or bp, si
mov word [eax + ebx + 0x84], bp
mov esi, dword [edx + 0x1b6]
sub dword [edx + 0x1ba], edi
lea eax, [esi + edi]
mov dword [edx + 0x1b6], eax
mov ecx, dword [esp + 0x24]
test ecx, ecx
je 0x4d6906
mov edx, esi
call fcn.004d6677
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 4