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

Disassembly:
mov eax, 0x412cf1
call fcn.004114d0
sub esp, 0xf1c
mov eax, dword [0x4211a4]
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor eax, ebp
xor esi, esi
push esi
push esi
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 0x10]
push 1
push ecx
mov dword [ebp - 0xe84], eax
mov eax, str.long___thiscall_CCmdReceiver::PreHandleCmdlineEx_wchar_t__int_bool__
push eax
push 0x418f38
mov dword [ebp - 0xe80], ecx
push eax
lea ecx, [ebp - 0xea4]
mov dword [ebp - 0xe8c], edi
call fcn.00406666
mov dword [ebp - 4], esi
lea eax, [ebp + 0xc]
push eax
push edi
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
cmp dword [ebp + 0xc], 2
mov ebx, eax
jl 0x40e33e
xor eax, eax
mov word [ebp - 0x218], si
mov ecx, 0x81
lea edi, [ebp - 0x216]
rep stosd dword es:[edi], eax
push 0x104
push dword [ebx]
stosw word es:[edi], ax
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.MSVCR71.dll_wcsncpy]
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
mov edi, dword [sym.imp.MSVCR71.dll__wcsicmp]
je 0x40de7e
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFindExtensionW]
cmp eax, esi
je 0x40de7e
push eax
push str..dll
call edi
test eax, eax
pop ecx
pop ecx
jne 0x40de7e
push dword [ebx + 4]
push 0x418a88
call edi
test eax, eax
pop ecx
pop ecx
jne 0x40de7e
mov eax, dword [ebp - 0xe84]
mov byte [eax], 1
lea eax, [ebp - 0x218]
push eax
mov dword [ebp - 0xe84], esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov ebx, eax
push 0x418a70
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
cmp edi, esi
je 0x40de0a
push esi
call edi
mov dword [ebp - 0xe84], eax
mov esi, 0x418ee8
push esi
call fcn.004023cd
test eax, eax
pop ecx
jne 0x40de73
push 1
push edi
push str.___function_:
push ebx
push str.__handle_:
lea eax, [ebp - 0x218]
push eax
push str.loaddll_path
push dword [ebp - 0xe80]
push esi
call fcn.00405b88
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a78c
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a78c
mov ecx, eax
call fcn.0040bce8
mov esi, dword [ebp - 0xe84]
jmp 0x40e357
mov eax, dword [ebp + 0xc]
cmp eax, 2
jl 0x40e33e
push dword [ebx + eax*4 - 4]
push str._rundll32
call edi
test eax, eax
pop ecx
pop ecx
jne 0x40e33e
push str.RunDllCommand
lea ecx, [ebp - 0xe7c]
call dword [sym.imp.MSVCP71.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 [ebx]
lea ecx, [ebp - 0xe44]
call dword [sym.imp.MSVCP71.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 esi
push 0x2c
lea ecx, [ebp - 0xe44]
call dword [sym.imp.MSVCP71.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 edi, eax
cmp edi, esi
jle 0x40df50
mov eax, dword [sym.imp.MSVCP71.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, [edi + 1]
push eax
lea eax, [ebp - 0xe60]
push eax
lea ecx, [ebp - 0xe44]
call dword [sym.imp.MSVCP71.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 - 0xe7c]
call dword [sym.imp.MSVCP71.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 - 0xe60]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
push edi
push esi
lea eax, [ebp - 0xe60]
push eax
lea ecx, [ebp - 0xe44]
call dword [sym.imp.MSVCP71.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 - 0xe44]
call dword [sym.imp.MSVCP71.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 - 0xe60]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov esi, 0x418ee8
push esi
call fcn.004023cd
test eax, eax
pop ecx
jne 0x40dfb7
push 1
lea ecx, [ebp - 0xe44]
call dword [sym.imp.MSVCP71.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 - 0xe7c]
call dword [sym.imp.MSVCP71.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 - 0xe80]
push esi
call fcn.00405b88
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bce8
lea ecx, [ebp - 0xe44]
call dword [sym.imp.MSVCP71.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 0x40e31e
xor eax, eax
cmp dword [ebp + 0xc], 3
mov byte [ebp - 0xe28], 0
mov ecx, 0x1ff
lea edi, [ebp - 0xe27]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
jl 0x40e2dc
push dword [ebx + 4]
lea ecx, [ebp - 0xe60]
call dword [sym.imp.MSVCP71.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
call dword [0x421060]
lea ecx, [ebp - 0xe60]
call dword [sym.imp.MSVCP71.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 - 0xf28]
call fcn.0040aed7
mov byte [ebp - 4], 6
mov edi, dword [eax]
lea ecx, [ebp - 0xe60]
call dword [sym.imp.MSVCP71.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 - 0xe28]
push edi
push eax
call dword [sym.imp.MSVCR71.dll_strncpy]
add esp, 0xc
mov byte [ebp - 4], 5
lea eax, [ebp - 0xf24]
cmp dword [ebp - 0xf28], eax
je 0x40e069
push dword [ebp - 0xf28]
call dword [sym.imp.MSVCR71.dll_free]
pop ecx
and word [ebp - 0x420], 0
xor eax, eax
mov ecx, 0x81
lea edi, [ebp - 0x41e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea eax, [ebp - 0x420]
push eax
mov ebx, 0x104
push ebx
mov dword [ebp - 0xe88], 1
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push esi
call fcn.004023cd
test eax, eax
pop ecx
jne 0x40e0db
push 1
lea eax, [ebp - 0x420]
push eax
push str.rundll32_GetCurrentDirectory
push dword [ebp - 0xe80]
push esi
call fcn.00405b88
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bce8
and word [ebp - 0x628], 0
xor eax, eax
mov ecx, 0x81
lea edi, [ebp - 0x626]
rep stosd dword es:[edi], eax
push ebx
lea ecx, [ebp - 0xe44]
stosw word es:[edi], ax
call dword [sym.imp.MSVCP71.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 - 0x628]
push eax
call dword [sym.imp.MSVCR71.dll_wcsncpy]
add esp, 0xc
lea eax, [ebp - 0x628]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
push esi
call fcn.004023cd
test eax, eax
pop ecx
jne 0x40e175
push 1
lea eax, [ebp - 0x628]
push eax
push str.__new_dir
lea eax, [ebp - 0x420]
push eax
push str.rundll32_old_dir
push dword [ebp - 0xe80]
push esi
call fcn.00405b88
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bce8
mov edi, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
lea eax, [ebp - 0x628]
push eax
call edi
lea ecx, [ebp - 0xe44]
call dword [sym.imp.MSVCP71.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 ebx, eax
call fcn.004023cd
test eax, eax
pop ecx
jne 0x40e212
push 1
push eax
push str.__nCmdShow
lea eax, [ebp - 0xe28]
push eax
push str.__szCmdLine
push ebx
push str.__hinst
push 0
push str.rundll32_args_hwnd
push dword [ebp - 0xe80]
push esi
call fcn.00405b88
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a78c
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a78c
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a612
mov ecx, eax
call fcn.0040bce8
lea eax, [ebp - 0x420]
push eax
call edi
test ebx, ebx
je 0x40e2ca
push 0x418ddc
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
push esi
mov edi, eax
call fcn.004023cd
test eax, eax
pop ecx
jne 0x40e267
push 1
push edi
push str.rundll32_GetProcAddress_pFun
push dword [ebp - 0xe80]
push esi
call fcn.00405b88
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a78c
mov ecx, eax
call fcn.0040bce8
xor eax, eax
cmp edi, eax
je 0x40e27f
push eax
lea ecx, [ebp - 0xe28]
push ecx
push ebx
push eax
mov dword [ebp - 0xe88], eax
call edi
push ebx
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [ebp - 0xe84]
mov byte [eax], 1
mov byte [ebp - 4], 2
lea ecx, [ebp - 0xe60]
call dword [sym.imp.MSVCP71.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 - 0xe44]
call dword [sym.imp.MSVCP71.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], 0
lea ecx, [ebp - 0xe7c]
call dword [sym.imp.MSVCP71.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 - 0xe88]
jmp 0x40e357
mov byte [ebp - 4], 2
lea ecx, [ebp - 0xe60]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
jmp 0x40e31e
push esi
call fcn.004023cd
test eax, eax
pop ecx
jne 0x40e31e
push 1
lea ecx, [ebp - 0xe44]
call dword [sym.imp.MSVCP71.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 - 0xe80]
push esi
call fcn.00405b88
pop ecx
pop ecx
mov ecx, eax
call fcn.0040bd19
mov ecx, eax
call fcn.0040a80a
mov ecx, eax
call fcn.0040bce8
mov byte [ebp - 4], 1
lea ecx, [ebp - 0xe44]
call dword [sym.imp.MSVCP71.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], 0
lea ecx, [ebp - 0xe7c]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
push dword [ebp - 0xe84]
mov ecx, dword [ebp - 0xe80]
push dword [ebp - 0xe8c]
call fcn.0040ca4f
mov esi, eax
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xea4]
call fcn.004068e0
mov ecx, dword [ebp - 0xc]
pop edi
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.004113e5
leave
ret 0xc