Function at 0x401024
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xadc
push edi
mov dword [ebp - 0x64c], 0
mov dword [ebp - 0x6d4], 0
mov dword [ebp - 0x304], 0
mov al, byte [0x40aa88]
mov byte [ebp - 0x33c], al
mov ecx, 8
xor eax, eax
lea edi, [ebp - 0x33b]
rep stosd dword es:[edi], eax
mov cl, byte [0x40aa8c]
mov byte [ebp - 0x648], cl
mov ecx, 0x20
xor eax, eax
lea edi, [ebp - 0x647]
rep stosd dword es:[edi], eax
mov dl, byte [0x40aa90]
mov byte [ebp - 0x5c4], dl
mov ecx, 0x20
xor eax, eax
lea edi, [ebp - 0x5c3]
rep stosd dword es:[edi], eax
mov al, byte [0x40aa94]
mov byte [ebp - 0x6d0], al
mov ecx, 0x20
xor eax, eax
lea edi, [ebp - 0x6cf]
rep stosd dword es:[edi], eax
cmp dword [ebp + 8], 1
je 0x4010da
cmp dword [ebp + 8], 2
jne 0x4010e6
push 0x4080d0
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx + 4]
push edx
call fcn.00401a70
add esp, 8
test eax, eax
jne 0x4010e6
call fcn.00401012
push 1
call fcn.0040198d
mov eax, dword [ebp + 8]
sub eax, 1
mov dword [ebp + 8], eax
cmp dword [ebp + 8], 0
jle 0x401323
mov ecx, dword [ebp + 0xc]
add ecx, 4
mov dword [ebp + 0xc], ecx
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
movsx ecx, byte [eax]
cmp ecx, 0x2d
je 0x401120
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
movsx ecx, byte [eax]
cmp ecx, 0x2f
jne 0x401323
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
add eax, 1
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
movsx ecx, byte [eax]
mov dword [ebp - 0xadc], ecx
mov edx, dword [ebp - 0xadc]
sub edx, 0x44
mov dword [ebp - 0xadc], edx
cmp dword [ebp - 0xadc], 0x31
ja case.0x401165.4
mov ecx, dword [ebp - 0xadc]
xor eax, eax
mov al, byte [ecx + 0x4016d9]
jmp dword [eax*4 + 0x4016c5]
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
add eax, 1
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
movsx ecx, byte [eax]
test ecx, ecx
jne 0x4011bd
mov edx, dword [ebp + 8]
sub edx, 1
test edx, edx
je 0x4011bd
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
movsx edx, byte [ecx]
cmp edx, 0x2d
je 0x4011bd
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
movsx edx, byte [ecx]
cmp edx, 0x2f
je 0x4011bd
mov eax, dword [ebp + 8]
sub eax, 1
mov dword [ebp + 8], eax
mov ecx, dword [ebp + 0xc]
add ecx, 4
mov dword [ebp + 0xc], ecx
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
push eax
lea ecx, [ebp - 0x5c4]
push ecx
call fcn.00401870
add esp, 8
jmp 0x40131e
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
add eax, 1
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
movsx ecx, byte [eax]
test ecx, ecx
jne 0x401228
mov edx, dword [ebp + 8]
sub edx, 1
test edx, edx
je 0x401228
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
movsx edx, byte [ecx]
cmp edx, 0x2d
je 0x401228
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
movsx edx, byte [ecx]
cmp edx, 0x2f
je 0x401228
mov eax, dword [ebp + 8]
sub eax, 1
mov dword [ebp + 8], eax
mov ecx, dword [ebp + 0xc]
add ecx, 4
mov dword [ebp + 0xc], ecx
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
push eax
lea ecx, [ebp - 0x6d0]
push ecx
call fcn.00401870
add esp, 8
jmp 0x40131e
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
add eax, 1
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
movsx ecx, byte [eax]
test ecx, ecx
jne 0x401293
mov edx, dword [ebp + 8]
sub edx, 1
test edx, edx
je 0x401293
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
movsx edx, byte [ecx]
cmp edx, 0x2d
je 0x401293
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
movsx edx, byte [ecx]
cmp edx, 0x2f
je 0x401293
mov eax, dword [ebp + 8]
sub eax, 1
mov dword [ebp + 8], eax
mov ecx, dword [ebp + 0xc]
add ecx, 4
mov dword [ebp + 0xc], ecx
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
push eax
lea ecx, [ebp - 0x648]
push ecx
call fcn.00401870
add esp, 8
jmp 0x40131e
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
add eax, 1
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
movsx ecx, byte [eax]
test ecx, ecx
jne 0x4012fb
mov edx, dword [ebp + 8]
sub edx, 1
test edx, edx
je 0x4012fb
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
movsx edx, byte [ecx]
cmp edx, 0x2d
je 0x4012fb
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
movsx edx, byte [ecx]
cmp edx, 0x2f
je 0x4012fb
mov eax, dword [ebp + 8]
sub eax, 1
mov dword [ebp + 8], eax
mov ecx, dword [ebp + 0xc]
add ecx, 4
mov dword [ebp + 0xc], ecx
mov edx, dword [ebp + 0xc]
mov eax, dword [edx]
push eax
lea ecx, [ebp - 0x33c]
push ecx
call fcn.00401870
add esp, 8
jmp 0x40131e
call fcn.00401000
push 1
call fcn.0040198d
jmp 0x4010e6
cmp dword [ebp + 8], 0
jle 0x401335
call fcn.00401000
push 1
call fcn.0040198d
lea edx, [ebp - 0x64c]
push edx
call sub.ODBC32.dll_SQLAllocEnv
mov word [ebp - 0x314], ax
lea eax, [ebp - 0x6d4]
push eax
mov ecx, dword [ebp - 0x64c]
push ecx
call sub.ODBC32.dll_SQLAllocConnect
mov word [ebp - 0x314], ax
mov edx, dword [ebp - 0x648]
and edx, 0xff
test edx, edx
je 0x40139e
push str.DRIVERSQL_Server_SERVER
lea eax, [ebp - 0x8d4]
push eax
call fcn.00401870
add esp, 8
lea ecx, [ebp - 0x648]
push ecx
lea edx, [ebp - 0x8d4]
push edx
call fcn.00401880
add esp, 8
jmp 0x4013c8
push str.DSN
lea eax, [ebp - 0x8d4]
push eax
call fcn.00401870
add esp, 8
lea ecx, [ebp - 0x33c]
push ecx
lea edx, [ebp - 0x8d4]
push edx
call fcn.00401880
add esp, 8
push 0x4080f8
lea eax, [ebp - 0x8d4]
push eax
call fcn.00401880
add esp, 8
push str.UID
lea ecx, [ebp - 0x8d4]
push ecx
call fcn.00401880
add esp, 8
lea edx, [ebp - 0x5c4]
push edx
lea eax, [ebp - 0x8d4]
push eax
call fcn.00401880
add esp, 8
push 0x408104
lea ecx, [ebp - 0x8d4]
push ecx
call fcn.00401880
add esp, 8
push str.PWD
lea edx, [ebp - 0x8d4]
push edx
call fcn.00401880
add esp, 8
lea eax, [ebp - 0x6d0]
push eax
lea ecx, [ebp - 0x8d4]
push ecx
call fcn.00401880
add esp, 8
push 0x408110
lea edx, [ebp - 0x8d4]
push edx
call fcn.00401880
add esp, 8
push 0
lea eax, [ebp - 0x340]
push eax
push 0x200
lea ecx, [ebp - 0x540]
push ecx
push 0xfffffffffffffffd
lea edx, [ebp - 0x8d4]
push edx
push 0
mov eax, dword [ebp - 0x6d4]
push eax
call sub.ODBC32.dll_SQLDriverConnect
mov word [ebp - 0x314], ax
movsx ecx, word [ebp - 0x314]
test ecx, ecx
je 0x4014a2
movsx edx, word [ebp - 0x314]
cmp edx, 1
jne 0x4014b4
push str._nCONNECTED_TO_SQL_SERVER
call fcn.00401833
add esp, 4
jmp 0x4015b6
push str._nCOULD_NOT_CONNECT_TO_SQL_SERVER_n
call fcn.00401833
add esp, 4
push 0
push 0x201
lea eax, [ebp - 0xad8]
push eax
lea ecx, [ebp - 0x308]
push ecx
lea edx, [ebp - 0x310]
push edx
push 0
mov eax, dword [ebp - 0x6d4]
push eax
mov ecx, dword [ebp - 0x64c]
push ecx
call sub.ODBC32.dll_SQLError
mov word [ebp - 0x314], ax
movsx edx, word [ebp - 0x314]
cmp edx, 0x64
je 0x401561
lea eax, [ebp - 0xad8]
push eax
mov ecx, dword [ebp - 0x308]
push ecx
lea edx, [ebp - 0x310]
push edx
push str._nSQLState:__s__Native_Error:__ld_nInfo._Message:__s_n
call fcn.00401833
add esp, 0x10
push 0
push 0x201
lea eax, [ebp - 0xad8]
push eax
lea ecx, [ebp - 0x308]
push ecx
lea edx, [ebp - 0x310]
push edx
push 0
mov eax, dword [ebp - 0x6d4]
push eax
mov ecx, dword [ebp - 0x64c]
push ecx
call sub.ODBC32.dll_SQLError
mov word [ebp - 0x314], ax
jmp 0x4014f9
push 1
mov edx, dword [ebp - 0x304]
push edx
call sub.ODBC32.dll_SQLFreeStmt
mov word [ebp - 0x314], ax
mov eax, dword [ebp - 0x6d4]
push eax
call sub.ODBC32.dll_SQLDisconnect
mov word [ebp - 0x314], ax
mov ecx, dword [ebp - 0x6d4]
push ecx
call sub.ODBC32.dll_SQLFreeConnect
mov word [ebp - 0x314], ax
mov edx, dword [ebp - 0x64c]
push edx
call sub.ODBC32.dll_SQLFreeEnv
mov word [ebp - 0x314], ax
push 1
call fcn.0040198d
lea eax, [ebp - 0x318]
push eax
push 0x100
lea ecx, [ebp - 0x300]
push ecx
push 7
mov edx, dword [ebp - 0x6d4]
push edx
call sub.ODBC32.dll_SQLGetInfo
mov word [ebp - 0x314], ax
lea eax, [ebp - 0x300]
push eax
push str._n_nODBC_SQL_Server_Driver_Version:__s
call fcn.00401833
add esp, 8
lea ecx, [ebp - 0x304]
push ecx
mov edx, dword [ebp - 0x6d4]
push edx
call sub.ODBC32.dll_SQLAllocStmt
mov word [ebp - 0x314], ax
push 0xfffffffffffffffd
push str.Select___version
mov eax, dword [ebp - 0x304]
push eax
call sub.ODBC32.dll_SQLExecDirect
mov word [ebp - 0x314], ax
push 0
push 0x200
lea ecx, [ebp - 0x200]
push ecx
push 1
push 1
mov edx, dword [ebp - 0x304]
push edx
call sub.ODBC32.dll_SQLBindCol
mov word [ebp - 0x314], ax
mov eax, dword [ebp - 0x304]
push eax
call sub.ODBC32.dll_SQLFetch
mov word [ebp - 0x314], ax
lea ecx, [ebp - 0x200]
push ecx
push str._n_nSQL_Server_Version:__s
call fcn.00401833
add esp, 8
push 1
mov edx, dword [ebp - 0x304]
push edx
call sub.ODBC32.dll_SQLFreeStmt
mov word [ebp - 0x314], ax
mov eax, dword [ebp - 0x6d4]
push eax
call sub.ODBC32.dll_SQLDisconnect
mov word [ebp - 0x314], ax
mov ecx, dword [ebp - 0x6d4]
push ecx
call sub.ODBC32.dll_SQLFreeConnect
mov word [ebp - 0x314], ax
mov edx, dword [ebp - 0x64c]
push edx
call sub.ODBC32.dll_SQLFreeEnv
mov word [ebp - 0x314], ax
pop edi
mov esp, ebp
pop ebp
ret