Function at 0x414d50
Capabilities:
Get common file path
Link many functions at runtime

Disassembly:
sub esp, 0x104
lea eax, [esp]
push esi
push 0x104
push eax
mov esi, ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x414cfb
cmp eax, 0x104
jae 0x414cfb
lea ecx, [eax + 0x11]
cmp ecx, 0x104
jb 0x414b00
push str.program_assertion_failed___library_path_buffer_overflow
jmp 0x414d00
push str.UsbDkHelper
lea ecx, [esp + 8]
add eax, ecx
push str._s.dll
push eax
call fcn.0040a9a0
add esp, 0xc
lea eax, [esp + 4]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [0x445c3c], eax
test eax, eax
je 0x414d1a
push edi
push str.UsbDk_GetDevicesList
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
jne 0x414b90
xor ecx, ecx
call fcn.0040a9e0
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.00407c10
add esp, 0x18
mov dword [0x445c40], edi
push dword [0x445c3c]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop edi
mov dword [0x445c3c], 0
mov eax, 0xfffffffb
pop esi
add esp, 0x104
ret
push str.UsbDk_ReleaseDevicesList
push dword [0x445c3c]
mov dword [0x445c40], edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
jne 0x414bd7
xor ecx, ecx
call fcn.0040a9e0
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.00407c10
add esp, 0x18
mov dword [0x445c44], edi
jmp 0x414b6c
mov edx, str.UsbDk_StartRedirect
mov dword [0x445c44], edi
mov ecx, esi
call fcn.00414a80
mov dword [0x445c48], eax
test eax, eax
je 0x414b6c
mov edx, str.UsbDk_StopRedirect
mov ecx, esi
call fcn.00414a80
mov dword [0x445c4c], eax
test eax, eax
je 0x414b6c
mov edx, str.UsbDk_GetConfigurationDescriptor
mov ecx, esi
call fcn.00414a80
mov dword [0x445c50], eax
test eax, eax
je 0x414b6c
mov edx, str.UsbDk_ReleaseConfigurationDescriptor
mov ecx, esi
call fcn.00414a80
mov dword [0x445c54], eax
test eax, eax
je 0x414b6c
mov edx, str.UsbDk_ReadPipe
mov ecx, esi
call fcn.00414a80
mov dword [0x445c58], eax
test eax, eax
je 0x414b6c
mov edx, str.UsbDk_WritePipe
mov ecx, esi
call fcn.00414a80
mov dword [0x445c5c], eax
test eax, eax
je 0x414b6c
mov edx, str.UsbDk_AbortPipe
mov ecx, esi
call fcn.00414a80
mov dword [0x445c60], eax
test eax, eax
je 0x414b6c
mov edx, str.UsbDk_ResetPipe
mov ecx, esi
call fcn.00414a80
mov dword [0x445c64], eax
test eax, eax
je 0x414b6c
mov edx, str.UsbDk_SetAltsetting
mov ecx, esi
call fcn.00414a80
mov dword [0x445c68], eax
test eax, eax
je 0x414b6c
mov edx, str.UsbDk_ResetDevice
mov ecx, esi
call fcn.00414a80
mov dword [0x445c6c], eax
test eax, eax
je 0x414b6c
mov edx, str.UsbDk_GetRedirectorSystemHandle
mov ecx, esi
call fcn.00414a80
mov dword [0x445c70], eax
test eax, eax
je 0x414b6c
pop edi
xor eax, eax
pop esi
add esp, 0x104
ret
push str.program_assertion_failed___could_not_get_system_directory
push str.load_system_library
push 1
push esi
call fcn.00407c10
mov dword [0x445c3c], 0
add esp, 0x10
xor ecx, ecx
call fcn.0040a9e0
push eax
push str.Failed_to_load_UsbDkHelper.dll:__s
push str.load_usbdk_helper_dll
push 1
push esi
call fcn.00407c10
add esp, 0x14
mov eax, 0xfffffffb
pop esi
add esp, 0x104
ret
sub esp, 0x108
lea eax, [esp + 4]
push esi
push edi
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov edi, dword [esp + 0x114]
test eax, eax
je 0x414ee5
cmp eax, 0x104
jae 0x414ee5
lea ecx, [eax + 0xe]
cmp ecx, 0x104
jb 0x414d97
push str.program_assertion_failed___library_path_buffer_overflow
jmp 0x414eea
push str.Advapi32
lea ecx, [esp + 0x10]
add eax, ecx
push str._s.dll
push eax
call fcn.0040a9a0
add esp, 0xc
lea eax, [esp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x414efa
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push ebx
push ebp
push str.OpenSCManagerA
push esi
call edi
mov ebp, eax
test ebp, ebp
jne 0x414de7
mov edi, str.failed_to_find__s_in_Advapi32_n
mov eax, str.OpenSCManagerA
jmp 0x414e37
push str.OpenServiceA
push esi
call edi
mov dword [esp + 0x10], eax
test eax, eax
jne 0x414e03
mov edi, str.failed_to_find__s_in_Advapi32_n
mov eax, str.OpenServiceA
jmp 0x414e37
push str.CloseServiceHandle
push esi
call edi
mov ebx, eax
test ebx, ebx
jne 0x414e1d
mov edi, str.failed_to_find__s_in_Advapi32_n
mov eax, str.CloseServiceHandle
jmp 0x414e37
push 1
push 0
push 0
call ebp
mov edi, eax
test edi, edi
jne 0x414e66
xor ecx, ecx
mov edi, str.failed_to_open_service_control_manager:__s
call fcn.0040a9e0
push eax
push edi
push str.usbdk_init
push 2
push dword [esp + 0x12c]
call fcn.00407c10
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop ebp
pop ebx
pop edi
mov eax, 0xffffff9d
pop esi
add esp, 0x108
ret
push 0x80000000
push str.UsbDk
push edi
call dword [esp + 0x1c]
push edi
mov ebp, eax
call ebx
test ebp, ebp
jne 0x414ec5
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x424
je 0x414eae
xor ecx, ecx
call fcn.0040a9e0
push eax
push str.failed_to_open_UsbDk_service:__s
push str.usbdk_init
push 2
push dword [esp + 0x12c]
call fcn.00407c10
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop ebp
pop ebx
pop edi
mov eax, 0xfffffffb
pop esi
add esp, 0x108
ret
push ebp
call ebx
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov ecx, dword [esp + 0x11c]
pop ebp
pop ebx
pop edi
pop esi
add esp, 0x108
jmp 0x414ac0
push str.program_assertion_failed___could_not_get_system_directory
push str.load_system_library
push 1
push edi
call fcn.00407c10
add esp, 0x10
push str.failed_to_open_Advapi32_n
push str.usbdk_init
push 2
push edi
call fcn.00407c10
add esp, 0x10
mov eax, 0xffffff9d
pop edi
pop esi
add esp, 0x108
ret