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

Disassembly:
sub esp, 0x5c
push ebx
mov ebx, ecx
push ebp
push esi
push edi
mov ecx, dword [ebx + 0x154]
mov dword [esp + 0x30], ebx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [esp + 0x70]
cmp esi, eax
jae 0x4dbe93
mov ecx, dword [ebx + 0x154]
mov edi, dword [esp + 0x74]
mov ebp, dword [esp + 0x78]
add edi, ebp
push esi
mov ecx, dword [ecx + 0xd8]
mov dword [esp + 0x2c], edi
call fcn.004faedb
cmp edi, eax
ja 0x4dbe93
mov eax, dword [ebx + 0x3f8]
test eax, eax
je 0x4db8a4
cmp byte [eax + 0x125], 0
mov byte [esp + 0x1c], 1
jne 0x4db8a9
mov byte [esp + 0x1c], 0
mov ecx, dword [ebx + 0x154]
push esi
call fcn.0049a4ae
mov edi, eax
mov dword [esp + 0x18], edi
test edi, edi
je 0x4db8d1
mov ecx, dword [ebx + 0x154]
push esi
call fcn.0049af8d
mov dword [edi + 0x40], eax
mov dword [edi + 0x44], edx
call fcn.00455bff
lea ecx, [ebx + 0x240]
mov dword [esp + 0x2c], eax
mov eax, dword [ecx + 0xc]
mov dword [esp + 0x24], edx
xor edx, edx
mov dword [esp + 0x10], eax
mov eax, dword [ecx]
mov dword [esp + 0x20], eax
mov dword [esp + 0x14], edx
cmp dword [ebx + 0x250], edx
je 0x4dbc0d
test eax, eax
je 0x4db90b
mov eax, dword [eax]
jmp 0x4db90d
mov eax, edx
mov ecx, dword [eax + 8]
mov eax, dword [eax + 4]
dec ecx
and ecx, dword [esp + 0x10]
mov eax, dword [eax + ecx*4]
cmp dword [eax], esi
jne 0x4db965
mov eax, dword [esp + 0x20]
test eax, eax
je 0x4db92b
mov eax, dword [eax]
jmp 0x4db92d
mov eax, edx
mov ecx, dword [eax + 8]
mov eax, dword [eax + 4]
dec ecx
and ecx, dword [esp + 0x10]
mov eax, dword [eax + ecx*4]
mov ecx, dword [esp + 0x74]
cmp dword [eax + 8], ecx
jne 0x4db965
mov eax, dword [esp + 0x20]
test eax, eax
je 0x4db950
mov eax, dword [eax]
jmp 0x4db952
mov eax, edx
mov ecx, dword [eax + 8]
mov eax, dword [eax + 4]
dec ecx
and ecx, dword [esp + 0x10]
mov eax, dword [eax + ecx*4]
cmp dword [eax + 0xc], ebp
je 0x4db987
mov eax, dword [esp + 0x14]
inc eax
inc dword [esp + 0x10]
mov dword [esp + 0x14], eax
cmp eax, dword [ebx + 0x250]
je 0x4dbc0d
mov eax, dword [esp + 0x20]
jmp 0x4db903
mov ebp, dword [esp + 0x14]
jmp 0x4db9a1
push ebp
lea ecx, [ebx + 0x240]
call fcn.004afb07
add dword [eax + 0x10], 0xffffffff
adc dword [eax + 0x14], 0xffffffff
sub ebp, 1
jns 0x4db98d
test edi, edi
je 0x4dba3d
mov ecx, dword [ebx + 0x154]
push esi
mov ecx, dword [ecx + 0xd8]
call fcn.004faedb
cmp dword [esp + 0x28], eax
jb 0x4dba3d
mov eax, dword [esp + 0x20]
xor ebp, ebp
test eax, eax
je 0x4db9d8
mov edx, dword [eax]
mov dword [esp + 0x20], edx
jmp 0x4db9de
mov edx, ebp
mov dword [esp + 0x20], ebp
mov eax, dword [ebx + 0x154]
mov edx, dword [edx + 8]
mov ebx, dword [esp + 0x24]
dec edx
and edx, dword [esp + 0x10]
mov ecx, dword [eax + 0xcc]
mov eax, dword [esp + 0x20]
mov esi, dword [ecx]
mov eax, dword [eax + 4]
mov eax, dword [eax + edx*4]
mov edx, dword [edi + 0x34]
mov edi, dword [esp + 0x2c]
mov eax, dword [eax + 4]
sub edi, dword [edx + eax*8]
sbb ebx, dword [edx + eax*8 + 4]
push ebx
push edi
mov dword [esp + 0x2c], ebx
call dword [esi + 0xd8]
mov ebx, dword [esp + 0x30]
mov eax, dword [ebx + 0x154]
mov ecx, dword [eax + 0xcc]
mov eax, dword [ecx]
call dword [eax + 0xdc]
mov esi, dword [esp + 0x70]
jmp 0x4dba3f
xor ebp, ebp
mov eax, dword [esp + 0x78]
add dword [ebx + 0x1b0], eax
adc dword [ebx + 0x1b4], ebp
cmp byte [esp + 0x1c], 0
je 0x4dba62
add dword [ebx + 0x1b8], eax
adc dword [ebx + 0x1bc], ebp
test dword [0x7ba674], 0x40000000
je 0x4dba82
push eax
push dword [esp + 0x78]
push esi
push str.Got_Piece:__d:_d___d
push ebx
call fcn.004e1ad8
add esp, 0x14
push dword [esp + 0x14]
lea eax, [esp + 0x50]
push eax
lea ecx, [ebx + 0x240]
call fcn.004e1d65
mov esi, eax
lea edi, [esp + 0x34]
push 6
pop ecx
rep movsd dword es:[edi], dword [esi]
mov eax, dword [esp + 0x40]
xor edx, edx
sub dword [ebx + 0x3f0], eax
mov eax, 0x7fff0000
mov ecx, dword [ebx + 0xa0]
add ecx, 0x400
div ecx
mov ecx, eax
mov eax, dword [ebx + 0x150]
test byte [eax + 0x89], 1
je 0x4dbad3
add ecx, ecx
mov esi, dword [esp + 0x14]
mov eax, ecx
shl eax, 2
mov dword [esp + 0x78], eax
mov edi, eax
jmp 0x4dbb30
push esi
lea ecx, [ebx + 0x240]
call fcn.004afb07
mov ecx, edi
shr ecx, 0x10
add ecx, dword [0x7b6dc0]
mov eax, dword [eax + 0x10]
mov dword [esp + 0x74], eax
cmp eax, ecx
ja 0x4dbb0a
mov dword [esp + 0x74], ecx
push esi
lea ecx, [ebx + 0x240]
call fcn.004afb07
mov ecx, dword [esp + 0x74]
add edi, dword [esp + 0x78]
mov dword [eax + 0x10], ecx
mov dword [eax + 0x14], ebp
mov eax, 0x3c0000
cmp edi, eax
jb 0x4dbb2f
mov edi, eax
inc esi
cmp esi, dword [ebx + 0x250]
jb 0x4dbae4
mov esi, dword [esp + 0x18]
test esi, esi
je 0x4dbb55
push dword [esp + 0x70]
mov ecx, dword [ebx + 0x154]
call fcn.0049af8d
mov dword [esi + 0x40], eax
mov dword [esi + 0x44], edx
push dword [esp + 0x1c]
mov ecx, dword [ebx + 0x154]
lea eax, [esp + 0x38]
push dword [ebx + 0x150]
push dword [esp + 0x84]
push eax
call fcn.0049d404
cmp byte [ebx + 0x18], 5
je 0x4dbeb9
mov ecx, dword [ebx + 0x154]
call fcn.004a5af5
test byte [ebx + 0x190], 0x20
je 0x4dbbc4
mov esi, dword [0x7b6dc0]
sub esi, dword [ebx + 0x200]
mov ecx, dword [0x7b6dc4]
mov eax, dword [0x791cc0]
sbb ecx, dword [ebx + 0x204]
cdq
cmp ecx, edx
jg 0x4dbbc4
jl 0x4dbbbc
cmp esi, eax
jae 0x4dbbc4
push ebp
mov ecx, ebx
call fcn.004e0b28
mov ecx, ebx
call fcn.004de6db
xor eax, eax
cmp dword [ebx + 0x250], eax
je 0x4dbbe2
mov eax, dword [0x7b6dc0]
mov ecx, dword [0x7b6dc4]
jmp 0x4dbbe4
mov ecx, eax
mov dword [ebx + 0x200], eax
mov dword [ebx + 0x204], ecx
mov ecx, dword [0x7b6dc0]
mov edx, dword [0x7b6dc4]
mov dword [ebx + 0x318], ecx
mov dword [ebx + 0x31c], edx
jmp 0x4dbeb9
test byte [ebx + 0x178], 0x10
je 0x4dbd05
lea ecx, [ebx + 0x280]
mov dword [esp + 0x20], edx
mov eax, dword [ecx + 0xc]
mov dword [esp + 0x14], eax
mov eax, dword [ecx]
mov dword [esp + 0x24], eax
cmp dword [ebx + 0x290], edx
je 0x4dbd05
test eax, eax
je 0x4dbc45
mov eax, dword [eax]
jmp 0x4dbc47
mov eax, edx
mov ecx, dword [eax + 8]
mov eax, dword [eax + 4]
dec ecx
and ecx, dword [esp + 0x14]
mov eax, dword [eax + ecx*4]
cmp dword [eax], esi
jne 0x4dbc9f
mov eax, dword [esp + 0x24]
test eax, eax
je 0x4dbc65
mov eax, dword [eax]
jmp 0x4dbc67
mov eax, edx
mov ecx, dword [eax + 8]
mov eax, dword [eax + 4]
dec ecx
and ecx, dword [esp + 0x14]
mov eax, dword [eax + ecx*4]
mov ecx, dword [esp + 0x74]
cmp dword [eax + 8], ecx
jne 0x4dbc9f
mov eax, dword [esp + 0x24]
test eax, eax
je 0x4dbc8a
mov eax, dword [eax]
jmp 0x4dbc8c
mov eax, edx
mov ecx, dword [eax + 8]
mov eax, dword [eax + 4]
dec ecx
and ecx, dword [esp + 0x14]
mov eax, dword [eax + ecx*4]
cmp dword [eax + 0xc], ebp
je 0x4dbcba
mov ecx, dword [esp + 0x20]
inc ecx
inc dword [esp + 0x14]
mov dword [esp + 0x20], ecx
cmp ecx, dword [ebx + 0x290]
je 0x4dbd05
mov eax, dword [esp + 0x24]
jmp 0x4dbc3d
mov ecx, dword [esp + 0x20]
lea eax, [esp + 0x4c]
push ecx
push eax
lea ecx, [ebx + 0x280]
call fcn.004e1d65
push 6
pop ecx
mov esi, eax
lea edi, [esp + 0x34]
push 1
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [ebx + 0x154]
lea eax, [esp + 0x38]
push 1
push eax
call fcn.00493a62
mov edi, dword [esp + 0x18]
mov esi, dword [esp + 0x70]
movzx eax, al
neg eax
sbb eax, eax
not eax
and edi, eax
mov dword [esp + 0x18], edi
mov eax, dword [esp + 0x74]
test eax, 0x3fff
jne 0x4dbe48
test edi, edi
je 0x4dbe48
mov ebp, eax
shr ebp, 0xe
cmp ebp, dword [edi + 0xc]
jae 0x4dbe48
mov ecx, dword [ebx + 0x154]
push ebp
push esi
call fcn.00499f13
cmp eax, dword [esp + 0x78]
jne 0x4dbe48
mov eax, dword [edi + 0x50]
mov dword [esp + 0x24], eax
mov dl, byte [eax + ebp]
test dl, 0x10
je 0x4dbe48
mov eax, dword [edi + 0x30]
xor ecx, ecx
cmp dword [eax + ebp*4], ecx
jne 0x4dbe48
test dl, 1
jne 0x4dbdae
sub dword [edi + 0x10], 1
jne 0x4dbda4
mov esi, dword [edi + 8]
mov edx, esi
mov edi, dword [ebx + 0x154]
and esi, 7
shr edx, 3
mov ecx, dword [edi + 0x110]
movzx eax, byte [edx + ecx]
btr eax, esi
mov esi, dword [esp + 0x18]
mov byte [edx + ecx], al
or byte [edi + 0x147], 2
xor ecx, ecx
mov eax, dword [esi + 0x50]
mov esi, dword [esp + 0x70]
jmp 0x4dbda8
mov eax, dword [esp + 0x24]
or byte [eax + ebp], 1
jmp 0x4dbdb8
mov eax, dword [esp + 0x24]
or dl, 2
mov byte [eax + ebp], dl
mov eax, dword [esp + 0x78]
mov dword [esp + 0x38], ebp
shl ebp, 0xe
add dword [ebx + 0x1b0], eax
mov dword [esp + 0x34], esi
adc dword [ebx + 0x1b4], ecx
cmp byte [esp + 0x1c], 0
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], ecx
je 0x4dbdf6
add dword [ebx + 0x1b8], eax
adc dword [ebx + 0x1bc], ecx
test dword [0x7ba674], 0x40000000
je 0x4dbe16
push eax
push dword [esp + 0x78]
push esi
push str.Got_OLD_Piece:__d:_d___d
push ebx
call fcn.004e1ad8
add esp, 0x14
push dword [esp + 0x1c]
mov ecx, dword [ebx + 0x154]
lea eax, [esp + 0x38]
push dword [ebx + 0x150]
push dword [esp + 0x84]
push eax
call fcn.0049d404
mov ecx, dword [ebx + 0x154]
test ecx, ecx
je 0x4dbeb9
call fcn.004a5af5
jmp 0x4dbeb9
push dword [ebx + 0x150]
mov edi, dword [esp + 0x7c]
mov ecx, dword [ebx + 0x154]
push esi
push edi
call fcn.00493449
mov ebp, dword [ebx + 0x41c]
sub ebp, edi
jns 0x4dbe6b
xor ebp, ebp
mov dword [ebx + 0x41c], ebp
test dword [0x7ba674], 0x1000
je 0x4dbeb9
push edi
push dword [esp + 0x78]
push esi
push str.Got_Piece_Unrequested:__d:_d___d
push ebx
call fcn.004e1ad8
add esp, 0x14
jmp 0x4dbeb9
mov ecx, dword [ebx + 0x154]
mov eax, dword [ecx]
call dword [eax + 0x15c]
test al, al
jns 0x4dbeb9
mov ecx, dword [ebx + 0x154]
push 0xffffffffffffffff
push esi
push dword [ebx + 0x150]
call fcn.00492640
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x5c
ret 0x10