Function at 0x403710
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x416748
push 0x407eec
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
mov eax, 0x1f824
call fcn.00407db0
mov eax, dword [0x41b2c0]
mov dword [ebp - 0x20], eax
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
mov dword [ebp - 0x428], 1
mov dword [ebp - 0x42c], 0
mov dword [ebp - 4], 0
push 0
lea eax, [ebp - 0x1f834]
push eax
push 2
push 0x416180
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0x400
push 0
push 0x41bc40
call fcn.00407c90
add esp, 0xc
push str.Input_buffer_SPIDs
push 0x41bc40
call fcn.00407700
add esp, 8
push 0
lea edx, [ebp - 0x1f834]
push edx
push 0x41bc40
call fcn.00407800
add esp, 4
push eax
push 0x41bc40
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea ecx, [ebp - 0x1f834]
push ecx
push 2
push 0x416198
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0x41bc40
call fcn.00407800
add esp, 4
push eax
push 0x2d
push 0x41bc40
call fcn.00407900
add esp, 0xc
push 0
lea eax, [ebp - 0x1f834]
push eax
push 0x41bc40
call fcn.00407800
add esp, 4
push eax
push 0x41bc40
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea edx, [ebp - 0x1f834]
push edx
push 2
push 0x41619c
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp + 0x14]
push ecx
call sub.ODBC32.dll_SQLCancel
push str.select_spid_from_sysprocesses
lea edx, [ebp - 0x420]
push edx
call fcn.00407700
add esp, 8
push 0xfffffffffffffffd
lea eax, [ebp - 0x420]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
call sub.ODBC32.dll_SQLExecDirect
movsx edx, ax
mov dword [ebp - 0x1f838], edx
cmp dword [ebp - 0x1f838], 0
je 0x4038b0
cmp dword [ebp - 0x1f838], 1
je 0x4038b0
mov eax, dword [ebp - 0x1f838]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
call fcn.00405cd0
add esp, 8
push 0
push 0
push 0
push 0xe0000105
call dword [sym.imp.KERNEL32.dll_RaiseException]
mov dword [ebp - 0x1c], 0
lea edx, [ebp - 0x42c]
push edx
push 4
mov eax, dword [ebp - 0x1c]
lea ecx, [ebp + eax*4 - 0x1f830]
push ecx
push 0xffffffffffffffee
push 1
mov edx, dword [ebp + 0x14]
push edx
call sub.ODBC32.dll_SQLGetData
mov eax, dword [ebp - 0x1c]
add eax, 1
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp + 0x14]
push ecx
call sub.ODBC32.dll_SQLFetch
movsx edx, ax
mov dword [ebp - 0x1f838], edx
cmp dword [ebp - 0x1f838], 0
je 0x4038b7
cmp dword [ebp - 0x1f838], 1
je 0x4038b7
mov eax, dword [ebp + 0x14]
push eax
call sub.ODBC32.dll_SQLMoreResults
movsx ecx, ax
cmp ecx, 0x64
jne 0x4038b7
mov word [ebp - 0x424], 0
jmp 0x403933
mov dx, word [ebp - 0x424]
add dx, 1
mov word [ebp - 0x424], dx
movsx eax, word [ebp - 0x424]
cmp eax, dword [ebp - 0x1c]
jge 0x403a57
movsx ecx, word [ebp - 0x424]
cmp dword [ebp + ecx*4 - 0x1f830], 0x32
jge 0x403956
jmp 0x403921
mov edx, dword [ebp + 0x14]
push edx
call sub.ODBC32.dll_SQLCancel
push 0x400
push 0
lea eax, [ebp - 0x420]
push eax
call fcn.00407c90
add esp, 0xc
movsx ecx, word [ebp - 0x424]
mov edx, dword [ebp + ecx*4 - 0x1f830]
push edx
push str.DBCC_INPUTBUFFER___d_
lea eax, [ebp - 0x420]
push eax
call fcn.00407ff2
add esp, 0xc
lea ecx, [ebp - 0x420]
push ecx
push 0x4161d8
push 0x41bc40
call fcn.00407ff2
add esp, 0xc
push 0
lea edx, [ebp - 0x1f834]
push edx
push 0x41bc40
call fcn.00407800
add esp, 4
push eax
push 0x41bc40
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea ecx, [ebp - 0x1f834]
push ecx
push 2
push 0x4161e0
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0xfffffffffffffffd
lea eax, [ebp - 0x420]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
call sub.ODBC32.dll_SQLExecDirect
movsx edx, ax
mov dword [ebp - 0x1f83c], edx
cmp dword [ebp - 0x1f83c], 0
je 0x403a42
cmp dword [ebp - 0x1f83c], 1
je 0x403a42
mov eax, dword [ebp - 0x1f83c]
push eax
mov ecx, dword [ebp + 0x14]
push ecx
call fcn.00405cd0
add esp, 8
push 0
push 0
push 0
push 0xe0000105
call dword [sym.imp.KERNEL32.dll_RaiseException]
mov edx, dword [ebp + 0x14]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.00402e70
add esp, 8
jmp 0x403921
mov dword [ebp - 4], 0xffffffff
jmp 0x403a7a
cmp dword [ebp - 0x428], 0
jne 0x403ad5
push 0
lea ecx, [ebp - 0x1f834]
push ecx
push 0x4161e4
call fcn.00407800
add esp, 4
push eax
push 0x4161fc
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea eax, [ebp - 0x1f834]
push eax
push 2
push 0x416214
mov ecx, dword [ebp + 8]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push str._Unable_to_execute_query__n
push 0x41b080
call fcn.00407930
add esp, 8
mov eax, dword [ebp - 0x428]
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x20]
call fcn.00407d96
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret