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

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x5d6240
push eax
mov dword fs:[0], esp
sub esp, 0x20
push ebx
mov ebx, ecx
push edi
xor edi, edi
mov eax, dword [ebx + 0x70]
cmp eax, edi
je 0x5023db
mov ecx, dword [esp + 0x3c]
cmp dword [ecx + 8], eax
jne 0x5023db
push ebp
push esi
lea ecx, [esp + 0x1c]
call fcn.00460670
push 0xa
push edi
lea ecx, [esp + 0x24]
mov dword [esp + 0x40], edi
mov dword [esp + 0x24], 0x5e2810
call fcn.0046d900
mov edx, dword [ebx + 0x70]
push 0xffffffffffffffff
push edx
lea ecx, [esp + 0x24]
mov dword [esp + 0x40], 1
call fcn.0046d900
mov eax, dword [ebx + 0x70]
mov edx, dword [ebx + 0x6c]
mov ecx, dword [esp + 0x20]
mov esi, eax
dec eax
test esi, esi
je 0x5021bf
inc eax
mov esi, dword [edx]
add edx, 4
mov dword [ecx], esi
add ecx, 4
dec eax
jne 0x5021b2
mov eax, dword [esp + 0x40]
mov ebp, dword [eax + 8]
cmp ebp, edi
jne 0x5021e8
mov eax, dword [ebx + 0x6c]
cmp eax, edi
je 0x5021dd
push eax
call sub.mfc42u.dll_operatordelete
add esp, 4
mov dword [ebx + 0x6c], edi
mov dword [ebx + 0x74], edi
mov dword [ebx + 0x70], edi
jmp 0x5022d2
mov ecx, dword [ebx + 0x6c]
cmp ecx, edi
jne 0x502214
lea ecx, [ebp*4]
push ecx
call sub.mfc42u.dll_operatornew
add esp, 4
mov dword [ebx + 0x6c], eax
push ebp
push eax
call fcn.005463a0
mov dword [ebx + 0x74], ebp
mov dword [ebx + 0x70], ebp
jmp 0x5022d2
mov esi, dword [ebx + 0x74]
cmp ebp, esi
jg 0x502238
mov eax, dword [ebx + 0x70]
cmp ebp, eax
jle 0x502230
mov edx, ebp
sub edx, eax
lea eax, [ecx + eax*4]
push edx
push eax
call fcn.005463a0
mov dword [ebx + 0x70], ebp
jmp 0x5022d2
mov eax, dword [ebx + 0x78]
cmp eax, edi
jne 0x502263
mov eax, dword [ebx + 0x70]
cdq
and edx, 7
add eax, edx
sar eax, 3
cmp eax, 4
jge 0x502257
mov eax, 4
jmp 0x502263
cmp eax, 0x400
jle 0x502263
mov eax, 0x400
add eax, esi
cmp ebp, eax
mov dword [esp + 0x10], eax
jl 0x502271
mov dword [esp + 0x10], ebp
mov ecx, dword [esp + 0x10]
lea edx, [ecx*4]
push edx
call sub.mfc42u.dll_operatornew
mov ecx, dword [ebx + 0x70]
mov esi, dword [ebx + 0x6c]
shl ecx, 2
mov edx, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, ebp
and ecx, 3
add esp, 4
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebx + 0x70]
mov dword [esp + 0x14], eax
sub edx, ecx
lea eax, [eax + ecx*4]
push edx
push eax
call fcn.005463a0
mov eax, dword [ebx + 0x6c]
push eax
call sub.mfc42u.dll_operatordelete
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
add esp, 4
mov dword [ebx + 0x6c], ecx
mov dword [ebx + 0x70], ebp
mov dword [ebx + 0x74], edx
xor edi, edi
mov eax, dword [esp + 0x40]
mov dword [esp + 0x10], edi
cmp dword [eax + 8], edi
jle 0x5023b5
mov ebp, dword [sym.imp.msvcrt.dll_wcscmp]
mov ecx, dword [esp + 0x10]
lea edx, [esp + 0x14]
push ecx
mov ecx, dword [esp + 0x44]
push edx
call fcn.0041c4a0
mov edi, eax
mov eax, dword [esp + 0x44]
mov esi, dword [eax + 8]
dec esi
js 0x502325
mov ecx, dword [esp + 0x44]
mov edx, dword [ecx + 4]
mov ecx, dword [edi]
push ecx
lea eax, [edx + esi*4]
mov eax, dword [edx + esi*4]
push eax
call ebp
add esp, 8
test eax, eax
je 0x502328
dec esi
jns 0x502308
or esi, 0xffffffff
lea ecx, [esp + 0x14]
call sub.mfc42u.dll_CString::CString
cmp esi, 0xffffffff
je 0x50238f
mov edx, dword [esp + 0x20]
mov eax, dword [edx + esi*4]
cmp eax, 0xffffffff
je 0x50238f
mov ecx, dword [esp + 0x48]
cmp eax, dword [ecx + 8]
jge 0x50238f
lea edx, [esp + 0x18]
push eax
push edx
call fcn.0041c4a0
mov esi, dword [ebx + 0x5c]
mov edi, eax
dec esi
js 0x502377
mov eax, dword [ebx + 0x58]
mov ecx, dword [edi]
push ecx
mov ecx, dword [eax + esi*4]
lea eax, [eax + esi*4]
push ecx
call ebp
add esp, 8
test eax, eax
je 0x50237a
dec esi
jns 0x50235e
or esi, 0xffffffff
lea ecx, [esp + 0x18]
call sub.mfc42u.dll_CString::CString
mov edx, dword [ebx + 0x6c]
mov eax, dword [esp + 0x10]
mov dword [edx + eax*4], esi
jmp 0x50239d
mov ecx, dword [ebx + 0x6c]
mov edx, dword [esp + 0x10]
mov dword [ecx + edx*4], 0xffffffff
mov ecx, dword [esp + 0x40]
mov eax, dword [esp + 0x10]
inc eax
mov edx, dword [ecx + 8]
mov dword [esp + 0x10], eax
cmp eax, edx
jl 0x5022e9
lea ecx, [esp + 0x1c]
mov dword [esp + 0x38], 0xffffffff
call fcn.0040a6c0
pop esi
pop ebp
pop edi
pop ebx
mov ecx, dword [esp + 0x20]
mov dword fs:[0], ecx
add esp, 0x2c
ret 0xc
mov edx, dword [esp + 0x38]
mov ecx, ebx
push edx
call fcn.00501fb0
mov ecx, dword [esp + 0x28]
pop edi
pop ebx
mov dword fs:[0], ecx
add esp, 0x2c
ret 0xc