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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x38
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov byte [esp + 0x17], dl
mov eax, dword [edi + 8]
mov dword [esp + 0x1c], eax
mov ebp, dword [eax + 4]
mov al, byte [edi]
mov dword [esp + 0x24], ebp
test al, al
je 0x1003e9c2
cmp al, 3
jb 0x1003ea0c
call fcn.100345f0
mov esi, eax
test esi, esi
jne 0x1003eed1
cmp byte [edi], al
jne 0x1003eed1
mov ebx, dword [edi + 0x74]
movsx eax, byte [edi + 0x44]
movzx ecx, word [edi + 0x46]
mov dword [esp + 0x2c], eax
movzx eax, word [ebx + 0x18]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x28], ebx
cmp eax, ecx
ja 0x1003ea37
push 0x10156d84
push 0x13050
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.10021490
add esp, 0x14
mov eax, 0xb
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
push 0x10156d84
push 0x13047
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.10021490
add esp, 0x14
mov eax, 0xb
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 0x40]
mov ax, word [eax + ecx*2]
mov ch, al
mov cl, ah
movzx eax, word [ebx + 0x1a]
movzx ecx, cx
and ecx, eax
add ecx, dword [ebx + 0x38]
cmp dword [ebx + 0x14], 0
mov dword [esp + 0x18], ecx
jge 0x1003ea92
mov ecx, ebx
call fcn.100358c0
test eax, eax
je 0x1003ea8e
push 0x10156d84
push 0x13054
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.10021490
add esp, 0x14
mov eax, 0xb
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x18]
mov al, byte [esp + 0x17]
shr al, 1
and al, 1
mov byte [esp + 0x17], al
je 0x1003eaec
cmp byte [ebx + 8], 0
je 0x1003eadb
mov eax, dword [ebx + 0x4c]
push ecx
push ebx
call eax
mov ecx, dword [ebp + 0x28]
add esp, 8
movzx esi, ax
add ecx, ecx
mov eax, 0xaaaaaaab
mul ecx
mov eax, dword [ebx + 0x14]
add eax, 2
shr edx, 1
add eax, esi
cmp eax, edx
jg 0x1003eadb
cmp word [ebx + 0x18], 1
je 0x1003eadb
mov byte [esp + 0x17], 2
jmp 0x1003eaec
mov ecx, edi
call fcn.100342b0
mov esi, eax
test esi, esi
jne 0x1003eed1
cmp byte [ebx + 8], 0
lea esi, [edi + 1]
jne 0x1003eb2c
and byte [esi], 0xf1
xor eax, eax
mov word [edi + 0x32], ax
cmp byte [edi], al
jne 0x1003eb1d
movzx ecx, word [edi + 0x46]
test cx, cx
je 0x1003eb1d
mov eax, dword [edi + 0x74]
cmp byte [eax + 8], 0
je 0x1003eb1d
lea eax, [ecx - 1]
mov word [edi + 0x46], ax
jmp 0x1003eb2c
mov ecx, edi
call fcn.1003a080
test eax, eax
jne 0x1003eed3
mov al, byte [esi]
lea ebp, [edi + 0x40]
test al, 0x20
je 0x1003eb5b
mov ecx, dword [esp + 0x24]
mov edx, dword [ebp]
mov ecx, dword [ecx + 8]
test ecx, ecx
je 0x1003eb57
cmp ecx, edi
je 0x1003eb50
test edx, edx
je 0x1003ebc8
cmp dword [ecx + 0x40], edx
je 0x1003ebc8
mov ecx, dword [ecx + 0x18]
test ecx, ecx
jne 0x1003eb43
and al, 0xdf
mov byte [esi], al
cmp dword [edi + 0x70], 0
jne 0x1003eba7
mov eax, dword [esp + 0x1c]
cmp byte [eax + 0xb], 0
je 0x1003eba7
mov ecx, dword [ebp]
mov ebp, eax
mov edx, dword [edi + 0x20]
mov esi, dword [edi + 0x24]
mov eax, dword [ebp + 4]
mov byte [ebp + 0xb], 0
mov eax, dword [eax + 8]
test eax, eax
je 0x1003eba7
test byte [eax + 1], 0x10
je 0x1003eba0
mov byte [ebp + 0xb], 1
cmp dword [eax + 0x40], ecx
jne 0x1003eba0
cmp dword [eax + 0x20], edx
jne 0x1003eba0
cmp dword [eax + 0x24], esi
jne 0x1003eba0
mov byte [eax], 1
mov eax, dword [eax + 0x18]
test eax, eax
jne 0x1003eb84
mov ecx, dword [ebx + 0x48]
test byte [ecx + 0x1c], 4
mov edx, dword [ecx + 0x14]
je 0x1003ebe1
mov eax, dword [edx + 0x1c]
cmp eax, dword [ecx + 0x18]
jb 0x1003ebe1
cmp dword [edx + 0x68], 0
je 0x1003ec0e
call fcn.1002e3e0
jmp 0x1003ec06
test ecx, ecx
je 0x1003eb57
push edi
call fcn.10034420
add esp, 4
test eax, eax
je 0x1003eb5b
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edx + 0x2c]
test eax, eax
jne 0x1003eed3
mov eax, dword [edx + 0x9c]
cmp eax, dword [edx + 0xa8]
jbe 0x1003ec01
call fcn.1002ffb0
jmp 0x1003ec06
call fcn.1002ff20
test eax, eax
jne 0x1003eed3
mov esi, dword [esp + 0x18]
lea eax, [esp + 0x30]
push eax
mov eax, dword [ebx + 0x50]
push esi
push ebx
call eax
movzx eax, word [esp + 0x4c]
add esp, 0xc
cmp eax, dword [esp + 0x3c]
je 0x1003ec3f
lea eax, [esp + 0x30]
mov edx, esi
push eax
mov ecx, ebx
call fcn.1003ad70
add esp, 4
jmp 0x1003ec41
xor eax, eax
mov edx, dword [esp + 0x20]
mov ecx, ebx
mov dword [esp + 0x18], eax
lea eax, [esp + 0x18]
push eax
movzx eax, word [esp + 0x46]
push eax
call fcn.1003b2b0
mov esi, dword [esp + 0x20]
add esp, 8
test esi, esi
jne 0x1003eed1
cmp byte [ebx + 8], 0
jne 0x1003ed67
mov ebx, dword [edi + 0x74]
cmp dword [ebx + 0x14], esi
jge 0x1003ec8d
mov ecx, ebx
call fcn.100358c0
mov esi, eax
test esi, esi
jne 0x1003eed1
movsx eax, byte [edi + 0x44]
mov ecx, dword [esp + 0x2c]
dec eax
cmp ecx, eax
jge 0x1003eca0
mov eax, dword [edi + ecx*4 + 0x7c]
jmp 0x1003eca3
mov eax, dword [edi + 0x74]
mov ebp, dword [eax + 4]
movzx ecx, word [ebx + 0x18]
mov eax, dword [ebx + 0x40]
mov edx, dword [ebx + 0x38]
mov ax, word [eax + ecx*2 - 2]
mov ch, al
mov cl, ah
movzx eax, word [ebx + 0x1a]
movzx esi, cx
and esi, eax
lea eax, [edx + 4]
add esi, edx
cmp esi, eax
jae 0x1003ecf6
push 0x10156d84
push 0x130af
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.10021490
add esp, 0x14
mov eax, 0xb
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebx + 0x4c]
push esi
push ebx
call eax
mov ecx, dword [ebx + 0x48]
add esp, 8
movzx eax, ax
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x24]
test byte [ecx + 0x1c], 4
mov edx, dword [ecx + 0x14]
mov eax, dword [eax + 0x54]
mov dword [esp + 0x24], eax
je 0x1003ed33
mov eax, dword [edx + 0x1c]
cmp eax, dword [ecx + 0x18]
jb 0x1003ed33
cmp dword [edx + 0x68], 0
je 0x1003eda2
call fcn.1002e3e0
jmp 0x1003ed9a
mov eax, dword [edx + 0x2c]
test eax, eax
je 0x1003ed80
mov dword [esp + 0x18], eax
mov ebp, dword [esp + 0x1c]
movzx edx, word [ebx + 0x18]
lea eax, [esp + 0x18]
push eax
push ebp
dec edx
mov ecx, ebx
call fcn.1003b2b0
mov esi, dword [esp + 0x20]
add esp, 8
test esi, esi
jne 0x1003eed1
mov ebx, dword [esp + 0x28]
mov eax, dword [edi + 0x14]
mov ecx, dword [eax + 0x28]
mov eax, dword [edi + 0x74]
add ecx, ecx
mov eax, dword [eax + 0x14]
lea eax, [eax + eax*2]
cmp eax, ecx
jg 0x1003edcc
xor esi, esi
jmp 0x1003eddd
mov eax, dword [edx + 0x9c]
cmp eax, dword [edx + 0xa8]
jbe 0x1003ed95
call fcn.1002ffb0
jmp 0x1003ed9a
call fcn.1002ff20
mov dword [esp + 0x18], eax
test eax, eax
jne 0x1003ed3e
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x28]
push ebp
mov ebp, dword [esp + 0x20]
push dword [esp + 0x28]
lea eax, [ebp + 4]
push eax
lea eax, [esi - 4]
push eax
call fcn.1003b3d0
add esp, 0x10
mov dword [esp + 0x18], eax
jmp 0x1003ed42
mov ecx, edi
call fcn.1003d910
mov esi, eax
test esi, esi
jne 0x1003eed1
movsx eax, byte [edi + 0x44]
mov ebp, dword [esp + 0x2c]
cmp eax, ebp
jle 0x1003ee38
mov ecx, dword [edi + 0x74]
mov ecx, dword [ecx + 0x48]
call fcn.1002fa10
mov dl, byte [edi + 0x44]
dec dl
movsx eax, dl
mov byte [edi + 0x44], dl
cmp eax, ebp
jle 0x1003ee25
movsx eax, dl
dec dl
mov ecx, dword [edi + eax*4 + 0x78]
mov byte [edi + 0x44], dl
test ecx, ecx
je 0x1003ee1b
mov ecx, dword [ecx + 0x48]
call fcn.1002fa10
mov dl, byte [edi + 0x44]
movsx eax, dl
cmp eax, ebp
jg 0x1003ee03
movsx eax, dl
mov ecx, edi
mov eax, dword [edi + eax*4 + 0x78]
mov dword [edi + 0x74], eax
call fcn.1003d910
mov esi, eax
test esi, esi
jne 0x1003eed1
cmp byte [esp + 0x17], 1
jbe 0x1003ee80
mov byte [edi], 2
movzx eax, word [ebx + 0x18]
cmp dword [esp + 0x20], eax
jb 0x1003ee6f
mov dword [edi + 4], 0xffffffff
mov ax, word [ebx + 0x18]
dec ax
mov word [edi + 0x46], ax
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [edi + 4], 1
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, edi
call fcn.100392e0
cmp byte [esp + 0x17], 0
mov esi, eax
je 0x1003eec9
mov al, byte [edi + 0x44]
test al, al
js 0x1003eec6
xor ebx, ebx
test al, al
jle 0x1003eeb7
lea ebp, [edi + 0x78]
mov ecx, dword [ebp]
mov ecx, dword [ecx + 0x48]
call fcn.1002fa10
movsx eax, byte [edi + 0x44]
lea ebp, [ebp + 4]
inc ebx
cmp ebx, eax
jl 0x1003eea0
mov ecx, dword [edi + 0x74]
mov ecx, dword [ecx + 0x48]
call fcn.1002fa10
mov byte [edi + 0x44], 0xff
mov byte [edi], 3
xor eax, eax
cmp esi, 0x10
cmove esi, eax
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret