Function at 0x40d13f
Capabilities:
Accept command line arguments
Check if file exists
Get common file path
Set current directory

Disassembly:
push ebp
sub esp, 0xe6c
lea ebp, [esp - 4]
mov eax, dword [0x4313f4]
xor eax, ebp
mov dword [ebp + 0xe6c], eax
push 0xb0
mov eax, 0x41c2fd
call fcn.004127a4
mov edi, dword [ebp + 0xe78]
mov esi, dword [ebp + 0xe80]
xor ebx, ebx
push ebx
push ebx
push 1
push ecx
mov eax, str.long___thiscall_CCmdReceiver::PreHandleCmdlineEx_wchar_t__int_bool__
push eax
push 0x422de0
mov dword [ebp - 0x10], ecx
push eax
lea ecx, [ebp - 0x38]
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x18], esi
call fcn.00407ab1
mov dword [ebp - 4], ebx
lea eax, [ebp + 0xe7c]
push eax
push edi
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
cmp dword [ebp + 0xe7c], 2
mov edi, eax
jl 0x40d764
xor eax, eax
push 0x206
mov word [ebp + 0xc64], ax
lea eax, [ebp + 0xc66]
push ebx
push eax
call sub.MSVCR90.dll_memset
push 0x104
push dword [edi]
lea eax, [ebp + 0xc64]
push eax
call dword [sym.imp.MSVCR90.dll_wcsncpy]
add esp, 0x18
lea eax, [ebp + 0xc64]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d307
lea eax, [ebp + 0xc64]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindExtensionW]
cmp eax, ebx
je 0x40d307
push eax
push str..dll
call dword [sym.imp.MSVCR90.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x40d307
push dword [edi + 4]
push 0x422db8
call dword [sym.imp.MSVCR90.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x40d307
lea eax, [ebp + 0xc64]
push eax
mov byte [esi], 1
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push 0x422dac
push eax
mov dword [ebp - 0x18], eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
cmp edi, ebx
je 0x40d26a
push ebx
call edi
mov ebx, eax
mov esi, 0x422d68
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40d2d2
push 1
push edi
push str.___function_:
push dword [ebp - 0x18]
lea eax, [ebp + 0xc64]
push str.__handle_:
push eax
push str.loaddll_path
push dword [ebp - 0x10]
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a36e
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a36e
mov ecx, eax
call fcn.0040bcf5
mov esi, ebx
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x38]
call fcn.00407d23
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0xe6c]
xor ecx, ebp
call fcn.0041276a
add ebp, 0xe70
leave
ret 0xc
mov eax, dword [ebp + 0xe7c]
cmp eax, 2
jl 0x40d764
push dword [edi + eax*4 - 4]
push str._rundll32
call dword [sym.imp.MSVCR90.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
jne 0x40d764
push str.RunDllCommand
lea ecx, [ebp]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
mov byte [ebp - 4], 1
push dword [edi]
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
mov byte [ebp - 4], 2
push ebx
push 0x2c
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_unsigned_int___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::find_wchar_t__unsigned_int_const]
mov esi, eax
cmp esi, ebx
jle 0x40d3bf
mov eax, dword [sym.imp.MSVCP90.dll_unsigned_int_const_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::npos]
push dword [eax]
lea eax, [esi + 1]
push eax
lea eax, [ebp + 0x1c]
push eax
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::substr_unsigned_int__unsigned_int_]
mov byte [ebp - 4], 3
push eax
lea ecx, [ebp]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t______thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::operator_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
mov byte [ebp - 4], 2
lea ecx, [ebp + 0x1c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
push esi
push ebx
lea eax, [ebp + 0x1c]
push eax
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::substr_unsigned_int__unsigned_int_]
mov byte [ebp - 4], 4
push eax
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t______thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::operator_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
mov byte [ebp - 4], 2
lea ecx, [ebp + 0x1c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov esi, 0x422d68
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40d41d
push 1
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
push str.__dllpath
lea ecx, [ebp]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
push str.rundll32_entrypoint
push dword [ebp - 0x10]
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040bcf5
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d748
push 0x7ff
lea eax, [ebp + 0x55]
push ebx
push eax
mov byte [ebp + 0x54], bl
call sub.MSVCR90.dll_memset
add esp, 0xc
cmp dword [ebp + 0xe7c], 3
jl 0x40d70c
push dword [edi + 4]
lea ecx, [ebp + 0x1c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
mov byte [ebp - 4], 5
lea ecx, [ebp + 0x1c]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
lea ecx, [ebp - 0xbc]
call fcn.0040b1a0
mov byte [ebp - 4], 6
mov edi, dword [eax]
lea ecx, [ebp + 0x1c]
call dword [sym.imp.MSVCP90.dll_public:_unsigned_int___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::length_void_const]
push eax
lea eax, [ebp + 0x54]
push edi
push eax
call dword [sym.imp.MSVCR90.dll_strncpy]
add esp, 0xc
mov byte [ebp - 4], 5
lea eax, [ebp - 0xb8]
cmp dword [ebp - 0xbc], eax
je 0x40d4b9
push dword [ebp - 0xbc]
call dword [sym.imp.MSVCR90.dll_free]
pop ecx
xor eax, eax
push 0x206
mov word [ebp + 0x854], ax
lea eax, [ebp + 0x856]
push ebx
push eax
mov dword [ebp - 0x1c], 1
call sub.MSVCR90.dll_memset
add esp, 0xc
lea eax, [ebp + 0x854]
push eax
mov edi, 0x104
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40d52a
push 1
lea eax, [ebp + 0x854]
push eax
push str.rundll32_GetCurrentDirectory
push dword [ebp - 0x10]
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040bcf5
xor eax, eax
push 0x206
mov word [ebp + 0xa5c], ax
lea eax, [ebp + 0xa5e]
push ebx
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
push edi
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
lea eax, [ebp + 0xa5c]
push eax
call dword [sym.imp.MSVCR90.dll_wcsncpy]
add esp, 0xc
lea eax, [ebp + 0xa5c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40d5c3
push 1
lea eax, [ebp + 0xa5c]
push eax
push str.__new_dir
lea eax, [ebp + 0x854]
push eax
push str.rundll32_old_dir
push dword [ebp - 0x10]
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040bcf5
mov edi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea eax, [ebp + 0xa5c]
push eax
call edi
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
push esi
mov dword [ebp - 0x14], eax
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40d659
push 1
push ebx
push str.__nCmdShow
lea eax, [ebp + 0x54]
push eax
push str.__szCmdLine
push dword [ebp - 0x14]
push str.__hinst
push ebx
push str.rundll32_args_hwnd
push dword [ebp - 0x10]
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a36e
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a36e
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a1f4
mov ecx, eax
call fcn.0040bcf5
lea eax, [ebp + 0x854]
push eax
call edi
cmp dword [ebp - 0x14], ebx
je 0x40d6fd
push 0x422c5c
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push esi
mov edi, eax
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40d6ae
push 1
push edi
push str.rundll32_GetProcAddress_pFun
push dword [ebp - 0x10]
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a36e
mov ecx, eax
call fcn.0040bcf5
cmp edi, ebx
je 0x40d6c0
push ebx
lea eax, [ebp + 0x54]
push eax
push dword [ebp - 0x14]
mov dword [ebp - 0x1c], ebx
push ebx
call edi
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [ebp - 0x18]
mov byte [eax], 1
mov byte [ebp - 4], 2
lea ecx, [ebp + 0x1c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov byte [ebp - 4], 1
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov byte [ebp - 4], bl
lea ecx, [ebp]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov esi, dword [ebp - 0x1c]
jmp 0x40d2d4
mov byte [ebp - 4], 2
lea ecx, [ebp + 0x1c]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
jmp 0x40d748
push esi
call fcn.00402c05
pop ecx
test eax, eax
jne 0x40d748
push 1
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_wchar_t_const____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::c_str_void_const]
push eax
push str.rundll32_PathFileExists_false__dllpath
push dword [ebp - 0x10]
push esi
call fcn.00407313
pop ecx
pop ecx
mov ecx, eax
call fcn.0040c748
mov ecx, eax
call fcn.0040a3ec
mov ecx, eax
call fcn.0040bcf5
mov byte [ebp - 4], 1
lea ecx, [ebp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov byte [ebp - 4], bl
lea ecx, [ebp]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov esi, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x10]
push esi
push dword [ebp - 0x20]
call fcn.0040c3ba
mov esi, eax
jmp 0x40d2d4