Function at 0x4aefa0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
mov eax, dword [esp + 8]
sub esp, 0x44
cmp eax, 1
push ebx
mov dword [esp + 8], 0
push esi
push edi
push ebp
je 0x4aefc7
cmp eax, 2
je 0x4aefe0
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x44
ret
mov esi, dword [esp + 0x58]
mov eax, dword [esi + 0x68]
mov ecx, dword [esi + 0xc]
add eax, 0x4a
cmp eax, ecx
jg 0x4aefda
mov eax, ecx
mov dword [esp + 0x1c], eax
jmp 0x4aeffb
mov esi, dword [esp + 0x58]
push 0
push 0
push esi
mov eax, dword [esi + 0x68]
add eax, 0x4a
mov dword [esp + 0x28], eax
call fcn.004ae020
add esp, 0xc
mov eax, dword [esi + 0x2e]
test eax, eax
je 0x4af017
mov ecx, dword [esi + 0x26]
push ecx
push eax
push esi
call fcn.004b0650
mov dword [esi + 0x2e], 0
add esp, 0xc
mov eax, dword [esi + 0x78]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov dword [esp + 0x10], eax
push 0x4ae1c0
mov eax, dword [esi + 0x7c]
mov edx, dword [esp + 0x14]
push eax
xor edi, edi
push edx
call fcn.004ae240
add esp, 0xc
mov edx, dword [esi + 0x7c]
test edx, edx
jle 0x4af058
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x1c]
cmp dword [eax], ecx
jge 0x4af058
add eax, 8
inc edi
cmp edi, edx
jl 0x4af048
cmp edi, edx
jl 0x4af070
mov eax, dword [esi + 0x78]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x44
ret
mov eax, dword [esi + 0x10]
sub eax, dword [esp + 0x1c]
cmp eax, 0x40000
jl 0x4af083
mov eax, 0x40000
push eax
push 0x200
call fcn.00489140
mov dword [esp + 0x20], eax
add esp, 8
test eax, eax
jne 0x4af0a6
mov dword [esp + 0x14], 8
jmp 0x4af235
mov edx, dword [esi + 8]
xor ebx, ebx
lea eax, [esi + 4]
mov dword [esp + 0x38], ebx
mov dword [esp + 0x40], ebx
mov ecx, dword [eax]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x3c], ebx
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x28], eax
mov dword [esp + 0x30], eax
lea ebp, [ecx + edi*8]
mov dword [esp + 0x2c], edx
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x34], edx
mov eax, dword [ebp]
push ecx
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], ebx
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x4c], eax
push ecx
call fcn.00489000
mov dword [esp + 0x54], eax
add esp, 4
mov dword [0x50e8ac], ebx
mov ebx, edi
cmp dword [esi + 0x7c], edi
jle 0x4af15f
add ebp, 4
cmp dword [esp + 0x14], 0
jne 0x4af17d
mov eax, dword [ebp - 4]
add eax, dword [ebp]
mov dword [esp + 0x38], eax
mov eax, dword [esi + 0x7c]
dec eax
cmp eax, ebx
jle 0x4af134
mov eax, dword [ebp + 4]
jmp 0x4af137
mov eax, dword [esi + 0x10]
sub eax, dword [esp + 0x38]
add ebp, 8
inc ebx
mov dword [esp + 0x40], eax
lea eax, [esp + 0x28]
push eax
push esi
call fcn.004af250
add esp, 8
mov eax, dword [0x50e8ac]
cmp dword [esi + 0x7c], ebx
mov dword [esp + 0x14], eax
jg 0x4af116
cmp dword [esp + 0x14], 0
jne 0x4af17d
lea eax, [esp + 0x28]
push eax
push esi
call fcn.004af310
add esp, 8
mov eax, dword [0x50e8ac]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [esp + 0x18]
push eax
call fcn.00488e40
add esp, 4
cmp dword [esp + 0x14], 0
jne 0x4af235
lea ebx, [edi + 1]
cmp dword [esi + 0x7c], ebx
jle 0x4af1bf
mov edx, dword [esp + 0x10]
lea eax, [edx + ebx*8 + 4]
mov ecx, dword [eax - 8]
add eax, 8
inc ebx
add dword [eax - 8], ecx
cmp dword [esi + 0x7c], ebx
jg 0x4af1b0
mov eax, dword [esi + 0x64]
xor ebx, ebx
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
cmp dword [esi + 0x2a], ebx
jle 0x4af20d
add eax, 0x18
mov ecx, dword [eax]
cmp dword [esp + 0x1c], ecx
jg 0x4af204
mov ebp, dword [esi + 0x7c]
dec ebp
cmp edi, ebp
jg 0x4af204
mov edx, dword [esp + 0x10]
lea edx, [edx + ebp*8]
cmp dword [edx], ecx
jle 0x4af1f6
sub edx, 8
dec ebp
cmp edi, ebp
jle 0x4af1ea
cmp edi, ebp
jg 0x4af204
mov edx, dword [esp + 0x10]
sub ecx, dword [edx + ebp*8 + 4]
mov dword [eax], ecx
add eax, 0x1e
inc ebx
cmp dword [esi + 0x2a], ebx
jg 0x4af1d3
mov eax, dword [esi + 0x64]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov edx, dword [esp + 0x10]
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0x7c]
sub eax, dword [edx + ecx*8 - 4]
push eax
mov dword [esi + 0x10], eax
push esi
call fcn.004afb10
add esp, 8
mov dword [esi + 0x7c], edi
mov eax, dword [esi + 0x78]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [esp + 0x14]
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x44
ret