Function at 0x1004a840
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 ebp, dword [edi + 8]
mov eax, dword [ebp + 4]
mov dword [esp + 0x1c], eax
mov al, byte [edi]
test al, al
je 0x1004a87c
cmp al, 3
jb 0x1004a8c2
call fcn.10040210
test eax, eax
jne 0x1004adb3
cmp byte [edi], al
jne 0x1004adb3
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
cmp eax, ecx
ja 0x1004a8ed
push 0x10167d54
push 0x13672
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.1002a9f0
add esp, 0x14
mov eax, 0xb
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
push 0x10167d54
push 0x13669
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.1002a9f0
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 esi, cx
and esi, eax
add esi, dword [ebx + 0x38]
cmp dword [ebx + 0x14], 0
mov dword [esp + 0x28], esi
jge 0x1004a944
mov ecx, ebx
call fcn.10041700
test eax, eax
je 0x1004a944
push 0x10167d54
push 0x13676
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.1002a9f0
add esp, 0x14
mov eax, 0xb
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
movzx eax, word [ebx + 0x18]
add eax, dword [ebx + 0x40]
cmp esi, eax
jae 0x1004a97a
push 0x10167d54
push 0x13679
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.1002a9f0
add esp, 0x14
mov eax, 0xb
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov al, byte [esp + 0x17]
shr al, 1
and al, 1
mov byte [esp + 0x17], al
je 0x1004a9d6
cmp byte [ebx + 8], 0
je 0x1004a9c7
mov eax, dword [ebx + 0x4c]
push esi
push ebx
call eax
mov ecx, dword [esp + 0x24]
add esp, 8
movzx esi, ax
mov eax, 0xaaaaaaab
mov ecx, dword [ecx + 0x28]
add ecx, ecx
mul ecx
mov eax, dword [ebx + 0x14]
add eax, 2
shr edx, 1
add eax, esi
cmp eax, edx
jg 0x1004a9c7
cmp word [ebx + 0x18], 1
je 0x1004a9c7
mov byte [esp + 0x17], 2
jmp 0x1004a9d6
mov ecx, edi
call fcn.1003fed0
test eax, eax
jne 0x1004adb3
cmp byte [ebx + 8], 0
lea esi, [edi + 1]
jne 0x1004aa16
and byte [esi], 0xf1
xor eax, eax
mov word [edi + 0x32], ax
cmp byte [edi], al
jne 0x1004aa07
movzx ecx, word [edi + 0x46]
test cx, cx
je 0x1004aa07
mov eax, dword [edi + 0x74]
cmp byte [eax + 8], 0
je 0x1004aa07
lea eax, [ecx - 1]
mov word [edi + 0x46], ax
jmp 0x1004aa16
mov ecx, edi
call fcn.10045dc0
test eax, eax
jne 0x1004adb3
test byte [esi], 0x20
je 0x1004aa48
mov eax, dword [esp + 0x1c]
mov edx, dword [edi + 0x40]
mov ecx, dword [eax + 8]
test ecx, ecx
je 0x1004aa44
nop dword [eax]
cmp ecx, edi
je 0x1004aa3d
test edx, edx
je 0x1004aab4
cmp dword [ecx + 0x40], edx
je 0x1004aab4
mov ecx, dword [ecx + 0x18]
test ecx, ecx
jne 0x1004aa30
and byte [edi + 1], 0xdf
cmp dword [edi + 0x70], 0
jne 0x1004aa93
cmp byte [ebp + 0xb], 0
je 0x1004aa93
mov eax, dword [ebp + 4]
mov edx, dword [edi + 0x20]
mov esi, dword [edi + 0x24]
mov ecx, dword [edi + 0x40]
mov byte [ebp + 0xb], 0
mov eax, dword [eax + 8]
test eax, eax
je 0x1004aa93
nop dword [eax + eax]
test byte [eax + 1], 0x10
je 0x1004aa8c
mov byte [ebp + 0xb], 1
cmp dword [eax + 0x40], ecx
jne 0x1004aa8c
cmp dword [eax + 0x20], edx
jne 0x1004aa8c
cmp dword [eax + 0x24], esi
jne 0x1004aa8c
mov byte [eax], 1
mov eax, dword [eax + 0x18]
test eax, eax
jne 0x1004aa70
mov ecx, dword [ebx + 0x48]
test byte [ecx + 0x1c], 4
mov edx, dword [ecx + 0x14]
je 0x1004aacd
mov eax, dword [edx + 0x1c]
cmp eax, dword [ecx + 0x18]
jb 0x1004aacd
cmp dword [edx + 0x68], 0
je 0x1004aafa
call fcn.10038e90
jmp 0x1004aaf2
test ecx, ecx
je 0x1004aa44
push edi
call fcn.10040040
add esp, 4
test eax, eax
je 0x1004aa48
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edx + 0x2c]
test eax, eax
jne 0x1004adb3
mov eax, dword [edx + 0x9c]
cmp eax, dword [edx + 0xa8]
jbe 0x1004aaed
call fcn.1003a950
jmp 0x1004aaf2
call fcn.1003a8c0
test eax, eax
jne 0x1004adb3
mov esi, dword [esp + 0x28]
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 0x1004ab2b
lea eax, [esp + 0x30]
mov edx, esi
push eax
mov ecx, ebx
call fcn.10046ae0
add esp, 4
jmp 0x1004ab2d
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.10047020
mov ebp, dword [esp + 0x20]
add esp, 8
test ebp, ebp
jne 0x1004adb1
cmp byte [ebx + 8], 0
jne 0x1004ac94
mov esi, dword [edi + 0x74]
cmp dword [esi + 0x14], ebp
jge 0x1004ab77
mov ecx, esi
call fcn.10041700
test eax, eax
jne 0x1004adb3
movsx eax, byte [edi + 0x44]
mov ecx, dword [esp + 0x2c]
dec eax
cmp ecx, eax
jge 0x1004ab8a
mov eax, dword [edi + ecx*4 + 0x7c]
jmp 0x1004ab8d
mov eax, dword [edi + 0x74]
mov eax, dword [eax + 4]
movzx ecx, word [esi + 0x18]
mov edx, dword [esi + 0x38]
mov dword [esp + 0x24], eax
mov eax, dword [esi + 0x40]
mov ax, word [eax + ecx*2 - 2]
mov ch, al
mov cl, ah
movzx eax, word [esi + 0x1a]
movzx ebp, cx
and ebp, eax
lea eax, [edx + 4]
add ebp, edx
cmp ebp, eax
jae 0x1004abe4
push 0x10167d54
push 0x136d4
push str.database_corruption
push str._s_at_line__d_of___.10s_
push 0xb
call fcn.1002a9f0
add esp, 0x14
mov eax, 0xb
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x4c]
push ebp
push esi
call eax
mov ecx, dword [esi + 0x48]
add esp, 8
movzx eax, ax
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x1c]
test byte [ecx + 0x1c], 4
mov edx, dword [ecx + 0x14]
mov eax, dword [eax + 0x54]
mov dword [esp + 0x1c], eax
je 0x1004ac21
mov eax, dword [edx + 0x1c]
cmp eax, dword [ecx + 0x18]
jb 0x1004ac21
cmp dword [edx + 0x68], 0
je 0x1004ac4a
call fcn.10038e90
jmp 0x1004ac42
mov eax, dword [edx + 0x2c]
test eax, eax
jne 0x1004ac6c
mov eax, dword [edx + 0x9c]
cmp eax, dword [edx + 0xa8]
jbe 0x1004ac3d
call fcn.1003a950
jmp 0x1004ac42
call fcn.1003a8c0
mov dword [esp + 0x18], eax
test eax, eax
jne 0x1004ac70
push dword [esp + 0x24]
mov eax, dword [esp + 0x2c]
mov ecx, ebx
push dword [esp + 0x20]
mov edx, dword [esp + 0x28]
add eax, 4
push eax
lea eax, [ebp - 4]
push eax
call fcn.10047140
add esp, 0x10
mov dword [esp + 0x18], eax
movzx edx, word [esi + 0x18]
lea eax, [esp + 0x18]
push eax
push dword [esp + 0x2c]
dec edx
mov ecx, esi
call fcn.10047020
mov ebp, dword [esp + 0x20]
add esp, 8
test ebp, ebp
jne 0x1004adb1
mov eax, dword [edi + 0x74]
mov eax, dword [eax + 0x14]
lea ecx, [eax + eax*2]
mov eax, dword [edi + 0x14]
mov eax, dword [eax + 0x28]
add eax, eax
cmp ecx, eax
jg 0x1004acad
xor ebp, ebp
jmp 0x1004acbe
mov ecx, edi
call fcn.10049810
mov ebp, eax
test ebp, ebp
jne 0x1004adb1
movsx eax, byte [edi + 0x44]
mov esi, dword [esp + 0x2c]
cmp eax, esi
jle 0x1004ad21
mov ecx, dword [edi + 0x74]
mov ecx, dword [ecx + 0x48]
call fcn.1003a430
mov dl, byte [edi + 0x44]
dec dl
movsx eax, dl
mov byte [edi + 0x44], dl
cmp eax, esi
jle 0x1004ad06
movsx eax, dl
dec dl
mov ecx, dword [edi + eax*4 + 0x78]
mov byte [edi + 0x44], dl
test ecx, ecx
je 0x1004acfc
mov ecx, dword [ecx + 0x48]
call fcn.1003a430
mov dl, byte [edi + 0x44]
movsx eax, dl
cmp eax, esi
jg 0x1004ace4
movsx eax, dl
mov ecx, edi
mov eax, dword [edi + eax*4 + 0x78]
mov dword [edi + 0x74], eax
call fcn.10049810
mov ebp, eax
test ebp, ebp
jne 0x1004adb1
cmp byte [esp + 0x17], 1
jbe 0x1004ad61
mov byte [edi], 2
movzx eax, word [ebx + 0x18]
cmp dword [esp + 0x20], eax
jb 0x1004ad50
mov dword [edi + 4], 0xffffffff
mov ax, word [ebx + 0x18]
dec ax
mov word [edi + 0x46], ax
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [edi + 4], 1
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, edi
call fcn.10045080
cmp byte [esp + 0x17], 0
mov ebp, eax
je 0x1004ada9
mov al, byte [edi + 0x44]
test al, al
js 0x1004ada6
xor esi, esi
test al, al
jle 0x1004ad97
lea ebx, [edi + 0x78]
mov ecx, dword [ebx]
mov ecx, dword [ecx + 0x48]
call fcn.1003a430
movsx eax, byte [edi + 0x44]
lea ebx, [ebx + 4]
inc esi
cmp esi, eax
jl 0x1004ad81
mov ecx, dword [edi + 0x74]
mov ecx, dword [ecx + 0x48]
call fcn.1003a430
mov byte [edi + 0x44], 0xff
mov byte [edi], 3
xor eax, eax
cmp ebp, 0x10
cmove ebp, eax
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret