Function at 0x401686
Capabilities:
Accept command line arguments
Check if file exists
Create directory
Create process on windows
Get common file path
Move file
Query or enumerate registry value

Disassembly:
push ebp
mov eax, 0x2008
lea ebp, [esp - 0x1f88]
call fcn.00405440
mov eax, dword [0x4111b4]
mov dword [ebp + 0x1f84], eax
mov eax, dword [ebp + 0x1f90]
push ebx
push esi
mov dword [0x411d20], eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [sym.imp.SHLWAPI.dll_PathGetArgsW]
mov esi, eax
jmp 0x4016c3
inc esi
inc esi
cmp word [esi], 0x20
je 0x4016c1
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
je 0x401728
push esi
push 0x411d28
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push 0x4015a1
push 0xbb8
xor ebx, ebx
push ebx
push ebx
call dword [sym.imp.USER32.dll_SetTimer]
mov esi, dword [sym.imp.USER32.dll_GetMessageW]
mov dword [0x412528], eax
jmp 0x401715
lea eax, [ebp - 0x80]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [ebp - 0x80]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageW]
push ebx
push ebx
lea eax, [ebp - 0x80]
push ebx
push eax
call esi
test eax, eax
jne 0x401701
inc eax
jmp 0x401ae9
push edi
mov edx, 0x81
xor eax, eax
xor ebx, ebx
mov word [ebp + 0x195c], bx
mov ecx, edx
lea edi, [ebp + 0x195e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor eax, eax
mov word [ebp + 0x1754], bx
mov ecx, edx
lea edi, [ebp + 0x1756]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov esi, 0x104
push esi
lea eax, [ebp + 0x195c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp + 0x195c]
push eax
lea eax, [ebp + 0x1754]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
lea eax, [ebp + 0x1754]
push eax
call dword [sym.imp.SHLWAPI.dll_PathStripPathW]
lea eax, [ebp + 0x1d6c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp + 0x1f74]
push eax
call dword [sym.imp.ole32.dll_CoCreateGuid]
test eax, eax
jne 0x401ae6
push 0x64
lea eax, [ebp + 0x144c]
push eax
lea eax, [ebp + 0x1f74]
push eax
call dword [sym.imp.ole32.dll_StringFromGUID2]
lea eax, [ebp + 0x144c]
push eax
lea eax, [ebp + 0x1d6c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatW]
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
push ebx
lea eax, [ebp + 0x1d6c]
push eax
call edi
mov esi, dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [ebp + 0x1d6c]
push eax
lea eax, [ebp + 0x103c]
push str._sSDPlugins
push eax
call esi
lea eax, [ebp + 0x1d6c]
push eax
lea eax, [ebp + 0x1244]
push str._sAppData
push eax
call esi
add esp, 0x18
push ebx
lea eax, [ebp + 0x103c]
push eax
call edi
push ebx
lea eax, [ebp + 0x1244]
push eax
call edi
lea eax, [ebp + 0x1d6c]
push eax
push 0x65
call fcn.0040137b
lea eax, [ebp + 0x1d6c]
push eax
lea eax, [ebp + 0x81c]
push str._sDXAppCustom.bin
push eax
call esi
lea eax, [ebp + 0x1754]
push eax
lea eax, [ebp + 0x1d6c]
push eax
lea eax, [ebp + 0x154c]
push str._s_s
push eax
call esi
mov edi, dword [sym.imp.KERNEL32.dll_MoveFileW]
add esp, 0x24
lea eax, [ebp + 0x154c]
push eax
lea eax, [ebp + 0x81c]
push eax
call edi
lea eax, [ebp + 0x1244]
push eax
push 0x66
call fcn.0040137b
lea eax, [ebp + 0x103c]
push eax
push 0x67
call fcn.0040137b
lea eax, [ebp + 0x1d6c]
push eax
push 0x69
call fcn.0040137b
lea eax, [ebp + 0x1d6c]
push eax
lea eax, [ebp + 0xe34]
push str._sSDPluginsDXAxHost.app
push eax
call esi
lea eax, [ebp + 0x1d6c]
push eax
lea eax, [ebp + 0xc2c]
push str._sSDPluginsDXAxHost.dll
push eax
call esi
add esp, 0x30
lea eax, [ebp + 0xe34]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x401903
lea eax, [ebp + 0xc2c]
push eax
lea eax, [ebp + 0xe34]
push eax
call edi
push str.APP_PACK
push 0x68
push dword [0x411d20]
call dword [sym.imp.KERNEL32.dll_FindResourceW]
test eax, eax
je 0x401a80
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea eax, [ebp + 0x18]
push eax
push 0x20019
push ebx
push str.CLSIDBC149E72_D422_4745_B674_01AB3DD160EB
push 0x80000000
mov dword [ebp + 0x1f90], ebx
mov dword [ebp + 0x18], ebx
call edi
test eax, eax
jne 0x4019d0
push dword [ebp + 0x18]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp + 0x18]
push eax
push 0x20019
push ebx
push str.CLSIDBC149E72_D422_4745_B674_01AB3DD160EBInProcServer32
push 0x80000000
call edi
test eax, eax
jne 0x4019ba
lea eax, [ebp + 0x14]
push eax
lea eax, [ebp + 0x1b64]
push eax
push ebx
push ebx
push 0x40d314
push dword [ebp + 0x18]
mov dword [ebp + 0x14], 0x208
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x4019a5
lea eax, [ebp + 0x1b64]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4019af
mov dword [ebp + 0x1f90], 1
push dword [ebp + 0x18]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x4019c4
mov dword [ebp + 0x1f90], 1
cmp dword [ebp + 0x1f90], ebx
je 0x401a80
push 0x104
lea eax, [ebp + 0x1b64]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea eax, [ebp + 0x1b64]
push eax
lea eax, [ebp + 0xa24]
push str._s_regsvr32.exe
push eax
call esi
lea eax, [ebp + 0x1b64]
push eax
push 0x68
call fcn.0040137b
mov edi, dword [sym.imp.KERNEL32.dll_Sleep]
add esp, 0x14
push 0x14
call edi
push str.SDCtrls.dll
lea eax, [ebp + 0x1b64]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatW]
lea eax, [ebp + 0x1b64]
push eax
lea eax, [ebp + 0x1c]
push str._i__s__s
push eax
call esi
push 0x3c
lea eax, [ebp - 0x28]
push ebx
push eax
call fcn.004053e0
lea eax, [ebp + 0xa24]
mov dword [ebp - 0x18], eax
lea eax, [ebp + 0x1c]
mov dword [ebp - 0x14], eax
add esp, 0x18
lea eax, [ebp - 0x28]
push eax
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x28], 0x3c
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0xc], 1
mov dword [ebp - 0x24], 0x200
call dword [sym.imp.SHELL32.dll_ShellExecuteExW]
push 0x14
call edi
lea eax, [ebp + 0x154c]
push eax
lea eax, [ebp + 0x195c]
push eax
lea eax, [ebp + 0x41c]
push str.__s___s
push eax
call esi
push 0x3c
pop esi
push esi
lea eax, [ebp - 0x64]
push ebx
push eax
call fcn.004053e0
lea eax, [ebp + 0x154c]
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x64], esi
lea eax, [ebp + 0x41c]
xor esi, esi
mov dword [ebp - 0x50], eax
add esp, 0x1c
lea eax, [ebp - 0x64]
inc esi
push eax
mov dword [ebp - 0x5c], ebx
mov dword [ebp - 0x58], ebx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x60], 0x200
call dword [sym.imp.SHELL32.dll_ShellExecuteExW]
mov eax, esi
jmp 0x401ae8
xor eax, eax
pop edi
mov ecx, dword [ebp + 0x1f84]
pop esi
pop ebx
call fcn.004053c5
add ebp, 0x1f88
leave
ret 0x10