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

Disassembly:
sub esp, 0x4ac
mov eax, dword [esp + 0x4b0]
push ebx
push ebp
push esi
xor ebp, ebp
push edi
push ebp
push eax
lea ecx, [esp + 0x78]
call fcn.004b4ed0
mov edx, dword [esp + 0x70]
lea ecx, [esp + 0x34]
push 4
push ecx
lea ecx, [esp + 0x78]
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x20], ebp
call dword [edx + 0x3c]
mov edx, dword [esp + 0x70]
lea eax, [esp + 0x18]
push 4
push eax
lea ecx, [esp + 0x78]
call dword [edx + 0x3c]
mov edx, dword [esp + 0x70]
lea eax, [esp + 0x24]
push 4
push eax
lea ecx, [esp + 0x78]
call dword [edx + 0x3c]
mov eax, dword [esp + 0x18]
mov esi, 6
cmp eax, esi
jle 0x4d9a02
lea eax, [esp + 0x10]
lea ecx, [esp + 0x70]
push eax
call sub.mfc42u.dll_CFile::GetFileName
mov ecx, dword [esp + 0x10]
push ecx
push 0xffffffffffffffff
push 1
call sub.mfc42u.dll_AfxThrowFileException
lea ecx, [esp + 0x10]
call sub.mfc42u.dll_CString::CString
mov ebx, dword [esp + 0x18]
mov ecx, dword [esp + 0x4cc]
cmp ebx, 4
mov eax, dword [ecx]
setg dl
mov byte [esp + 0x80], dl
lea edx, [esp + 0x70]
push edx
call dword [eax + 8]
cmp dword [esp + 0x18], 3
jle 0x4d9ac5
lea eax, [esp + 0x2c]
push 8
push eax
lea ecx, [esp + 0x78]
call sub.mfc42u.dll_CFile::Read
cmp eax, 8
jae 0x4d9a76
mov edx, dword [esp + 0x70]
lea ecx, [esp + 0x10]
push ecx
lea ecx, [esp + 0x74]
call dword [edx + 0x18]
mov eax, dword [esp + 0x70]
lea ecx, [esp + 0x70]
call dword [eax + 0x54]
mov ecx, dword [esp + 0x10]
push ecx
push 0xffffffffffffffff
push 1
call sub.mfc42u.dll_AfxThrowFileException
lea ecx, [esp + 0x10]
call sub.mfc42u.dll_CString::CString
mov eax, dword [esp + 0x70]
lea edx, [esp + 0x14]
push 4
push edx
lea ecx, [esp + 0x78]
call dword [eax + 0x3c]
lea ecx, [esp + 0x44]
call sub.mfc42u.dll_CString::CString_3
mov eax, dword [esp + 0x14]
xor edi, edi
cmp eax, ebp
jbe 0x4d9abc
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x70]
cmp ecx, esi
setl cl
push ecx
push edx
lea ecx, [esp + 0x40]
call fcn.004ffdf0
mov eax, dword [esp + 0x14]
inc edi
cmp edi, eax
jb 0x4d9a9b
lea ecx, [esp + 0x44]
call sub.mfc42u.dll_CString::CString
cmp dword [esp + 0x18], 2
jle 0x4d9af0
mov edx, dword [esp + 0x70]
lea eax, [esp + 0x14]
push 4
push eax
lea ecx, [esp + 0x78]
call dword [edx + 0x3c]
mov edx, dword [esp + 0x70]
lea eax, [esp + 0x2c]
push 4
push eax
lea ecx, [esp + 0x78]
call dword [edx + 0x3c]
lea eax, [esp + 0x484]
push 0x38
push eax
lea ecx, [esp + 0x78]
call sub.mfc42u.dll_CFile::Read
cmp eax, 0x38
jae 0x4d9b3a
mov edx, dword [esp + 0x70]
lea ecx, [esp + 0x10]
push ecx
lea ecx, [esp + 0x74]
call dword [edx + 0x18]
mov eax, dword [esp + 0x70]
lea ecx, [esp + 0x70]
call dword [eax + 0x54]
mov ecx, dword [esp + 0x10]
push ecx
push 0xffffffffffffffff
push 1
call sub.mfc42u.dll_AfxThrowFileException
lea ecx, [esp + 0x10]
call sub.mfc42u.dll_CString::CString
mov eax, dword [esp + 0x70]
lea edx, [esp + 0x14]
push 4
push edx
lea ecx, [esp + 0x78]
call dword [eax + 0x3c]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x28], ebp
cmp eax, ebp
jbe 0x4d9d2d
mov ebx, dword [esp + 0x4c8]
push 0x368
call sub.mfc42u.dll_operatornew
add esp, 4
cmp eax, ebp
je 0x4d9b83
mov ecx, eax
call fcn.004e62c0
mov esi, eax
mov dword [esp + 0x10], esi
jmp 0x4d9b89
mov dword [esp + 0x10], ebp
mov esi, ebp
mov edx, dword [esi + 0xc0]
lea ecx, [esi + 0xc0]
lea eax, [esp + 0x70]
push eax
call dword [edx + 0x4c]
mov eax, dword [esp + 0x4c4]
cmp eax, 1
jne 0x4d9be3
cmp dword [esi + 0x1ac], ebp
jne 0x4d9bfb
mov edx, dword [ebx + 8]
mov eax, dword [ebx + 4]
mov ebp, edx
xor edi, edi
mov dword [esp + 0x2c], ebp
inc ebp
cmp ebp, edi
jne 0x4d9c11
cmp eax, edi
je 0x4d9bd8
push eax
mov dword [esp + 0x24], edx
call sub.mfc42u.dll_operatordelete
add esp, 4
mov dword [ebx + 4], edi
mov dword [ebx + 0xc], edi
mov dword [ebx + 8], edi
jmp 0x4d9d0c
cmp eax, 2
jne 0x4d9bb1
cmp dword [esi + 0x1ac], ebp
je 0x4d9bb1
mov ecx, esi
call fcn.004ed400
test al, al
jne 0x4d9bb1
cmp esi, ebp
je 0x4d9d18
mov edx, dword [esi]
push 1
mov ecx, esi
call dword [edx + 0x28]
jmp 0x4d9d18
cmp eax, edi
jne 0x4d9c49
lea edi, [ebp*4]
push edi
call sub.mfc42u.dll_operatornew
mov edx, eax
mov ecx, edi
mov dword [ebx + 4], edx
mov edi, edx
mov edx, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
add esp, 4
and ecx, 3
rep stosb byte es:[edi], al
mov dword [ebx + 0xc], ebp
mov dword [ebx + 8], ebp
jmp 0x4d9d0c
mov ecx, dword [ebx + 0xc]
cmp ebp, ecx
jg 0x4d9c77
cmp edx, ebp
jge 0x4d9c67
mov ecx, ebp
lea edi, [eax + edx*4]
sub ecx, edx
xor eax, eax
rep stosd dword es:[edi], eax
mov dword [ebx + 8], ebp
jmp 0x4d9d0c
jle 0x4d9c6f
sub edx, ebp
mov dword [esp + 0x20], edx
mov dword [ebx + 8], ebp
jmp 0x4d9d0c
mov eax, dword [ebx + 0x10]
cmp eax, edi
jne 0x4d9ca1
mov eax, edx
cdq
and edx, 7
add eax, edx
sar eax, 3
cmp eax, 4
jge 0x4d9c95
mov eax, 4
jmp 0x4d9ca1
cmp eax, 0x400
jle 0x4d9ca1
mov eax, 0x400
add eax, ecx
cmp ebp, eax
mov dword [esp + 0x1c], eax
jl 0x4d9caf
mov dword [esp + 0x1c], ebp
mov eax, dword [esp + 0x1c]
lea ecx, [eax*4]
push ecx
call sub.mfc42u.dll_operatornew
mov ecx, dword [ebx + 8]
mov esi, dword [ebx + 4]
shl ecx, 2
mov edx, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov dword [esp + 0x24], eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [ebx + 8]
mov ecx, ebp
sub ecx, edx
lea edi, [eax + edx*4]
xor eax, eax
rep stosd dword es:[edi], eax
mov eax, dword [ebx + 4]
push eax
call sub.mfc42u.dll_operatordelete
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x24]
mov esi, dword [esp + 0x18]
add esp, 8
mov dword [ebx + 4], ecx
mov dword [ebx + 8], ebp
mov dword [ebx + 0xc], edx
mov eax, dword [ebx + 4]
mov ecx, dword [esp + 0x2c]
xor ebp, ebp
mov dword [eax + ecx*4], esi
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x14]
inc eax
cmp eax, ecx
mov dword [esp + 0x28], eax
jb 0x4d9b63
lea ecx, [esp + 0x70]
call sub.mfc42u.dll_CFile::Close
mov esi, dword [esp + 0x24]
lea ecx, [esp + 0x70]
call fcn.004b4f00
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4ac
ret