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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x6d3438]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
xor esi, esi
push edi
mov eax, dword [ebx + 0x14]
mov edi, dword [ebx + 0x74]
mov dword [ebp - 0x1c], esi
mov ecx, dword [eax + 0x28]
mov eax, 0xaaaaaaab
add ecx, ecx
mul ecx
mov ecx, edx
shr ecx, 1
mov dword [ebp - 0x20], ecx
cmp dword [edi + 0x14], 0
jge 0x51dece
push edi
call fcn.00520500
add esp, 4
test eax, eax
jne 0x51e243
mov ecx, dword [ebp - 0x20]
mov al, byte [edi + 0xc]
test al, al
jne 0x51dede
cmp dword [edi + 0x14], ecx
jle 0x51e243
movsx ecx, byte [ebx + 0x44]
mov dword [ebp - 0x24], ecx
test ecx, ecx
jne 0x51df4b
test al, al
je 0x51e243
mov eax, dword [ebx + 0x14]
mov eax, dword [eax + 8]
test eax, eax
je 0x51df1c
nop dword [eax + eax]
cmp eax, ebx
je 0x51df15
cmp byte [eax], 0
jne 0x51df15
mov ecx, dword [eax + 0x74]
cmp ecx, dword [ebx + 0x74]
je 0x51e220
mov eax, dword [eax + 0x18]
test eax, eax
jne 0x51df00
lea eax, [ebx + 0x7c]
push eax
push edi
call fcn.0051e270
mov esi, eax
add esp, 8
test esi, esi
jne 0x51e243
mov ecx, dword [ebp - 0x20]
mov byte [ebx + 0x44], 1
mov dword [ebx + 0x78], edi
mov edi, dword [ebx + 0x7c]
mov dword [ebx + 0x46], eax
mov dword [ebx + 0x74], edi
jmp 0x51deb4
mov esi, dword [ebx + ecx*4 + 0x74]
movzx eax, word [ebx + ecx*2 + 0x46]
mov dword [ebp - 0x28], eax
mov ecx, dword [esi + 0x48]
test byte [ecx + 0x1c], 4
mov edx, dword [ecx + 0x14]
je 0x51df79
mov eax, dword [edx + 0x18]
cmp eax, dword [ecx + 0x18]
jb 0x51df79
cmp dword [edx + 0x60], 0
je 0x51dfb0
push ecx
call fcn.0058e0b0
jmp 0x51dfa2
mov eax, dword [edx + 0x28]
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x51e1a1
mov eax, dword [edx + 0x94]
push ecx
cmp eax, dword [edx + 0x98]
jbe 0x51df9d
call fcn.0053a7c0
jmp 0x51dfa2
call fcn.0053bac0
add esp, 4
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x51e1a1
cmp dword [esi + 0x14], 0
jge 0x51dfca
push esi
call fcn.00520500
add esp, 4
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x51e1a1
cmp byte [edi + 3], 0
je 0x51e005
cmp byte [edi + 0xc], 1
jne 0x51e005
mov ax, word [edi + 0x1c]
cmp ax, word [edi + 0x18]
jne 0x51e005
cmp dword [esi + 4], 1
je 0x51e005
movzx eax, word [esi + 0x18]
cmp eax, dword [ebp - 0x28]
jne 0x51e005
lea eax, [ebp - 0x14]
push eax
push edi
push esi
call fcn.0051fce0
add esp, 0xc
mov dword [ebp - 0x18], eax
jmp 0x51e1a1
mov eax, dword [ebx + 0x14]
push dword [eax + 0x24]
call fcn.0053d250
movzx ecx, byte [ebx + 3]
and ecx, 1
mov dword [ebp - 0x2c], eax
push ecx
xor ecx, ecx
cmp dword [ebp - 0x24], 1
sete cl
push ecx
push eax
push dword [ebp - 0x28]
push esi
call fcn.0051e4c0
mov ecx, dword [ebp - 0x1c]
add esp, 0x18
mov dword [ebp - 0x18], eax
test ecx, ecx
je 0x51e19b
cmp ecx, dword [0x6e197c]
jb 0x51e0b9
cmp ecx, dword [0x6e1980]
jae 0x51e0b9
mov eax, dword [0x6e1984]
test eax, eax
je 0x51e070
mov esi, dword [0x6d19b8]
mov ecx, esi
push eax
call dword [0x659730]
call esi
mov ecx, dword [ebp - 0x1c]
add esp, 4
mov eax, dword [0x6e1988]
dec dword [0x6e167c]
mov dword [ecx], eax
xor eax, eax
mov dword [0x6e1988], ecx
mov ecx, dword [0x6e198c]
inc ecx
cmp ecx, dword [0x6e1978]
mov dword [0x6e198c], ecx
setl al
mov dword [0x6e1990], eax
mov eax, dword [0x6e1984]
test eax, eax
je 0x51e19b
mov esi, dword [0x6d19c0]
push eax
jmp 0x51e18e
mov esi, dword [0x6d1994]
push ecx
mov ecx, esi
call dword [0x659730]
call esi
mov ecx, dword [0x6e1984]
add esp, 4
mov dword [ebp - 0x24], eax
test ecx, ecx
je 0x51e0f7
mov esi, dword [0x6d19b8]
push ecx
mov ecx, esi
call dword [0x659730]
call esi
mov ecx, dword [0x6e1984]
add esp, 4
mov eax, dword [ebp - 0x24]
sub dword [0x6e1680], eax
test ecx, ecx
je 0x51e115
mov esi, dword [0x6d19c0]
push ecx
mov ecx, esi
call dword [0x659730]
call esi
add esp, 4
cmp dword [0x6d1968], 0
je 0x51e185
mov eax, dword [0x6e16e0]
test eax, eax
je 0x51e13b
mov esi, dword [0x6d19b8]
mov ecx, esi
push eax
call dword [0x659730]
call esi
add esp, 4
push dword [ebp - 0x1c]
mov esi, dword [0x6d1994]
mov ecx, esi
call dword [0x659730]
call esi
mov esi, dword [0x6d198c]
add esp, 4
sub dword [0x6e1678], eax
mov ecx, esi
dec dword [0x6e169c]
push dword [ebp - 0x1c]
call dword [0x659730]
call esi
mov eax, dword [0x6e16e0]
add esp, 4
test eax, eax
je 0x51e19b
mov esi, dword [0x6d19c0]
push eax
jmp 0x51e18e
push dword [ebp - 0x1c]
mov esi, dword [0x6d198c]
mov ecx, esi
call dword [0x659730]
call esi
add esp, 4
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x1c], eax
mov edx, dword [edi + 0x48]
mov byte [edi + 0xc], 0
test byte [edx + 0x1c], 0x20
je 0x51e1f5
mov eax, dword [edx + 0x14]
dec dword [eax + 0x78]
mov ecx, dword [eax + 0x88]
mov dword [edx + 0x10], ecx
mov esi, dword [eax + 0x3c]
mov dword [eax + 0x88], edx
push dword [edx + 4]
mov ecx, dword [edx + 0x18]
mov eax, dword [eax + 0x98]
dec ecx
mov edi, dword [esi]
cdq
push edx
push eax
push 0
push ecx
call fcn.00608a40
push edx
push eax
push esi
mov esi, dword [edi + 0x48]
mov ecx, esi
call dword [0x659730]
call esi
add esp, 0x10
jmp 0x51e1fe
push edx
call fcn.005660b0
add esp, 4
mov cl, byte [ebx + 0x44]
mov esi, dword [ebp - 0x18]
lea eax, [ecx - 1]
mov byte [ebx + 0x44], al
movsx eax, cl
mov edi, dword [ebx + eax*4 + 0x74]
mov dword [ebx + 0x74], edi
test esi, esi
jne 0x51e243
mov ecx, dword [ebp - 0x20]
jmp 0x51deb4
push 0x674cf4
push 0x120a1
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.0051a330
add esp, 0x14
mov esi, 0xb
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x51e253
push eax
call fcn.0053d770
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00608185
mov esp, ebp
pop ebp
ret