Function at 0x401810
Capabilities:
Accept command line arguments
Check if file exists
Create process on windows
Get file attributes
Terminate process

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2330
call fcn.00402570
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 0x88], eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x84], 0
lea eax, [ebp - 0xc]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
call fcn.00402110
mov dword [ebp - 0x80], eax
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x7c], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x14], 1
jmp 0x40187b
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0xc]
jge 0x4018bc
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x80]
cmp dword [edx + ecx*4], 0
je 0x4018ba
lea eax, [ebp - 0x84]
push eax
lea ecx, [ebp - 8]
push ecx
lea edx, [ebp - 0x10]
push edx
lea eax, [ebp - 0x7c]
push eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x80]
mov eax, dword [edx + ecx*4]
push eax
call fcn.00401150
add esp, 0x14
test eax, eax
jne 0x4018ba
jmp 0x4018bc
jmp 0x401872
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x7c]
and edx, 0x20
je 0x4018d9
cmp dword [ebp - 8], 0
jne 0x4018d9
mov eax, dword [ebp - 0x7c]
and eax, 0xffffffdf
mov dword [ebp - 0x7c], eax
mov ecx, dword [ebp - 0x7c]
and ecx, 8
je 0x40190e
cmp dword [ebp - 0x2c], 0
jne 0x40190e
mov dword [ebp - 0x2c], 1
mov edx, dword [ebp - 0x80]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea eax, [ebp - 0xc]
push eax
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov dword [ebp - 0x80], eax
jmp 0x401854
mov edx, dword [ebp - 0x7c]
and edx, 2
je 0x40194e
push 0x1040
push str.Hstart___Command_Line
mov eax, dword [ebp - 0x18]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
cmp dword [ebp - 0x84], 0
je 0x40194e
push 0x1040
push str.Hstart___Starting_Directory
mov ecx, dword [ebp - 0x84]
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov edx, dword [ebp - 0x7c]
and edx, 0x200
je 0x401bc4
mov eax, dword [ebp - 0x7c]
and eax, 0x400
jne 0x401bc4
call fcn.004017a0
test eax, eax
jne 0x401bc4
push 0x104
lea ecx, [ebp - 0x2298]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov dword [ebp - 0x208c], eax
cmp dword [ebp - 0x208c], 0
je 0x401bb2
cmp dword [ebp - 0x208c], 0x104
jae 0x401bb2
mov dword [ebp - 0x208c], 0
xor edx, edx
mov word [ebp - 0x2088], dx
mov dword [ebp - 0x14], 1
jmp 0x4019d4
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x14]
cmp ecx, dword [ebp - 0xc]
jge 0x401b54
cmp dword [ebp - 0x208c], 0
je 0x401a14
push 1
push 0x403af4
push 0x1000
lea edx, [ebp - 0x208c]
push edx
lea eax, [ebp - 0x2088]
push eax
call fcn.00401740
add esp, 0x14
test eax, eax
jne 0x401a14
jmp 0x401b54
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x80]
mov eax, dword [edx + ecx*4]
movzx ecx, word [eax]
cmp ecx, 0x2f
je 0x401a3a
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x80]
mov ecx, dword [eax + edx*4]
movzx edx, word [ecx]
cmp edx, 0x2d
jne 0x401ac7
push 0x403af8
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x80]
mov edx, dword [ecx + eax*4]
add edx, 2
push edx
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x401a83
push 5
push 0x403b00
push 0x1000
lea eax, [ebp - 0x208c]
push eax
lea ecx, [ebp - 0x2088]
push ecx
call fcn.00401740
add esp, 0x14
test eax, eax
jne 0x401a81
jmp 0x401b54
jmp 0x401ac2
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x80]
mov ecx, dword [eax + edx*4]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x80]
mov ecx, dword [eax + edx*4]
push ecx
push 0x1000
lea edx, [ebp - 0x208c]
push edx
lea eax, [ebp - 0x2088]
push eax
call fcn.00401740
add esp, 0x14
test eax, eax
jne 0x401ac2
jmp 0x401b54
jmp 0x401b4f
push 1
push 0x403b0c
push 0x1000
lea ecx, [ebp - 0x208c]
push ecx
lea edx, [ebp - 0x2088]
push edx
call fcn.00401740
add esp, 0x14
test eax, eax
je 0x401b4d
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x80]
mov edx, dword [ecx + eax*4]
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x80]
mov edx, dword [ecx + eax*4]
push edx
push 0x1000
lea eax, [ebp - 0x208c]
push eax
lea ecx, [ebp - 0x2088]
push ecx
call fcn.00401740
add esp, 0x14
test eax, eax
je 0x401b4d
push 1
push 0x403b10
push 0x1000
lea edx, [ebp - 0x208c]
push edx
lea eax, [ebp - 0x2088]
push eax
call fcn.00401740
add esp, 0x14
test eax, eax
jne 0x401b4f
jmp 0x401b54
jmp 0x4019cb
push 0x3c
lea ecx, [ebp - 0x22d4]
push ecx
call section..text
add esp, 8
mov dword [ebp - 0x22d4], 0x3c
mov dword [ebp - 0x22d0], 0
mov dword [ebp - 0x22c8], 0x403b14
lea edx, [ebp - 0x2298]
mov dword [ebp - 0x22c4], edx
lea eax, [ebp - 0x2088]
mov dword [ebp - 0x22c0], eax
mov dword [ebp - 0x22b8], 1
lea ecx, [ebp - 0x22d4]
push ecx
call dword [sym.imp.SHELL32.dll_ShellExecuteExW]
mov edx, dword [ebp - 0x80]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov eax, dword [ebp - 0x7c]
and eax, 1
jne 0x401bd2
cmp dword [ebp - 0xc], 1
jne 0x401bed
push 0x1040
mov ecx, dword [0x404008]
push ecx
mov edx, dword [str.Run_from_command_line:_r_n_hstart____PARAMETERS_____PRIORITY____COMMAND_LINES__r_n_r_nPARAMETERS:_r_n_NOCONSOLE___start_console_applications_without_any_windows_r_n_WAIT___wait_for_the_application_to_terminate__run_synchronously__r_n_WAITINPUT___wait_for_the_user_input_to_set_the_priority_class_r_n_DPATH___set_the_starting_directory_r_n_SHELL___run_apps_and_open_docs_in_the_Windows_Shell_r_n_RUNAS___run_apps_using_UAC_privilege_elevation__Vista__r_n_UAC___run_Hstart_using_UAC_privilege_elevation__Vista__r_n_MSGTEXT___show_the_message_after_command_execution_r_n_TITLETEXT___set_the_title_of_the_message_r_n_ERRMSGTEXT___show_the_error_message_if_an_error_detected_r_n_ERRTITLETEXT___set_the_title_of_the_error_message_r_n_SILENT___silent_mode:_no_error_messages_will_be_displayed_r_n_TEST___test_mode:_see_what_parameters_are_passed_to_Hstart_r_n_r_nPRIORITY_classes:_r_n__HIGH__ABOVENORMAL__NORMAL__BELOWNORMAL__IDLE__r_n_r_nDont_forget_about_quotes_when_using_complex_COMMAND_LINES:_r_n_hstart__NOCONSOLE__D_D:Temp_____D:_backup.bat__parameters__r_n]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x14], eax
jmp 0x401c05
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x14]
cmp edx, dword [ebp - 0xc]
jge 0x402035
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x80]
cmp dword [ecx + eax*4], 0
je 0x402030
lea edx, [ebp - 0x84]
push edx
lea eax, [ebp - 8]
push eax
lea ecx, [ebp - 0x10]
push ecx
lea edx, [ebp - 0x7c]
push edx
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x80]
mov edx, dword [ecx + eax*4]
push edx
call fcn.00401150
add esp, 0x14
test eax, eax
jne 0x402030
mov eax, dword [ebp - 0x7c]
and eax, 2
je 0x401c7b
push 0x1024
push str.Hstart___Execute_
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x80]
mov eax, dword [edx + ecx*4]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
cmp eax, 6
jne 0x402030
mov ecx, dword [ebp - 0x7c]
and ecx, 0x40
jne 0x401c92
mov edx, dword [ebp - 0x7c]
and edx, 0x100
je 0x401f11
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x80]
mov edx, dword [ecx + eax*4]
mov dword [ebp - 0x22dc], edx
mov eax, dword [ebp - 0x22dc]
movzx ecx, word [eax]
cmp ecx, 0x22
jne 0x401cf8
mov edx, dword [ebp - 0x22dc]
add edx, 2
mov dword [ebp - 0x22dc], edx
mov eax, dword [ebp - 0x22dc]
mov dword [ebp - 0x22d8], eax
mov ecx, dword [ebp - 0x22d8]
movzx edx, word [ecx]
test edx, edx
je 0x401cf6
mov eax, dword [ebp - 0x22d8]
movzx ecx, word [eax]
cmp ecx, 0x22
je 0x401cf6
mov edx, dword [ebp - 0x22d8]
add edx, 2
mov dword [ebp - 0x22d8], edx
jmp 0x401cca
jmp 0x401d6e
mov eax, dword [ebp - 0x22dc]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x401d28
mov ecx, dword [ebp - 0x22dc]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edx, dword [ebp - 0x22dc]
lea eax, [edx + eax*2]
mov dword [ebp - 0x22d8], eax
jmp 0x401d6e
mov ecx, dword [ebp - 0x22dc]
mov dword [ebp - 0x22d8], ecx
mov edx, dword [ebp - 0x22d8]
movzx eax, word [edx]
test eax, eax
je 0x401d6e
mov ecx, dword [ebp - 0x22d8]
movzx edx, word [ecx]
cmp edx, 0x20
je 0x401d6e
mov eax, dword [ebp - 0x22d8]
movzx ecx, word [eax]
cmp ecx, 9
je 0x401d6e
mov edx, dword [ebp - 0x22d8]
add edx, 2
mov dword [ebp - 0x22d8], edx
jmp 0x401d34
mov eax, dword [ebp - 0x22d8]
movzx ecx, word [eax]
test ecx, ecx
je 0x401dcf
xor edx, edx
mov eax, dword [ebp - 0x22d8]
mov word [eax], dx
mov ecx, dword [ebp - 0x22d8]
add ecx, 2
mov dword [ebp - 0x22d8], ecx
mov edx, dword [ebp - 0x22d8]
movzx eax, word [edx]
test eax, eax
je 0x401dcf
mov ecx, dword [ebp - 0x22d8]
movzx edx, word [ecx]
cmp edx, 0x20
je 0x401dbe
mov eax, dword [ebp - 0x22d8]
movzx ecx, word [eax]
cmp ecx, 9
jne 0x401dcf
mov edx, dword [ebp - 0x22d8]
add edx, 2
mov dword [ebp - 0x22d8], edx
jmp 0x401d95
push 0x3c
lea eax, [ebp - 0x2318]
push eax
call section..text
add esp, 8
mov dword [ebp - 0x2318], 0x3c
mov dword [ebp - 0x2314], 0x40
mov ecx, dword [ebp - 0x7c]
and ecx, 0x100
je 0x401e0b
mov dword [ebp - 0x2324], str.runas
jmp 0x401e15
mov dword [ebp - 0x2324], str.open
mov edx, dword [ebp - 0x2324]
mov dword [ebp - 0x230c], edx
mov eax, dword [ebp - 0x22dc]
mov dword [ebp - 0x2308], eax
mov ecx, dword [ebp - 0x22d8]
mov dword [ebp - 0x2304], ecx
cmp dword [ebp - 0x84], 0
je 0x401e4e
mov edx, dword [ebp - 0x84]
mov dword [ebp - 0x2300], edx
mov eax, dword [ebp - 0x10]
and eax, 0x8000000
neg eax
sbb eax, eax
add eax, 1
mov dword [ebp - 0x22fc], eax
lea ecx, [ebp - 0x2318]
push ecx
call dword [sym.imp.SHELL32.dll_ShellExecuteExW]
test eax, eax
je 0x401f0c
mov edx, dword [ebp - 0x7c]
and edx, 0x10
je 0x401ec5
push 0xffffffffffffffff
mov eax, dword [ebp - 0x22e0]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov dword [ebp - 0x231c], 0
lea ecx, [ebp - 0x231c]
push ecx
mov edx, dword [ebp - 0x22e0]
push edx
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
je 0x401ec3
cmp dword [ebp - 0x231c], 0
je 0x401ec3
mov eax, dword [ebp - 0x231c]
mov dword [ebp - 4], eax
jmp 0x401eff
mov ecx, dword [ebp - 0x7c]
and ecx, 0x20
je 0x401eff
push 0xffffffffffffffff
mov edx, dword [ebp - 0x22e0]
push edx
call dword [sym.imp.USER32.dll_WaitForInputIdle]
mov eax, dword [ebp - 0x22e0]
push eax
call dword [sym.imp.KERNEL32.dll_GetPriorityClass]
cmp eax, dword [ebp - 8]
je 0x401eff
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0x22e0]
push edx
call dword [sym.imp.KERNEL32.dll_SetPriorityClass]
mov eax, dword [ebp - 0x22e0]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x402030
mov ecx, dword [ebp - 0x10]
and ecx, 0xffff3e1f
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x10]
or edx, dword [ebp - 8]
mov dword [ebp - 0x10], edx
push 0x10
lea eax, [ebp - 0x28]
push eax
call section..text
add esp, 8
push 0x44
lea ecx, [ebp - 0x78]
push ecx
call section..text
add esp, 8
mov dword [ebp - 0x78], 0x44
lea edx, [ebp - 0x28]
push edx
lea eax, [ebp - 0x78]
push eax
mov ecx, dword [ebp - 0x84]
push ecx
push 0
mov edx, dword [ebp - 0x10]
push edx
push 0
push 0
push 0
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x80]
mov edx, dword [ecx + eax*4]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
test eax, eax
je 0x40200c
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x7c]
and ecx, 0x10
je 0x401fcf
push 0xffffffffffffffff
mov edx, dword [ebp - 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov dword [ebp - 0x2320], 0
lea eax, [ebp - 0x2320]
push eax
mov ecx, dword [ebp - 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
je 0x401fcd
cmp dword [ebp - 0x2320], 0
je 0x401fcd
mov edx, dword [ebp - 0x2320]
mov dword [ebp - 4], edx
jmp 0x402000
mov eax, dword [ebp - 0x7c]
and eax, 0x20
je 0x402000
push 0xffffffffffffffff
mov ecx, dword [ebp - 0x28]
push ecx
call dword [sym.imp.USER32.dll_WaitForInputIdle]
mov edx, dword [ebp - 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_GetPriorityClass]
cmp eax, dword [ebp - 8]
je 0x402000
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_SetPriorityClass]
mov edx, dword [ebp - 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x402030
mov eax, dword [ebp - 0x7c]
and eax, 4
jne 0x402030
push 0x1010
push str.Failed_to_create_process___Hstart
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x80]
mov eax, dword [edx + ecx*4]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x401bfc
cmp dword [ebp - 4], 0
je 0x4020a5
cmp dword [0x40433c], 0
je 0x4020a5
cmp dword [0x404340], 0
je 0x40205b
mov ecx, dword [0x404340]
mov dword [ebp - 0x2328], ecx
jmp 0x402088
cmp dword [0x404338], 0
je 0x402072
mov edx, dword [0x404338]
mov dword [ebp - 0x232c], edx
jmp 0x40207c
mov dword [ebp - 0x232c], 0x403ba4
mov eax, dword [ebp - 0x232c]
mov dword [ebp - 0x2328], eax
push 0x1010
mov ecx, dword [ebp - 0x2328]
push ecx
mov edx, dword [0x40433c]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x4020e9
cmp dword [0x404334], 0
je 0x4020e9
cmp dword [0x404338], 0
je 0x4020c4
mov eax, dword [0x404338]
mov dword [ebp - 0x2330], eax
jmp 0x4020ce
mov dword [ebp - 0x2330], 0x403bc0
push 0x1040
mov ecx, dword [ebp - 0x2330]
push ecx
mov edx, dword [0x404334]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov eax, dword [ebp - 0x80]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.KERNEL32.dll_ExitProcess]