Function at 0x404870
Capabilities:
Terminate process

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x27dc8
call fcn.004073c0
mov eax, dword [0x41b5f0]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], 0
push 0x41ca14
push str.bcp.rll
call fcn.00405820
add esp, 8
test eax, eax
jne 0x4048bf
push 0x10
push str.BCP_support_error
push str.Unable_to_load_BCP_resource_DLL.__BCP_cannot_continue._n
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 1
call fcn.00407067
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00401010
add esp, 8
push 0x41ca18
call sub.ODBC32.dll_SQLAllocEnv
movsx edx, ax
cmp edx, 0xffffffff
jne 0x4048e8
push 1
call fcn.00407067
push 0x41ca48
mov eax, dword [0x41ca18]
push eax
call sub.ODBC32.dll_SQLAllocConnect
movsx ecx, ax
cmp ecx, 0xffffffff
jne 0x404913
mov edx, dword [0x41ca18]
push edx
call sub.ODBC32.dll_SQLFreeEnv
push 1
call fcn.00407067
mov eax, dword [0x41b210]
push eax
push 0x70
mov ecx, dword [0x41ca48]
push ecx
call sub.ODBC32.dll_SQLSetConnectOption
push 1
push 0x4c3
mov edx, dword [0x41ca48]
push edx
call sub.ODBC32.dll_SQLSetConnectOption
cmp dword [0x41c4f4], 0
jne 0x404955
push 0
push 0x4c1
mov eax, dword [0x41ca48]
push eax
call sub.ODBC32.dll_SQLSetConnectOption
push str.DriverSQL_Server_server
lea ecx, [ebp - 0x120]
push ecx
call fcn.00406300
add esp, 8
mov edx, dword [0x41ca44]
push edx
lea eax, [ebp - 0x120]
push eax
call fcn.00406310
add esp, 8
cmp dword [0x41c4f0], 0
je 0x40499d
push 1
push 0x4b3
mov ecx, dword [0x41ca48]
push ecx
call sub.ODBC32.dll_SQLSetConnectOption
jmp 0x4049f8
cmp dword [0x41ca64], 0
je 0x4049cf
push str._uid
lea edx, [ebp - 0x120]
push edx
call fcn.00406310
add esp, 8
mov eax, dword [0x41ca64]
push eax
lea ecx, [ebp - 0x120]
push ecx
call fcn.00406310
add esp, 8
push str._pwd
lea edx, [ebp - 0x120]
push edx
call fcn.00406310
add esp, 8
mov eax, dword [0x41ca58]
push eax
lea ecx, [ebp - 0x120]
push ecx
call fcn.00406310
add esp, 8
cmp dword [0x41c500], 0
jne 0x404b38
push 0x2e
mov edx, dword [0x41ca08]
push edx
call fcn.00406410
add esp, 8
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x404b38
mov eax, dword [ebp - 8]
sub eax, dword [0x41ca08]
push eax
mov ecx, dword [0x41ca08]
push ecx
lea edx, [ebp - 0x1a8]
push edx
call fcn.00407bb0
add esp, 0xc
mov eax, dword [ebp - 8]
sub eax, dword [0x41ca08]
mov byte [ebp + eax - 0x1a8], 0
cmp dword [0x41c4f4], 0
je 0x404a98
push 0x22
lea ecx, [ebp - 0x1a8]
push ecx
call fcn.00406410
add esp, 8
mov dword [ebp - 0x27dbc], eax
cmp dword [ebp - 0x27dbc], 0
je 0x404a98
mov edx, dword [ebp - 0x27dbc]
add edx, 1
push edx
mov eax, dword [ebp - 0x27dbc]
push eax
call fcn.00406300
add esp, 8
jmp 0x404a5d
push 0x5b
lea ecx, [ebp - 0x1a8]
push ecx
call fcn.00406410
add esp, 8
mov dword [ebp - 0x27dbc], eax
cmp dword [ebp - 0x27dbc], 0
je 0x404ad3
mov edx, dword [ebp - 0x27dbc]
add edx, 1
push edx
mov eax, dword [ebp - 0x27dbc]
push eax
call fcn.00406300
add esp, 8
jmp 0x404a98
push 0x5d
lea ecx, [ebp - 0x1a8]
push ecx
call fcn.00406410
add esp, 8
mov dword [ebp - 0x27dbc], eax
cmp dword [ebp - 0x27dbc], 0
je 0x404b0e
mov edx, dword [ebp - 0x27dbc]
add edx, 1
push edx
mov eax, dword [ebp - 0x27dbc]
push eax
call fcn.00406300
add esp, 8
jmp 0x404ad3
push str._database
lea ecx, [ebp - 0x120]
push ecx
call fcn.00406310
add esp, 8
lea edx, [ebp - 0x1a8]
push edx
lea eax, [ebp - 0x120]
push eax
call fcn.00406310
add esp, 8
push 0
push 0
push 0
push 0
push 0xfffffffffffffffd
lea ecx, [ebp - 0x120]
push ecx
push 0
mov edx, dword [0x41ca48]
push edx
call sub.ODBC32.dll_SQLDriverConnect
movsx eax, ax
cmp eax, 0xffffffff
jne 0x404b61
jmp 0x404bc1
push 0x41ca2c
mov ecx, dword [0x41ca48]
push ecx
call sub.ODBC32.dll_SQLAllocStmt
movsx edx, ax
cmp edx, 0xffffffff
jne 0x404b7c
jmp 0x404bc1
lea eax, [ebp - 0x27db8]
push eax
lea ecx, [ebp - 4]
push ecx
mov edx, dword [0x41ca08]
push edx
mov eax, dword [0x41ca2c]
push eax
call fcn.00404630
add esp, 0x10
movsx ecx, ax
test ecx, ecx
jne 0x404bee
mov edx, dword [0x41ca2c]
push edx
push 0
call fcn.004056a0
add esp, 8
push 1
mov eax, dword [0x41ca2c]
push eax
call sub.ODBC32.dll_SQLFreeStmt
push 0
mov ecx, dword [0x41ca48]
push ecx
call fcn.004056a0
add esp, 8
mov edx, dword [0x41ca48]
push edx
mov eax, dword [0x41ca18]
push eax
call fcn.004057f0
add esp, 8
push 1
call fcn.00407067
cmp dword [0x41ca1c], 1
jne 0x404c25
cmp dword [0x41c4ec], 1
jne 0x404c25
cmp dword [0x41ca20], 1
je 0x404c12
cmp dword [0x41ca20], 3
jne 0x404c25
push 1
push 0x4cd
mov ecx, dword [0x41ca48]
push ecx
call sub.ODBC32.dll_SQLSetConnectOption
mov edx, dword [0x41ca1c]
push edx
mov eax, dword [0x41ca38]
push eax
mov ecx, dword [0x41ca60]
push ecx
mov edx, dword [0x41ca08]
push edx
mov eax, dword [0x41ca48]
push eax
call sub.odbcbcp.dll_Ordinal_11
movsx ecx, ax
test ecx, ecx
jne 0x404c57
jmp 0x404ba3
cmp dword [0x41ca5c], 0
je 0x404c74
mov edx, dword [0x41ca5c]
push edx
push 0xa
mov eax, dword [0x41ca48]
push eax
call sub.odbcbcp.dll_Ordinal_9
cmp dword [0x41ca1c], 1
jne 0x404c96
cmp dword [0x41ca04], 0
je 0x404c96
push 1
push 8
mov ecx, dword [0x41ca48]
push ecx
call sub.odbcbcp.dll_Ordinal_9
cmp dword [0x41ca1c], 1
jne 0x404cb8
cmp dword [0x41c4f8], 0
je 0x404cb8
push 1
push 5
mov edx, dword [0x41ca48]
push edx
call sub.odbcbcp.dll_Ordinal_9
cmp dword [0x41c504], 0
jle 0x404ce1
mov eax, dword [0x41c504]
push eax
push 0xf
mov ecx, dword [0x41ca48]
push ecx
call sub.odbcbcp.dll_Ordinal_9
movsx edx, ax
test edx, edx
jne 0x404ce1
jmp 0x404ba3
cmp dword [0x41ca30], 0xffffffff
je 0x404cfe
mov eax, dword [0x41ca30]
push eax
push 1
mov ecx, dword [0x41ca48]
push ecx
call sub.odbcbcp.dll_Ordinal_9
cmp dword [0x41ca3c], 0xffffffff
je 0x404d1b
mov edx, dword [0x41ca3c]
push edx
push 4
mov eax, dword [0x41ca48]
push eax
call sub.odbcbcp.dll_Ordinal_9
cmp dword [0x41ca4c], 0xffffffff
je 0x404d39
mov ecx, dword [0x41ca4c]
push ecx
push 2
mov edx, dword [0x41ca48]
push edx
call sub.odbcbcp.dll_Ordinal_9
cmp dword [0x41ca34], 0xffffffff
je 0x404d56
mov eax, dword [0x41ca34]
push eax
push 3
mov ecx, dword [0x41ca48]
push ecx
call sub.odbcbcp.dll_Ordinal_9
cmp dword [0x41b214], 0x7fffffff
je 0x404d76
mov edx, dword [0x41b214]
push edx
push 0xc
mov eax, dword [0x41ca48]
push eax
call sub.odbcbcp.dll_Ordinal_9
push 1
push 0x4052b0
call dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
test eax, eax
jne 0x404d8c
jmp 0x404ba3
mov ecx, dword [0x41ca20]
mov dword [ebp - 0x27dc0], ecx
cmp dword [ebp - 0x27dc0], 5
ja case.default.0x404dab
mov edx, dword [ebp - 0x27dc0]
jmp dword [edx*4 + 0x405290]
mov eax, dword [0x41ca0c]
push eax
lea ecx, [ebp - 0x27db8]
push ecx
mov edx, dword [0x41ca24]
push edx
mov eax, dword [0x41ca54]
push eax
mov cx, word [ebp - 4]
push ecx
mov edx, dword [0x41ca68]
push edx
mov eax, dword [0x41ca50]
push eax
mov ecx, dword [0x41ca48]
push ecx
call fcn.004030c0
add esp, 0x20
movsx edx, ax
test edx, edx
jne 0x404df9
jmp 0x404ba3
jmp case.default.0x404dab
push 1
push 0xd
mov eax, dword [0x41ca48]
push eax
call sub.odbcbcp.dll_Ordinal_9
mov ecx, dword [0x41ca10]
push ecx
mov edx, dword [0x41ca24]
push edx
mov eax, dword [0x41ca40]
push eax
mov ecx, dword [0x41ca54]
push ecx
movzx edx, word [ebp - 4]
push edx
mov eax, dword [0x41ca48]
push eax
call fcn.00405300
add esp, 0x18
movsx ecx, ax
test ecx, ecx
jne 0x404e47
jmp 0x404ba3
jmp case.default.0x404dab
push 1
push 0xe
mov edx, dword [0x41ca48]
push edx
call sub.odbcbcp.dll_Ordinal_9
mov eax, dword [0x41ca10]
push eax
mov ecx, dword [0x41ca24]
push ecx
mov edx, dword [0x41ca40]
push edx
mov eax, dword [0x41ca54]
push eax
movzx ecx, word [ebp - 4]
push ecx
mov edx, dword [0x41ca48]
push edx
call fcn.00405300
add esp, 0x18
movsx eax, ax
test eax, eax
jne 0x404e96
jmp 0x404ba3
jmp case.default.0x404dab
lea ecx, [ebp - 0x27db8]
push ecx
mov edx, dword [0x41ca10]
push edx
mov eax, dword [0x41ca24]
push eax
mov ecx, dword [0x41ca40]
push ecx
mov edx, dword [0x41ca54]
push edx
movzx eax, word [ebp - 4]
push eax
mov ecx, dword [0x41ca48]
push ecx
call fcn.00405420
add esp, 0x1c
movsx edx, ax
test edx, edx
jne 0x404edd
jmp 0x404ba3
jmp case.default.0x404dab
mov eax, dword [0x41ca28]
push eax
mov ecx, dword [0x41ca48]
push ecx
call sub.odbcbcp.dll_Ordinal_15
movsx edx, ax
test edx, edx
jne 0x404efd
jmp 0x404ba3
jmp case.default.0x404dab
lea eax, [ebp - 0x27db8]
push eax
mov ecx, dword [0x41ca10]
push ecx
mov edx, dword [0x41ca24]
push edx
mov eax, dword [0x41ca40]
push eax
mov ecx, dword [0x41ca54]
push ecx
movzx edx, word [ebp - 4]
push edx
mov eax, dword [0x41ca48]
push eax
call fcn.00405420
add esp, 0x1c
movsx ecx, ax
test ecx, ecx
jne case.default.0x404dab
jmp 0x404ba3
cmp dword [0x41c4e8], 0
je 0x404f6c
mov edx, dword [0x41ca28]
push edx
mov eax, dword [0x41ca48]
push eax
call sub.odbcbcp.dll_Ordinal_16
movsx ecx, ax
test ecx, ecx
jne 0x404f67
jmp 0x404ba3
jmp 0x405238
push 0x30
mov edx, dword [0x41ca68]
push edx
call fcn.004055c0
add esp, 8
lea eax, [ebp - 0x1b8]
push eax
call fcn.00408068
add esp, 4
push 1
push 4
mov ecx, dword [0x41ca48]
push ecx
call sub.ODBC32.dll_SQLSetConnectOption
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [0x41ca48]
push eax
call sub.odbcbcp.dll_Ordinal_12
mov word [ebp - 0x1ac], ax
push 0
mov ecx, dword [0x41ca48]
push ecx
call fcn.004056a0
add esp, 8
movsx edx, word [ebp - 0x1ac]
cmp edx, 3
je 0x404f9c
movsx eax, word [ebp - 0x1ac]
test eax, eax
jne 0x405050
cmp dword [ebp - 0x1c], 1
jge 0x405050
push 0x100
lea ecx, [ebp - 0x120]
push ecx
push 0x35
mov edx, dword [0x41ca14]
push edx
call dword [sym.imp.USER32.dll_LoadStringA]
lea eax, [ebp - 0x120]
push eax
lea ecx, [ebp - 0x120]
push ecx
call dword [sym.imp.USER32.dll_CharToOemA]
cmp dword [0x41ca1c], 1
jne 0x405024
mov dword [ebp - 0x27dc4], 0x41b2a4
jmp 0x40502e
mov dword [ebp - 0x27dc4], 0x41b2a8
mov edx, dword [ebp - 0x27dc4]
push edx
lea eax, [ebp - 0x120]
push eax
mov ecx, dword [0x41ca68]
push ecx
call fcn.004069ae
add esp, 0xc
jmp 0x405238
lea edx, [ebp - 0x14]
push edx
call fcn.00408068
add esp, 4
mov eax, dword [ebp - 0x14]
sub eax, dword [ebp - 0x1b8]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jle 0x405085
mov ecx, dword [ebp - 0x18]
sub ecx, 1
mov dword [ebp - 0x18], ecx
movzx edx, word [ebp - 0x10]
add edx, 0x3e8
mov word [ebp - 0x10], dx
mov eax, dword [ebp - 0x18]
imul eax, eax, 0x3e8
mov dword [ebp - 0x18], eax
movzx ecx, word [ebp - 0x10]
movzx edx, word [ebp - 0x1b4]
sub ecx, edx
add ecx, dword [ebp - 0x18]
mov dword [ebp - 0x18], ecx
jne 0x4050ad
mov dword [ebp - 0x18], 1
push 0x100
lea eax, [ebp - 0x120]
push eax
push 0x31
mov ecx, dword [0x41ca14]
push ecx
call dword [sym.imp.USER32.dll_LoadStringA]
lea edx, [ebp - 0x120]
push edx
lea eax, [ebp - 0x120]
push eax
call dword [sym.imp.USER32.dll_CharToOemA]
mov ecx, dword [ebp - 0x1c]
push ecx
lea edx, [ebp - 0x120]
push edx
mov eax, dword [0x41ca68]
push eax
call fcn.004069ae
add esp, 0xc
push 0x41b210
push 0x70
mov ecx, dword [0x41ca48]
push ecx
call sub.ODBC32.dll_SQLGetConnectOption
push 0x100
lea edx, [ebp - 0x120]
push edx
push 0x33
mov eax, dword [0x41ca14]
push eax
call dword [sym.imp.USER32.dll_LoadStringA]
lea ecx, [ebp - 0x120]
push ecx
lea edx, [ebp - 0x120]
push edx
call dword [sym.imp.USER32.dll_CharToOemA]
mov eax, dword [0x41b210]
push eax
lea ecx, [ebp - 0x120]
push ecx
mov edx, dword [0x41ca68]
push edx
call fcn.004069ae
add esp, 0xc
push 0x100
lea eax, [ebp - 0x120]
push eax
push 0x32
mov ecx, dword [0x41ca14]
push ecx
call dword [sym.imp.USER32.dll_LoadStringA]
lea edx, [ebp - 0x120]
push edx
lea eax, [ebp - 0x120]
push eax
call dword [sym.imp.USER32.dll_CharToOemA]
mov ecx, dword [ebp - 0x18]
push ecx
lea edx, [ebp - 0x120]
push edx
mov eax, dword [0x41ca68]
push eax
call fcn.004069ae
add esp, 0xc
cmp dword [ebp - 0x1c], 0
jle 0x405224
push 0x100
lea ecx, [ebp - 0x120]
push ecx
push 0x34
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.USER32.dll_LoadStringA]
lea edx, [ebp - 0x120]
push edx
lea eax, [ebp - 0x120]
push eax
call dword [sym.imp.USER32.dll_CharToOemA]
cmp dword [ebp - 0x1c], 1
jle 0x4051e6
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x27dc8], ecx
jmp 0x4051f0
mov dword [ebp - 0x27dc8], 1
fild dword [ebp - 0x1c]
fild dword [ebp - 0x18]
fdiv qword [0x4171f0]
fdivp st(1)
sub esp, 8
fstp qword [esp]
mov eax, dword [ebp - 0x18]
cdq
idiv dword [ebp - 0x27dc8]
push eax
lea edx, [ebp - 0x120]
push edx
mov eax, dword [0x41ca68]
push eax
call fcn.004069ae
add esp, 0x14
push 0x41b2ac
mov ecx, dword [0x41ca68]
push ecx
call fcn.004069ae
add esp, 8
mov edx, dword [0x41ca48]
push edx
mov eax, dword [0x41ca18]
push eax
call fcn.004057f0
add esp, 8
cmp dword [0x41ca24], 0
je 0x405265
mov ecx, dword [0x41ca24]
push ecx
call fcn.00406a11
add esp, 4
cmp dword [0x41ca54], 0
je 0x40527d
mov edx, dword [0x41ca54]
push edx
call fcn.00406a11
add esp, 4
push 0
call fcn.00407067
mov ecx, dword [ebp - 0x20]
call fcn.004073a0
mov esp, ebp
pop ebp
ret