Function at 0x41de50
Capabilities:
Check if file exists
Enumerate files on windows
Get common file path
Get file attributes
Set current directory

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x557391
mov eax, dword fs:[0]
push eax
sub esp, 0x480
mov eax, dword [0x5d7b20]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
mov dword [ebp - 0x480], eax
mov dword [ebp - 0x478], 1
call fcn.0044c104
xor ecx, ecx
xor ebx, ebx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x41deb0
push 0x80004005
call fcn.00403e70
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [ebp - 0x474], edi
push str.DeleteTwainSource__________________________________IN_n
push 5
mov dword [ebp - 4], ebx
call fcn.00403ab0
add esp, 8
cmp esi, ebx
je 0x41e330
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x41dee1
sub eax, edx
sar eax, 1
je 0x41e330
push 0x105
lea ecx, [ebp - 0x21c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
jne 0x41df36
lea eax, [edi - 0x10]
mov dword [ebp - 4], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x41df2f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x41e358
push str.Twain_32
lea ecx, [ebp - 0x21c]
push 0x105
push ecx
call fcn.0053e396
push 0x56825c
lea edx, [ebp - 0x21c]
push 0x105
push edx
call fcn.0053e396
add esp, 0x18
lea eax, [ebp - 0x21c]
push eax
lea ecx, [ebp - 0x474]
call fcn.00405db0
push esi
lea ecx, [ebp - 0x474]
call fcn.004062b0
mov edi, dword [ebp - 0x474]
cmp dword [edi - 0xc], ebx
jle 0x41e2d0
push 0x3f
push edi
call fcn.0053fa2a
add esp, 8
cmp eax, ebx
je 0x41e2d0
sub eax, edi
sar eax, 1
js 0x41e2d0
mov ecx, dword [edi - 0xc]
mov eax, 1
sub eax, dword [edi - 4]
mov dword [ebp - 0x488], ecx
mov ecx, dword [edi - 8]
or ecx, eax
jge 0x41dfd9
push ebx
lea ecx, [ebp - 0x474]
call fcn.004045b0
mov edi, dword [ebp - 0x474]
lea edx, [ebp - 0x46c]
push edx
push edi
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov dword [ebp - 0x47c], eax
cmp eax, 0xffffffff
jne 0x41e011
push str.DeleteTwainSource____SUCCESS__FindFirstFile___:_Delete_directory_files_not_found.__n
push 5
call fcn.00403ab0
add esp, 8
lea ecx, [ebp - 0x474]
call fcn.00417700
jmp 0x41e353
call fcn.0044c104
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
je 0x41dea6
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x470], eax
push 0x5c
push edi
mov byte [ebp - 4], 1
call fcn.0053dd9b
add esp, 8
cmp eax, ebx
je 0x41e0b3
sub eax, edi
sar eax, 1
js 0x41e0b3
push 0x5c
push edi
call fcn.0053dd9b
add esp, 8
cmp eax, ebx
jne 0x41e064
or eax, 0xffffffff
jmp 0x41e068
sub eax, edi
sar eax, 1
push eax
lea ecx, [ebp - 0x484]
push ecx
lea ecx, [ebp - 0x474]
call fcn.00405240
push eax
lea ecx, [ebp - 0x470]
mov byte [ebp - 4], 2
call fcn.00405460
mov eax, dword [ebp - 0x484]
add eax, 0xfffffff0
mov byte [ebp - 4], 1
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x41e0c5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x41e0c5
lea ecx, [ebp - 0x474]
push ecx
lea ecx, [ebp - 0x470]
call fcn.00405460
push 1
push 0x56825c
lea ecx, [ebp - 0x470]
call fcn.00405330
lea eax, [ebp - 0x440]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x41e0e0
sub eax, edx
sar eax, 1
push eax
lea edx, [ebp - 0x440]
push edx
lea ecx, [ebp - 0x470]
call fcn.00405330
mov esi, dword [ebp - 0x470]
mov ecx, dword [esi - 8]
mov eax, 1
sub eax, dword [esi - 4]
or ecx, eax
jge 0x41e129
push ebx
lea ecx, [ebp - 0x470]
call fcn.004045b0
mov esi, dword [ebp - 0x470]
push esi
push str.InUseTwainSourceFromFiles____FindFilePath____1_s___n
push 5
call fcn.00403ab0
mov eax, dword [ebp - 0x488]
add esp, 0xc
cmp eax, ebx
je 0x41e160
cmp eax, dword [esi - 0xc]
je 0x41e160
lea eax, [esi - 0x10]
mov byte [ebp - 4], bl
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x41e258
mov ecx, dword [esi - 8]
mov eax, 1
sub eax, dword [esi - 4]
or ecx, eax
jge 0x41e181
push ebx
lea ecx, [ebp - 0x470]
call fcn.004045b0
mov esi, dword [ebp - 0x470]
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x41e245
test al, 0x10
je 0x41e245
lea ecx, [ebp - 0x440]
push 0x571548
push ecx
call fcn.0053e2bf
add esp, 8
test eax, eax
je 0x41e296
lea edx, [ebp - 0x440]
push 0x571540
push edx
call fcn.0053e2bf
add esp, 8
test eax, eax
je 0x41e296
mov ecx, dword [esi - 8]
mov eax, 1
sub eax, dword [esi - 4]
or ecx, eax
jge 0x41e1f2
push ebx
lea ecx, [ebp - 0x470]
call fcn.004045b0
mov esi, dword [ebp - 0x470]
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
test eax, eax
je 0x41e2a6
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
mov ecx, dword [esi - 8]
mov eax, 1
sub eax, dword [esi - 4]
or ecx, eax
jge 0x41e22f
push ebx
lea ecx, [ebp - 0x470]
call fcn.004045b0
mov esi, dword [ebp - 0x470]
mov ecx, dword [ebp - 0x480]
push ecx
push esi
call fcn.0041d640
add esp, 8
and dword [ebp - 0x478], eax
lea eax, [esi - 0x10]
mov byte [ebp - 4], bl
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x41e264
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [ebp - 0x47c]
lea ecx, [ebp - 0x46c]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_FindNextFileW]
test eax, eax
jne 0x41e011
lea ecx, [ebp - 0x474]
call fcn.00417700
mov eax, dword [ebp - 0x478]
jmp 0x41e358
lea ecx, [ebp - 0x470]
mov byte [ebp - 4], bl
call fcn.00417700
jmp 0x41e264
push str.DeleteTwainSource____SUCCESS__SetCurrentDirectory___:_Already_deleted.__n
push 5
call fcn.00403ab0
add esp, 8
lea ecx, [ebp - 0x470]
call fcn.00417700
lea ecx, [ebp - 0x474]
call fcn.00417700
jmp 0x41e353
mov esi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push edi
call esi
test eax, eax
jne 0x41e2e7
push str.DeleteTwainSource____SUCCESS__SetCurrentDirectory___:_Already_deleted.__n
jmp 0x41dff7
lea eax, [ebp - 0x21c]
push eax
call esi
mov ecx, 1
sub ecx, dword [edi - 4]
or ecx, dword [edi - 8]
jge 0x41e30f
push ebx
lea ecx, [ebp - 0x474]
call fcn.004045b0
mov edi, dword [ebp - 0x474]
mov edx, dword [ebp - 0x480]
push edx
push edi
call fcn.0041d640
add esp, 8
lea ecx, [ebp - 0x474]
mov esi, eax
call fcn.00417700
mov eax, esi
jmp 0x41e358
lea eax, [edi - 0x10]
mov dword [ebp - 4], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x41e353
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0053e1ad
mov esp, ebp
pop ebp
ret