Function at 0x405980
Capabilities:
Enumerate files on windows
Get common file path

Disassembly:
sub esp, 0x3a0
lea eax, [esp + 0x1c]
push ebx
push ebp
push esi
push edi
xor ebx, ebx
push eax
push ebx
push ebx
push 0x8023
push ebx
xor ebp, ebp
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
test eax, eax
jne 0x405d32
mov edi, str.ArcSoft_
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x2c]
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea edx, [esp + 0x2c]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [esp + 0x2c]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov edi, 0x4155b4
lea eax, [esp + ecx + 0x2c]
or ecx, 0xffffffff
mov dword [esp + 0x28], eax
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x130]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
mov dword [esp + 0x18], eax
je 0x405d32
mov esi, 0x4155b0
lea eax, [esp + 0x15c]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x405a67
test cl, cl
je 0x405a63
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x405a67
add eax, 2
add esi, 2
test cl, cl
jne 0x405a43
xor eax, eax
jmp 0x405a6c
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x405d0c
mov esi, 0x4155ac
lea eax, [esp + 0x15c]
mov dl, byte [eax]
mov cl, dl
cmp dl, byte [esi]
jne 0x405aa4
test cl, cl
je 0x405aa0
mov dl, byte [eax + 1]
mov cl, dl
cmp dl, byte [esi + 1]
jne 0x405aa4
add eax, 2
add esi, 2
test cl, cl
jne 0x405a80
xor eax, eax
jmp 0x405aa9
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
je 0x405d0c
test byte [esp + 0x130], 0x10
je 0x405d0c
lea edi, [esp + 0x15c]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x2c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, dword [esp + 0x28]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x41559c
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x270]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x1c], edi
je 0x405d0c
push 0x130
call fcn.0040747f
add esp, 4
cmp eax, ebx
je 0x405b5c
lea edx, [esp + 0x15c]
lea ecx, [esp + 0x2c]
push edx
push ecx
mov ecx, eax
call fcn.00404ee0
jmp 0x405b5e
xor eax, eax
cmp eax, ebx
mov dword [esp + 0x10], eax
je 0x405d05
cmp ebp, ebx
jne 0x405b99
push 0x10
call fcn.0040747f
add esp, 4
cmp eax, ebx
je 0x405b8d
mov dl, byte [esp + 0x17]
mov dword [eax + 4], ebx
mov byte [eax], dl
mov dword [eax + 8], ebx
mov dword [eax + 0xc], ebx
jmp 0x405b8f
xor eax, eax
cmp eax, ebx
mov ebp, eax
je 0x405d05
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
sub ecx, eax
mov esi, eax
sar ecx, 2
cmp ecx, 1
jae 0x405c75
mov edx, dword [ebp + 4]
cmp edx, ebx
je 0x405bc2
mov ecx, eax
sub ecx, edx
sar ecx, 2
cmp ecx, 1
ja 0x405bc7
mov ecx, 1
cmp edx, ebx
jne 0x405bcf
xor eax, eax
jmp 0x405bd4
sub eax, edx
sar eax, 2
add eax, ecx
cmp eax, ebx
mov dword [esp + 0x24], eax
jge 0x405be0
xor eax, eax
lea edx, [eax*4]
push edx
call fcn.0040747f
mov edi, dword [ebp + 4]
add esp, 4
cmp edi, esi
mov dword [esp + 0x20], eax
mov ebx, eax
je 0x405c11
push edi
push ebx
call fcn.00406180
add edi, 4
add esp, 8
add ebx, 4
cmp edi, esi
jne 0x405bfd
lea eax, [esp + 0x10]
mov ecx, ebp
push eax
push 1
push ebx
call fcn.004060d0
mov ecx, dword [ebp + 8]
add ebx, 4
push ebx
push ecx
push esi
mov ecx, ebp
call fcn.004060a0
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 4]
push edx
push eax
mov ecx, ebp
call fcn.00405e80
mov ecx, dword [ebp + 4]
push ecx
call fcn.004072d0
mov esi, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
add esp, 4
mov ecx, ebp
lea eax, [esi + edx*4]
mov dword [ebp + 0xc], eax
call fcn.00405e60
mov edi, dword [esp + 0x1c]
lea ecx, [esi + eax*4 + 4]
mov dword [ebp + 8], ecx
mov dword [ebp + 4], esi
xor ebx, ebx
jmp 0x405d05
mov ecx, eax
sub ecx, esi
sar ecx, 2
cmp ecx, 1
jae 0x405cc3
lea edx, [esi + 4]
mov ecx, ebp
push edx
push eax
push esi
call fcn.004060a0
mov eax, dword [ebp + 8]
lea ecx, [esp + 0x10]
mov edx, eax
push ecx
sub edx, esi
mov ecx, 1
sar edx, 2
sub ecx, edx
push ecx
push eax
mov ecx, ebp
call fcn.004060d0
mov eax, dword [ebp + 8]
cmp esi, eax
je 0x405d01
mov edx, dword [esp + 0x10]
mov dword [esi], edx
add esi, 4
cmp esi, eax
jne 0x405cb4
jmp 0x405d01
lea ecx, [eax - 4]
push eax
push eax
mov dword [esp + 0x24], ecx
push ecx
mov ecx, ebp
call fcn.004060a0
mov ecx, dword [ebp + 8]
lea eax, [ecx - 4]
cmp esi, eax
je 0x405ced
mov edx, dword [eax - 4]
sub eax, 4
sub ecx, 4
cmp eax, esi
mov dword [ecx], edx
jne 0x405cde
lea eax, [esi + 4]
cmp esi, eax
je 0x405d01
mov ecx, dword [esp + 0x10]
mov dword [esi], ecx
add esi, 4
cmp esi, eax
jne 0x405cf4
add dword [ebp + 8], 4
push edi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov eax, dword [esp + 0x18]
lea edx, [esp + 0x130]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x405a37
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
pop edi
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x3a0
ret