Function at 0x414f60
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 0x414f0b
cmp eax, 0x104
jae 0x414f0b
lea ecx, [eax + 0x11]
cmp ecx, 0x104
jb 0x414d10
push str.program_assertion_failed___library_path_buffer_overflow
jmp 0x414f10
push str.UsbDkHelper
lea ecx, [esp + 8]
add eax, ecx
push str._s.dll
push eax
call fcn.0040abc0
add esp, 0xc
lea eax, [esp + 4]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [0x445c4c], eax
test eax, eax
je 0x414f2a
push edi
push str.UsbDk_GetDevicesList
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
jne 0x414da0
xor ecx, ecx
call fcn.0040ac00
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.00407e20
add esp, 0x18
mov dword [0x445c50], edi
push dword [0x445c4c]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
pop edi
mov dword [0x445c4c], 0
mov eax, 0xfffffffb
pop esi
add esp, 0x104
ret
push str.UsbDk_ReleaseDevicesList
push dword [0x445c4c]
mov dword [0x445c50], edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
jne 0x414de7
xor ecx, ecx
call fcn.0040ac00
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.00407e20
add esp, 0x18
mov dword [0x445c54], edi
jmp 0x414d7c
mov edx, str.UsbDk_StartRedirect
mov dword [0x445c54], edi
mov ecx, esi
call fcn.00414c90
mov dword [0x445c58], eax
test eax, eax
je 0x414d7c
mov edx, str.UsbDk_StopRedirect
mov ecx, esi
call fcn.00414c90
mov dword [0x445c5c], eax
test eax, eax
je 0x414d7c
mov edx, str.UsbDk_GetConfigurationDescriptor
mov ecx, esi
call fcn.00414c90
mov dword [0x445c60], eax
test eax, eax
je 0x414d7c
mov edx, str.UsbDk_ReleaseConfigurationDescriptor
mov ecx, esi
call fcn.00414c90
mov dword [0x445c64], eax
test eax, eax
je 0x414d7c
mov edx, str.UsbDk_ReadPipe
mov ecx, esi
call fcn.00414c90
mov dword [0x445c68], eax
test eax, eax
je 0x414d7c
mov edx, str.UsbDk_WritePipe
mov ecx, esi
call fcn.00414c90
mov dword [0x445c6c], eax
test eax, eax
je 0x414d7c
mov edx, str.UsbDk_AbortPipe
mov ecx, esi
call fcn.00414c90
mov dword [0x445c70], eax
test eax, eax
je 0x414d7c
mov edx, str.UsbDk_ResetPipe
mov ecx, esi
call fcn.00414c90
mov dword [0x445c74], eax
test eax, eax
je 0x414d7c
mov edx, str.UsbDk_SetAltsetting
mov ecx, esi
call fcn.00414c90
mov dword [0x445c78], eax
test eax, eax
je 0x414d7c
mov edx, str.UsbDk_ResetDevice
mov ecx, esi
call fcn.00414c90
mov dword [0x445c7c], eax
test eax, eax
je 0x414d7c
mov edx, str.UsbDk_GetRedirectorSystemHandle
mov ecx, esi
call fcn.00414c90
mov dword [0x445c80], eax
test eax, eax
je 0x414d7c
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.00407e20
mov dword [0x445c4c], 0
add esp, 0x10
xor ecx, ecx
call fcn.0040ac00
push eax
push str.Failed_to_load_UsbDkHelper.dll:__s
push str.load_usbdk_helper_dll
push 1
push esi
call fcn.00407e20
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 0x4150f5
cmp eax, 0x104
jae 0x4150f5
lea ecx, [eax + 0xe]
cmp ecx, 0x104
jb 0x414fa7
push str.program_assertion_failed___library_path_buffer_overflow
jmp 0x4150fa
push str.Advapi32
lea ecx, [esp + 0x10]
add eax, ecx
push str._s.dll
push eax
call fcn.0040abc0
add esp, 0xc
lea eax, [esp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
test esi, esi
je 0x41510a
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 0x414ff7
mov edi, str.failed_to_find__s_in_Advapi32_n
mov eax, str.OpenSCManagerA
jmp 0x415047
push str.OpenServiceA
push esi
call edi
mov dword [esp + 0x10], eax
test eax, eax
jne 0x415013
mov edi, str.failed_to_find__s_in_Advapi32_n
mov eax, str.OpenServiceA
jmp 0x415047
push str.CloseServiceHandle
push esi
call edi
mov ebx, eax
test ebx, ebx
jne 0x41502d
mov edi, str.failed_to_find__s_in_Advapi32_n
mov eax, str.CloseServiceHandle
jmp 0x415047
push 1
push 0
push 0
call ebp
mov edi, eax
test edi, edi
jne 0x415076
xor ecx, ecx
mov edi, str.failed_to_open_service_control_manager:__s
call fcn.0040ac00
push eax
push edi
push str.usbdk_init
push 2
push dword [esp + 0x12c]
call fcn.00407e20
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 0x4150d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x424
je 0x4150be
xor ecx, ecx
call fcn.0040ac00
push eax
push str.failed_to_open_UsbDk_service:__s
push str.usbdk_init
push 2
push dword [esp + 0x12c]
call fcn.00407e20
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 0x414cd0
push str.program_assertion_failed___could_not_get_system_directory
push str.load_system_library
push 1
push edi
call fcn.00407e20
add esp, 0x10
push str.failed_to_open_Advapi32_n
push str.usbdk_init
push 2
push edi
call fcn.00407e20
add esp, 0x10
mov eax, 0xffffff9d
pop edi
pop esi
add esp, 0x108
ret