Function at 0x40e530
Capabilities:
Enumerate files on windows
Reference sql statements

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41c61f
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
mov eax, 0x229c
call fcn.00419810
mov eax, dword [0x42729c]
mov dword [ebp - 0x14], eax
push edi
mov ax, word [0x41fea0]
mov word [ebp - 0x126c], ax
mov ecx, 0x1ff
xor eax, eax
lea edi, [ebp - 0x126a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov dword [ebp - 0x1680], 0xffffffff
mov ecx, dword [ebp + 0x20]
imul ecx, ecx, 0x3c
mov dword [ebp - 0x268], ecx
mov dword [ebp - 0x1270], 0
lea edx, [ebp - 0x1270]
push edx
call dword [sym.imp.MSVCR71.dll_time]
add esp, 4
mov eax, dword [ebp + 8]
push eax
push 0x800
lea ecx, [ebp - 0x1e84]
push ecx
call fcn.00417a00
mov edx, dword [ebp + 8]
push edx
push 0x800
lea eax, [ebp - 0xa6c]
push eax
call fcn.00417a00
cmp dword [ebp + 0xc], 0
je 0x40e631
mov ecx, dword [ebp + 0x10]
push ecx
push 0x800
lea edx, [ebp - 0x1e84]
push edx
call fcn.00417d60
push 0x41fea4
push 0x800
lea eax, [ebp - 0x1e84]
push eax
call fcn.00417d60
mov ecx, dword [ebp + 0x10]
push ecx
push 0x800
lea edx, [ebp - 0xa6c]
push edx
call fcn.00417d60
push 0x41fea8
push 0x800
lea eax, [ebp - 0xa6c]
push eax
call fcn.00417d60
mov ecx, dword [ebp + 0x10]
push ecx
push 0x800
lea edx, [ebp - 0x1e84]
push edx
call fcn.00417d60
push 0x41feac
push 0x800
lea eax, [ebp - 0x1e84]
push eax
call fcn.00417d60
cmp dword [ebp + 0x18], 0
je 0x40e6ae
mov ecx, dword [ebp + 0x18]
push ecx
call dword [sym.imp.MSVCR71.dll_wcslen]
add esp, 4
test eax, eax
jbe 0x40e6ae
mov edx, dword [ebp + 0x18]
push edx
push 0x400
lea eax, [ebp - 0x1674]
push eax
call fcn.00417a00
lea ecx, [ebp - 0x1678]
push ecx
lea edx, [ebp - 0x1674]
push edx
call fcn.004076b0
add esp, 8
test eax, eax
jne 0x40e6a9
xor eax, eax
jmp 0x40eafd
jmp 0x40e7be
lea ecx, [ebp - 0x2298]
call fcn.00418f50
mov dword [ebp - 4], 0
mov eax, dword [ebp + 0x14]
push eax
push str.SELECT_TOP_1_b.backup_start_date_FROM_msdb.dbo.backupset_b__msdb.dbo.restorehistory_r_WHERE_b.backup_set_id__r.backup_set_id_AND_r.destination_database_name__N_s_ORDER_BY_b.backup_set_id_desc
lea ecx, [ebp - 0x2294]
push ecx
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0xc
mov ecx, 0x432214
call fcn.004188a0
mov dword [ebp - 0x22a4], eax
push 0
lea ecx, [ebp - 0x2298]
call fcn.00418fc0
push eax
lea edx, [ebp - 0x2294]
push edx
mov eax, dword [ebp - 0x22a4]
push eax
mov ecx, dword [ebp - 0x22a4]
mov edx, dword [ecx]
call dword [edx + 0x170]
push eax
call fcn.00407110
add esp, 4
test eax, eax
jne 0x40e76a
lea ecx, [ebp - 0x2298]
call fcn.00418fe0
test eax, eax
jne 0x40e76a
lea ecx, [ebp - 0x2298]
call fcn.00419000
mov dword [ebp - 0x22a8], eax
lea eax, [ebp - 0x1e94]
push eax
push 0
push 0
mov ecx, dword [ebp - 0x22a8]
push ecx
mov edx, dword [ebp - 0x22a8]
mov eax, dword [edx]
call dword [eax + 0x5c]
push eax
call fcn.00407110
add esp, 4
test eax, eax
je 0x40e776
mov dword [ebp - 0x1678], 0
jmp 0x40e7ac
sub esp, 0x10
mov ecx, esp
mov edx, dword [ebp - 0x1e94]
mov dword [ecx], edx
mov eax, dword [ebp - 0x1e90]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x1e8c]
mov dword [ecx + 8], edx
mov eax, dword [ebp - 0x1e88]
mov dword [ecx + 0xc], eax
call fcn.0040f020
add esp, 0x10
mov dword [ebp - 0x1678], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2298]
call fcn.00418f70
mov ecx, dword [ebp + 0x1c]
mov word [ecx], 0
lea edx, [ebp - 0x264]
push edx
lea eax, [ebp - 0x1e84]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [ebp - 0x167c], eax
cmp dword [ebp - 0x167c], 0xffffffff
je 0x40e8a4
lea ecx, [ebp - 0x10]
push ecx
lea edx, [ebp - 0x238]
push edx
call fcn.004076b0
add esp, 8
test eax, eax
je 0x40e87b
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x1678]
jle 0x40e87b
mov ecx, dword [ebp - 0x10]
sub ecx, dword [ebp - 0x1678]
mov dword [ebp - 0x229c], ecx
mov edx, dword [ebp - 0x1270]
sub edx, dword [ebp - 0x10]
mov dword [ebp - 0x22a0], edx
cmp dword [ebp - 0x1680], 0
jl 0x40e844
mov eax, dword [ebp - 0x1680]
cmp eax, dword [ebp - 0x229c]
jle 0x40e87b
mov ecx, dword [ebp + 0x20]
imul ecx, ecx, 0x3c
cmp dword [ebp - 0x22a0], ecx
jg 0x40e858
cmp dword [ebp + 0x20], 0
jne 0x40e87b
lea edx, [ebp - 0x238]
push edx
lea eax, [ebp - 0x126c]
push eax
call dword [sym.imp.MSVCR71.dll_wcscpy]
add esp, 8
mov ecx, dword [ebp - 0x229c]
mov dword [ebp - 0x1680], ecx
lea edx, [ebp - 0x264]
push edx
mov eax, dword [ebp - 0x167c]
push eax
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x40e7ed
mov ecx, dword [ebp - 0x167c]
push ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp dword [ebp - 0x1680], 0
jge 0x40e8e3
mov edx, dword [ebp + 0x14]
push edx
push str.No_more_files_to_load_for_database__s._r_n
push 0x4298a0
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0xc
push 0x4298a0
call fcn.00407f40
add esp, 4
mov eax, dword [ebp + 0x1c]
mov word [eax], 0
mov eax, 1
jmp 0x40eafd
lea ecx, [ebp - 0xa6c]
push ecx
push 0x400
lea edx, [ebp - 0x1674]
push edx
call fcn.00417a00
lea eax, [ebp - 0x126c]
push eax
push 0x400
lea ecx, [ebp - 0x1674]
push ecx
call fcn.00417d60
mov edx, dword [ebp + 0x14]
push edx
lea eax, [ebp - 0x1674]
push eax
call fcn.0040eb20
add esp, 8
test eax, eax
je 0x40e973
mov ecx, dword [ebp + 0x14]
push ecx
lea edx, [ebp - 0x1674]
push edx
push 0x420098
push 0x4298a0
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0x10
push 0x4298a0
call fcn.00407f40
add esp, 4
lea eax, [ebp - 0x1674]
push eax
mov ecx, dword [ebp + 0x1c]
push ecx
call dword [sym.imp.MSVCR71.dll_wcscpy]
add esp, 8
mov eax, 1
jmp 0x40eafd
mov word [0x428734], 0
push 0x427924
lea edx, [ebp - 0x1674]
push edx
push str.Error_on_loading_file__s_:___s
push 0x4298a0
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0x10
mov word [0x42a840], 0
push 0x4298a0
push 0x1000
push 0x427924
call fcn.00417a00
cmp dword [0x428930], 0x10d1
je 0x40e9cb
xor eax, eax
jmp 0x40eafd
lea eax, [ebp - 0x264]
push eax
lea ecx, [ebp - 0x1e84]
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [ebp - 0x167c], eax
cmp dword [ebp - 0x167c], 0xffffffff
je 0x40eafb
lea edx, [ebp - 0xa6c]
push edx
push 0x400
lea eax, [ebp - 0x1674]
push eax
call fcn.00417a00
lea ecx, [ebp - 0x238]
push ecx
push 0x400
lea edx, [ebp - 0x1674]
push edx
call fcn.00417d60
cmp dword [ebp + 0x24], 0
jne 0x40ea45
mov eax, dword [ebp + 0x18]
push eax
lea ecx, [ebp - 0x1674]
push ecx
call dword [sym.imp.MSVCR71.dll__wcsicmp]
add esp, 8
test eax, eax
jne 0x40ea45
jmp 0x40ead2
lea edx, [ebp - 0x10]
push edx
lea eax, [ebp - 0x238]
push eax
call fcn.004076b0
add esp, 8
test eax, eax
je 0x40ead2
cmp dword [ebp + 0x20], 0
je 0x40ea75
mov ecx, dword [ebp - 0x1270]
sub ecx, dword [ebp - 0x10]
mov edx, dword [ebp + 0x20]
imul edx, edx, 0x3c
cmp ecx, edx
jle 0x40ead2
mov eax, dword [ebp + 0x14]
push eax
lea ecx, [ebp - 0x1674]
push ecx
call fcn.0040eb20
add esp, 8
test eax, eax
je 0x40ead2
mov edx, dword [ebp + 0x14]
push edx
lea eax, [ebp - 0x1674]
push eax
push str.File__s_for_database__s_was_successfully_loaded._r_n
push 0x4298a0
call dword [sym.imp.MSVCR71.dll_swprintf]
add esp, 0x10
push 0x4298a0
call fcn.00407f40
add esp, 4
lea ecx, [ebp - 0x1674]
push ecx
mov edx, dword [ebp + 0x1c]
push edx
call dword [sym.imp.MSVCR71.dll_wcscpy]
add esp, 8
mov eax, 1
jmp 0x40eafd
lea eax, [ebp - 0x264]
push eax
mov ecx, dword [ebp - 0x167c]
push ecx
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x40e9f2
mov edx, dword [ebp - 0x167c]
push edx
call dword [sym.imp.KERNEL32.dll_FindClose]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x14]
call fcn.00419641
pop edi
mov esp, ebp
pop ebp
ret