Function at 0x415940
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x104
lea eax, [ebp - 0x104]
push esi
push 0x104
push eax
mov esi, ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x415bda
cmp eax, 0x104
jae 0x415bda
lea ecx, [eax + 0x11]
cmp ecx, 0x104
jb 0x415986
push str.program_assertion_failed___library_path_buffer_overflow
jmp 0x415bdf
push str.UsbDkHelper
lea ecx, [ebp - 0x104]
add eax, ecx
push str._s.dll
push eax
call fcn.0040a7d0
add esp, 0xc
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [0x421870], eax
test eax, eax
je 0x415bf9
push ebx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.UsbDk_GetDevicesList
push eax
call edi
mov ebx, eax
test ebx, ebx
jne 0x415a1b
xor ecx, ecx
call fcn.0040a810
push eax
push str.UsbDk_GetDevicesList
push str.UsbDkHelper_API__s_not_found:__s
push str.get_usbdk_proc_addr
push 1
push esi
call fcn.004078c0
add esp, 0x18
mov dword [0x421874], ebx
push dword [0x421870]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop edi
pop ebx
mov dword [0x421870], 0
mov eax, 0xfffffffb
pop esi
mov esp, ebp
pop ebp
ret
push str.UsbDk_ReleaseDevicesList
push dword [0x421870]
mov dword [0x421874], ebx
call edi
mov ebx, eax
test ebx, ebx
jne 0x415a5e
xor ecx, ecx
call fcn.0040a810
push eax
push str.UsbDk_ReleaseDevicesList
push str.UsbDkHelper_API__s_not_found:__s
push str.get_usbdk_proc_addr
push 1
push esi
call fcn.004078c0
add esp, 0x18
mov dword [0x421878], ebx
jmp 0x4159f9
push str.UsbDk_StartRedirect
push dword [0x421870]
mov dword [0x421878], ebx
call edi
mov ebx, eax
test ebx, ebx
jne 0x415aa4
xor ecx, ecx
call fcn.0040a810
push eax
push str.UsbDk_StartRedirect
push str.UsbDkHelper_API__s_not_found:__s
push str.get_usbdk_proc_addr
push 1
push esi
call fcn.004078c0
add esp, 0x18
mov dword [0x42187c], ebx
jmp 0x4159f9
push str.UsbDk_StopRedirect
push dword [0x421870]
mov dword [0x42187c], ebx
call edi
mov edi, eax
test edi, edi
jne 0x415aea
xor ecx, ecx
call fcn.0040a810
push eax
push str.UsbDk_StopRedirect
push str.UsbDkHelper_API__s_not_found:__s
push str.get_usbdk_proc_addr
push 1
push esi
call fcn.004078c0
add esp, 0x18
mov dword [0x421880], edi
jmp 0x4159f9
mov edx, str.UsbDk_GetConfigurationDescriptor
mov dword [0x421880], edi
mov ecx, esi
call fcn.00415900
mov dword [0x421884], eax
test eax, eax
je 0x4159f9
mov edx, str.UsbDk_ReleaseConfigurationDescriptor
mov ecx, esi
call fcn.00415900
mov dword [0x421888], eax
test eax, eax
je 0x4159f9
mov edx, str.UsbDk_ReadPipe
mov ecx, esi
call fcn.00415900
mov dword [0x42188c], eax
test eax, eax
je 0x4159f9
mov edx, str.UsbDk_WritePipe
mov ecx, esi
call fcn.00415900
mov dword [0x421890], eax
test eax, eax
je 0x4159f9
mov edx, str.UsbDk_AbortPipe
mov ecx, esi
call fcn.00415900
mov dword [0x421894], eax
test eax, eax
je 0x4159f9
mov edx, str.UsbDk_ResetPipe
mov ecx, esi
call fcn.00415900
mov dword [0x421898], eax
test eax, eax
je 0x4159f9
mov edx, str.UsbDk_SetAltsetting
mov ecx, esi
call fcn.00415900
mov dword [0x42189c], eax
test eax, eax
je 0x4159f9
mov edx, str.UsbDk_ResetDevice
mov ecx, esi
call fcn.00415900
mov dword [0x4218a0], eax
test eax, eax
je 0x4159f9
mov edx, str.UsbDk_GetRedirectorSystemHandle
mov ecx, esi
call fcn.00415900
mov dword [0x4218a4], eax
test eax, eax
je 0x4159f9
pop edi
pop ebx
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret
push str.program_assertion_failed___could_not_get_system_directory
push str.load_system_library
push 1
push esi
call fcn.004078c0
mov dword [0x421870], 0
add esp, 0x10
xor ecx, ecx
call fcn.0040a810
push eax
push str.Failed_to_load_UsbDkHelper.dll:__s
push str.load_usbdk_helper_dll
push 1
push esi
call fcn.004078c0
add esp, 0x14
mov eax, 0xfffffffb
pop esi
mov esp, ebp
pop ebp
ret