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

Disassembly:
push r12
push r14
sub rsp, 0x58
mov eax, dword [rcx + 0x30]
mov r12d, edx
mov r14, rcx
test eax, eax
je 0x140039d33
lea r8d, [rax - 5]
cmp r8d, 1
ja 0x14003a4a6
cmp qword [r14], 0
mov qword [rsp + 0x78], rbx
mov qword [rsp + 0x50], rbp
mov qword [rsp + 0x48], rsi
mov qword [rsp + 0x40], rdi
mov qword [rsp + 0x38], r13
mov qword [rsp + 0x30], r15
mov r15, qword [rcx + 0x28]
mov rcx, qword [rcx + 8]
mov dword [rsp + 0x80], 0
mov rdi, qword [r15 + 8]
mov rax, qword [rcx + 8]
mov rdx, qword [rdi]
mov rax, qword [rax]
mov qword [rsp + 0x88], rax
mov qword [rsp + 0x28], rdx
je 0x140039d95
cmp byte [rdi + 0x24], 2
jne 0x140039d95
mov ebx, 5
jmp 0x140039e8f
xor ebx, ebx
cmp byte [r15 + 0x10], bl
jne 0x140039e8f
mov rax, qword [r15]
mov ecx, dword [rax + 0x30]
bt rcx, 0x19
jae 0x140039dbc
cmp byte [rdx + 0x12], bl
jne 0x140039dbc
mov eax, 0xfffe
and word [rdi + 0x26], ax
movzx eax, word [rdi + 0x26]
mov ecx, 0xffef
and ax, cx
mov word [rdi + 0x26], ax
cmp dword [rdi + 0x3c], ebx
jne 0x140039dd9
or ax, 0x10
mov word [rdi + 0x26], ax
xor ebp, ebp
nop dword [rax + rax]
cmp qword [rdi + 0x18], rbp
jne 0x140039df6
mov rcx, rdi
call fcn.14002e2a0
mov ebx, eax
test eax, eax
je 0x140039de0
jmp 0x140039dfa
test ebx, ebx
je 0x140039e12
cmp byte [rdi + 0x24], bpl
jne 0x140039e12
mov rcx, qword [rdi + 0x18]
test rcx, rcx
je 0x140039e12
mov qword [rdi + 0x18], rbp
call fcn.14002d920
cmp bl, 5
jne 0x140039e60
cmp byte [rdi + 0x24], bpl
jne 0x140039e60
mov rsi, qword [rdi + 8]
add rsi, 0x218
mov r9, qword [rsi]
test r9, r9
je 0x140039e60
mov edx, dword [rsi + 0x10]
test edx, edx
js 0x140039e60
mov rcx, qword [rsi + 8]
cmp byte [rsi + 0x14], bpl
je 0x140039e4d
mov rax, qword [rdi]
mov r8, qword [rax + 0x48]
call r9
jmp 0x140039e50
call r9
test eax, eax
je 0x140039e59
inc dword [rsi + 0x10]
jmp 0x140039de0
mov dword [rsi + 0x10], 0xffffffff
test ebx, ebx
jne 0x140039e7c
cmp byte [r15 + 0x10], bpl
jne 0x140039e6d
inc dword [rdi + 0x38]
mov byte [r15 + 0x10], 1
cmp byte [rdi + 0x24], 1
jae 0x140039e7c
mov byte [rdi + 0x24], 1
mov rcx, qword [r14 + 8]
mov r15, qword [r14 + 0x28]
mov dword [rsp + 0x80], 1
cmp dword [r14 + 0x14], 0
mov r13d, 7
jne 0x140039efe
test ebx, ebx
jne 0x140039f29
mov rdi, qword [rcx + 8]
mov rax, qword [r15 + 8]
test byte [rdi + 0x26], 2
mov edx, dword [rax + 0x30]
jne 0x140039f02
mov ebp, dword [rdi + 0x30]
lea eax, [rdx - 0x200]
sub ebp, dword [rdi + 0x34]
cmp eax, 0xfe00
ja 0x140039eda
lea eax, [rdx - 1]
test edx, eax
jne 0x140039eda
mov rcx, rdi
mov dword [rdi + 0x30], edx
call fcn.14002df20
mov rcx, qword [rdi]
lea rdx, [rdi + 0x30]
mov r8d, ebp
call fcn.140025100
mov edx, dword [rdi + 0x30]
movzx ecx, bp
sub edx, ecx
mov dword [rdi + 0x34], edx
cmp eax, r13d
jne 0x140039f02
mov ebx, r13d
jmp 0x140039f29
test ebx, ebx
jne 0x140039f29
cmp dword [r14 + 0x14], 0
jne 0x140039f29
mov rcx, qword [r14 + 8]
lea r8, [r14 + 0x10]
mov edx, 2
call fcn.14002e710
mov ebx, eax
test eax, eax
jne 0x140039f29
mov dword [r14 + 0x14], 1
mov rax, qword [r14 + 0x28]
mov rcx, qword [rax + 8]
mov rax, qword [r14 + 8]
movsxd r13, dword [rcx + 0x30]
mov rax, qword [rax + 8]
mov edx, dword [rax + 0x30]
mov rax, qword [rax]
mov dword [rsp + 0x70], edx
movzx r15d, byte [rax + 9]
test ebx, ebx
jne 0x140039f61
cmp r15b, 5
jne 0x140039f61
cmp r13d, edx
mov eax, 8
cmovne ebx, eax
mov ebp, dword [rcx + 0x3c]
xor esi, esi
test r12d, r12d
js 0x140039f74
cmp esi, r12d
jge 0x14003a04a
mov edi, dword [r14 + 0x18]
cmp edi, ebp
ja 0x14003a04a
test ebx, ebx
jne 0x14003a092
mov rax, qword [r14 + 0x28]
xor edx, edx
mov rcx, qword [rax + 8]
mov eax, 0x40000000
div dword [rcx + 0x30]
inc eax
cmp edi, eax
je 0x14003a03f
mov rax, qword [rsp + 0x28]
lea r9d, [rbx + 2]
lea r8, [rsp + 0x20]
mov edx, edi
mov rcx, rax
call qword [rax + 0x108]
mov ebx, eax
test eax, eax
jne 0x14003a03f
mov r8, qword [rsp + 0x20]
xor r9d, r9d
mov edx, edi
mov rcx, r14
mov r8, qword [r8 + 8]
call fcn.140039ae0
mov r8, qword [rsp + 0x20]
mov ebx, eax
test r8, r8
je 0x14003a03f
test byte [r8 + 0x34], 0x20
je 0x14003a037
mov r10, qword [r8 + 0x28]
dec dword [r10 + 0x98]
mov rax, qword [r10 + 0xa8]
mov qword [r8 + 0x20], rax
movsxd rax, dword [r10 + 0xbc]
mov rcx, qword [r10 + 0x48]
mov qword [r10 + 0xa8], r8
mov edx, dword [r8 + 0x30]
mov r8, qword [r8 + 8]
dec edx
mov r9, qword [rcx]
imul rdx, rax
call qword [r9 + Ordinal_145]
inc dword [r14 + 0x18]
inc esi
jmp 0x140039f66
mov rcx, r8
call fcn.140020d40
inc dword [r14 + 0x18]
inc esi
jmp 0x140039f66
test ebx, ebx
jne 0x14003a092
mov eax, ebp
mov dword [r14 + 0x38], ebp
sub eax, dword [r14 + 0x18]
inc eax
mov dword [r14 + 0x34], eax
cmp dword [r14 + 0x18], ebp
ja 0x14003a09b
cmp dword [r14 + 0x3c], ebx
jne 0x14003a423
mov rax, qword [r14 + 0x28]
mov rcx, qword [rax + 8]
mov rdx, qword [rcx]
mov rax, qword [rdx + 0x70]
mov qword [r14 + 0x40], rax
mov qword [rdx + 0x70], r14
mov dword [r14 + 0x3c], 1
jmp 0x14003a423
cmp ebx, 0x65
jne 0x14003a423
test ebp, ebp
jne 0x14003a0c9
mov rcx, qword [r14 + 8]
xor ebp, ebp
mov rax, qword [rcx + 8]
mov dword [rax + 0x3c], ebp
mov rcx, qword [rcx + 8]
call fcn.14002e5d0
mov ebx, eax
mov ebp, 1
test eax, eax
je 0x14003a0c9
cmp eax, 0x65
jne 0x14003a423
mov r8d, dword [r14 + 0x10]
mov edx, 1
mov rcx, qword [r14 + 8]
inc r8d
call fcn.140037e80
mov ebx, eax
test eax, eax
jne 0x14003a423
mov rcx, qword [r14]
test rcx, rcx
je 0x14003a0f5
call fcn.140066770
cmp r15b, 5
jne 0x14003a113
mov rcx, qword [r14 + 8]
mov edx, 2
call fcn.140039630
mov ebx, eax
test eax, eax
jne 0x14003a423
mov ecx, dword [rsp + 0x70]
cmp r13d, ecx
jge 0x14003a3e8
mov r10, qword [rsp + 0x88]
mov eax, ecx
cdq
mov r12, r13
idiv r13d
mov r15, qword [r10 + 0x48]
mov esi, dword [r10 + 0x1c]
mov ecx, eax
dec eax
add eax, ebp
movsxd rbp, ebp
cdq
idiv ecx
mov rcx, qword [r14 + 8]
xor edx, edx
mov r9d, eax
mov eax, 0x40000000
imul rbp, r13
mov r8, qword [rcx + 8]
lea edi, [r9 - 1]
div dword [r8 + 0x30]
inc eax
cmp r9d, eax
cmovne edi, r9d
nop dword [rax]
cmp edi, esi
ja 0x14003a279
mov rax, qword [r14 + 8]
xor edx, edx
mov rcx, qword [rax + 8]
mov eax, 0x40000000
div dword [rcx + 0x30]
inc eax
cmp edi, eax
je 0x14003a26a
xor r9d, r9d
lea r8, [rsp + 0x20]
mov edx, edi
mov rcx, r10
call qword [r10 + 0x108]
mov ebx, eax
test eax, eax
jne 0x14003a262
mov r8, qword [rsp + 0x20]
test byte [r8 + 0x34], 4
mov rcx, qword [r8 + 0x28]
je 0x14003a1e1
mov eax, dword [r8 + 0x30]
cmp dword [rcx + 0x1c], eax
jb 0x14003a1e1
cmp dword [rcx + 0x80], ebx
je 0x14003a1dd
mov rcx, r8
call fcn.140025a60
jmp 0x14003a205
xor ebx, ebx
jmp 0x14003a20c
mov ebx, dword [rcx + 0x2c]
test ebx, ebx
jne 0x14003a20c
mov eax, dword [rcx + 0xbc]
cmp dword [rcx + 0xb8], eax
mov rcx, r8
jbe 0x14003a200
call fcn.140027400
jmp 0x14003a205
call fcn.140027180
mov r8, qword [rsp + 0x20]
mov ebx, eax
test r8, r8
je 0x14003a262
test byte [r8 + 0x34], 0x20
je 0x14003a25a
mov r10, qword [r8 + 0x28]
dec dword [r10 + 0x98]
mov rax, qword [r10 + 0xa8]
mov qword [r8 + 0x20], rax
movsxd rax, dword [r10 + 0xbc]
mov rcx, qword [r10 + 0x48]
mov qword [r10 + 0xa8], r8
mov edx, dword [r8 + 0x30]
mov r8, qword [r8 + 8]
dec edx
mov r9, qword [rcx]
imul rdx, rax
call qword [r9 + Ordinal_145]
jmp 0x14003a262
mov rcx, r8
call fcn.140020d40
mov r10, qword [rsp + 0x88]
inc edi
test ebx, ebx
je 0x14003a170
jmp 0x14003a423
test ebx, ebx
jne 0x14003a28d
xor edx, edx
lea r8d, [rbx + 1]
mov rcx, r10
call fcn.140027820
mov ebx, eax
mov eax, dword [rsp + 0x70]
add eax, 0x40000000
movsxd rsi, eax
lea eax, [r13 + 0x40000000]
cmp rsi, rbp
movsxd rdi, eax
cmovge rsi, rbp
test ebx, ebx
jne 0x14003a423
cmp rdi, rsi
jge 0x14003a371
mov rax, rdi
mov qword [rsp + 0x70], 0
cqo
lea r8, [rsp + 0x70]
idiv r12
xor r9d, r9d
lea edx, [rax + 1]
mov rax, qword [rsp + 0x28]
mov rcx, rax
call qword [rax + 0x108]
mov ebx, eax
test eax, eax
jne 0x14003a306
mov rax, qword [rsp + 0x70]
mov r9, rdi
mov r10, qword [r15]
mov r8d, r13d
mov rcx, r15
mov rdx, qword [rax + 8]
call qword [r10 + reloc.ODBC32.dll_SQLAllocHandle]
mov ebx, eax
mov r8, qword [rsp + 0x70]
test r8, r8
je 0x14003a361
test byte [r8 + 0x34], 0x20
je 0x14003a359
mov r10, qword [r8 + 0x28]
dec dword [r10 + 0x98]
mov rax, qword [r10 + 0xa8]
mov qword [r8 + 0x20], rax
movsxd rax, dword [r10 + 0xbc]
mov rcx, qword [r10 + 0x48]
mov qword [r10 + 0xa8], r8
mov edx, dword [r8 + 0x30]
mov r8, qword [r8 + 8]
dec edx
mov r9, qword [rcx]
imul rdx, rax
call qword [r9 + Ordinal_145]
jmp 0x14003a361
mov rcx, r8
call fcn.140020d40
add rdi, r12
test ebx, ebx
je 0x14003a2b2
jmp 0x14003a423
mov rax, qword [r15]
lea rdx, [rsp + 0x70]
mov rcx, r15
call qword [rax + 0x30]
mov ebx, eax
test eax, eax
jne 0x14003a39a
cmp qword [rsp + 0x70], rbp
jle 0x14003a39a
mov rax, qword [r15]
mov rdx, rbp
mov rcx, r15
call qword [rax + 0x20]
mov ebx, eax
test ebx, ebx
jne 0x14003a423
mov rdi, qword [rsp + 0x88]
mov rcx, qword [rdi + 0x48]
mov rax, qword [rcx]
test rax, rax
je 0x14003a3cd
xor r8d, r8d
lea edx, [rbx + 0x15]
call qword [rax + 0x50]
xor ebp, ebp
cmp eax, 0xc
mov ebx, ebp
cmovne ebx, eax
test ebx, ebx
jne 0x14003a423
xor ebx, ebx
cmp byte [rdi + 0xb], bl
jne 0x14003a408
movzx edx, byte [rdi + 0xe]
mov rcx, qword [rdi + 0x48]
test edx, edx
je 0x14003a408
mov rax, qword [rcx]
call qword [rax + Ordinal_41]
jmp 0x14003a406
mov eax, r13d
xor r8d, r8d
cdq
idiv ecx
mov rcx, qword [rsp + 0x88]
xor edx, edx
imul eax, ebp
mov dword [rcx + 0x1c], eax
call fcn.140027820
mov ebx, eax
test ebx, ebx
jne 0x14003a423
mov rcx, qword [r14 + 8]
xor edx, edx
call fcn.14002fc40
mov ebx, eax
mov eax, 0x65
test ebx, ebx
cmove ebx, eax
cmp dword [rsp + 0x80], 0
mov r15, qword [rsp + 0x30]
mov r13, qword [rsp + 0x38]
mov rsi, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x50]
je 0x14003a488
mov rdi, qword [r14 + 0x28]
cmp byte [rdi + 0x10], 2
jne 0x14003a47d
mov rdi, qword [rdi + 8]
cmp byte [rdi + 0x21], 0
je 0x14003a461
mov rcx, rdi
call fcn.14002fa00
test eax, eax
jne 0x14003a47d
cmp byte [rdi + 0x23], 0
je 0x14003a470
mov rdx, qword [rdi]
mov eax, dword [rdi + 0x3c]
mov dword [rdx + 0x1c], eax
mov rcx, qword [rdi]
xor r8d, r8d
xor edx, edx
call fcn.140027820
mov rcx, qword [r14 + 0x28]
xor edx, edx
call fcn.14002fc40
mov rdi, qword [rsp + 0x40]
cmp ebx, 0xc0a
mov eax, 7
cmove ebx, eax
mov dword [r14 + 0x30], ebx
mov eax, ebx
mov rbx, qword [rsp + 0x78]
add rsp, 0x58
pop r14
pop r12
ret