C windows system32 rundll32 exe c windows system32 mscories dll install

Attention Before you read this post, I highly recommend you check out my resources page for access to the tools and services I use to not only maintain my system but also fix all my computer errors, by clicking here!

What Is Rundll32.exe

Rundll32.exe is an integral component of your Windows operating system, as it is used to place DLL files into system memory. A DLL file is basically a file that is used by more than one program on your computer. The rundll32.exe file is important in that it makes these files available in memory (RAM) so that the data can be processed by the CPU; this in turn prevents the unforeseeable circumstance of your system being rendered inoperable. It’s very rare that people will come face to face with the rundll32.exe error, but it does happen, hence your presence here.

What Causes the Rundll32.exe Error?

There are a number of reasons why you may be confronted with this frustrating rundll32.exe error. It can be anything from the files inability to execute a specific program, a corrupt rundll32.exe file, a viral or malware infection or a Windows integrity issue. The reason(s) you may be experiencing this issue is very expansive, which is why it’s not uncommon for people to spend a considerable amount of time trying to pinpoint the exact cause of the error.

However, in most cases, when a person is confronted with this particular rundll32.exe error, it’s usually due to an invalid or incorrect installation or uninstallation of a program/driver/application; which could be the result of a virus on your system. Again, it can be rather difficult trying to determine the root cause of this problem; this is because of all the potential culprits. Below I have put together a comprehensive guide on the various steps you should consider undertaking while attempting to rectify this issue.

How to Fix the Rundll32.exe Error

You’d be surprised by the amount of errors that can be resolved by simply restarting your system. Perhaps your issue is temporal and the system will rectify itself on a system restart. If you’re lucky, then the problem your experience may only require a single reboot. But if the problem still persists after the reboot then continue with the following.

The first thing you’re going to want to do is find out which application is running the rundll32.exe file. If you’re running Windows XP on your system, then you will have to download a program called Process Explorer. For Windows Vista/7 Users, the ability to see which file is running rundll32.exe is built in Windows Task Manager.

Windows XP

1. First, download Process Explorer from here: http://technet.microsoft.com/en-gb/sysinternals/bb896653.aspx

2. Then extract it to a folder and double click on Procexp.exe to load the program up.

Run Procexp.exe Program

3. Once Process Explorer has loaded, hover your mouse pointer over rundll32.exe to find out which program is running it.

Lookup rundll32.exe

Windows Vista/7

1. First, hold down Ctrl+Alt+Del, and then click on Windows Task Manager.

2. Once Windows Task Manager has loaded up, click on View -> Select Columns.

Картинка с сайта: www.compuchenna.co.uk

3. This will load up a small dialog box called Select Process Page Columns, from here, scroll down and check the box next to Command Line, then click on OK.

Select Process Page Columns

4. If done correctly, you should see a new column called Command Line which you can use to find out where the rundll32.exe file is running from. Position your mouse pointer over the rundll32.exe process in order to find out which program is running it.

Notes

Once you’ve determined which application is running the rundll32.exe file, fixing the issue may be as simple as uninstalling the program, restarting your computer and reinstalling the program again. These types of errors are typically the result of file corruption or viral infection.

If the rundll32.exe file is not running from the System32 directory, then there is a good chance that you have a virus on your computer, as it’s not uncommon for malware to imitate this file. Thus, I recommend you scan your system to ensure it’s free of any viral infections. There are a number of anti-malware programs that you can use, but I personally recommend you use SpyHunter, which you can download here:

CLICK HERE TO CHECK OUT SPYHUNTER

You should also run an anti-virus program, which you should already have installed on your system, but if for some unknown reason you do not have one, I recommend you use Paretologic Internet Security, you can grab a hold of it here:

CLICK HERE TO CHECK OUT PARETOLOGIC INTERNET SECURITY

File Association Fix

If the rundll error is a result of a virus and you safely disinfecting your system using the programs recommended above, then there is a chance that your system may lose the ability to run programs.

The symptoms are: whenever you attempt to run a program, the “Open program with?” dialogue box pops up, and trying to run items in Control Panel brings up an error that is very similar to the rundll32.exe issue you were previously saddled with. Anyway, to fix this problem, do the following.

1. You will need to restore your default associations for EXE files; this can be done by downloading this small registry file: http://www.dougknox.com/xp/fileassoc/xp_exe_fix.zip

2. Once the file has been successfully downloaded and extracted to a folder, double click on it, and click on Yes.

Set Registry Entry

Rundll32.exe Not Found Error

A missing or corrupt rundll32.exe file can be repaired using a number of methods. The quickest method is to copy the file from your Windows installation CD to your computers System32 folder. To accomplish this, do the following.

Copy Rundll32.exe File from Windows CD

1. First ensure you’ve logged into your computer with administrative rights.

2. Then click on Start -> Run, type cmd and click on OK. [Windows Vista/7: Start -> Type cmd (into the Search programs and files box) and Press CTRL + Shift + Enter, then click on Continue]

Start Command Prompt

3. Once Command Prompt loads up, put your Operating System CD, into your CD/DVD ROM drive, then type “expand [CD-ROM DRIVE LETTER]:\i386\rundll32.ex_ c:\windows\system32\rundll32.exe” and press Enter.

Install rundll32.exe

4. This will copy a fresh, uncorrupted version of the file onto your system.

Download and Copy Rundll32.exe File

If you do not have the Windows installation CD, then as an alternative, you can download the file from the internet and manually copy it to your System32 folder. To accomplish this, do the following.

1. First, download the rundll32.exe file for your OS.

Windows XP: http://tinyurl.com/2dye9z

Windows Vista: http://tinyurl.com/cvm75zu

Windows 7: http://tinyurl.com/bqc5am7

2. Then click on Start -> Run [Windows Vista/7: Press + R], type “%windir%/system32” and click on OK.

Open System32 Folder

3. This will open up your System32 folder, from here; you’ll want to Cut the new Rundll32.exe file (from the folder you extracted it to).

Cut Rundll32.exe file

4. Then Paste it into your System32 folder.

Rundll32 to System32 folder

Run a Registry Scan

After successfully copying a new rundll32.exe file to your system32 folder or reinstallation the application at fault, you should run a full scan of your system registry. This should be untaken as a precautionary measure to iron out any additional errors that may be lingering within the registry. Anyway, to complete this task, I highly recommend you download and install Advanced System Repair Pro from here:

CLICK HERE TO CHECK OUT ADVANCED SYSTEM REPAIR PRO

It will automatically correct any additional system registry errors that were caused by the rundll32.exe issue.

After successfully following all the steps above, your system should now be free of any and all errors. If the rundll32.exe error still persists, then it’s more than likely the result of a hardware fault, which in most cases is the hard drive.

With that said, you now know how to successfully remedy the rundll error. If you’re unfortunate to ever experience this error again, you can always refer back to this tutorial. Be sure to bookmark this page and share it with those you feel it will be of most help to.

Are you looking for a way to repair all the errors on your computer?

If the answer is Yes, then I highly recommend you check out Advanced System Repair Pro.

Which is the leading registry cleaner program online that is able to cure your system from a number of different ailments such as Windows Installer Errors, Runtime Errors, Malicious Software, Spyware, System Freezing, Active Malware, Blue Screen of Death Errors, Rundll Errors, Slow Erratic Computer Performance, ActiveX Errors and much more. Click here to check it out NOW!

  • Home
  • Knowledge Base
  • Introduction to Rundll32 and Ways to Fix Rundll32 Error

By Sonya |
Last Updated

Do you know what is rundll32.exe? And do you know that sometimes there are many viruses having the same file name with rundll32.exe? These viruses can make some troubles to your computer, therefore, read this article, you can get some solutions to fix rundll32.exe error.

What Is Rudll32.exe?

Rundll32 is the acronym of Run Dynamic Link Library 32-bit. The genuine rundll32.exe file is an executable file on the hard drive of your computer and it is also a software component of Microsoft Windows. And you shouldn’t remove it unless it doesn’t locate at C:\Windows because runDll is a critical Windows component and a Windows command-line utility program.

Tip: In order to avoid data loss on your computer caused by rundll32 error, I highly recommend you to back up data using MiniTool software.

Rundll32.exe consists of machine code, so you can trigger a function exported from a 32-bit DLL. It is written to specifically trigger DLL functions that are explicitly written to be called by it. Initially, rundll was only used internally at Microsoft, but is now available for general use.

the location of rundll32.exe

Rundll32 loads and runs a 32-bit DLL and distributes multiple DLL libraries in the file system’s memory. As an important component of some Windows operating systems, if you remove it, then it can lead to errors.

Why Do You Have Multiple Instances of Rundll32.exe?

If you use Windows Task Manager to check running processes and find multiple copies of rundll32.exe, it may mean that there is a virus or Trojan on your computer. But the official Windows rundll32.exe is safe and will not harm your computer.

How to Recognize Suspicious Variants?

  1. The security rating of rundll32.exe located in a subfolder of C:\Windows is 7% dangerous and the file size is 44,544 bytes (77% of all occurrences), 51,200 bytes and 8 more variants.
  2. The security rating of rundll32.exe located in a subfolder of the user’s profile folder is 68% dangerous and the file size is 24,576 bytes (17% of all occurrences), 120,992 bytes and 19 more variants.
  3. The security rating of rundll32.exe located in a subfolder of the Windows folder for temporary files is 48% dangerous and the file size is 310,359 bytes (75% of all occurrences) or 44,544 bytes.
  4. The security rating of rundll32.exe located in a subfolder of C:\Program Files is 60% dangerous and the file size is 359,936 bytes (33% of all occurrences), 5,541,945 bytes or 290,816 bytes.
  5. The security rating of rundll32.exe located in a subfolder of C:\Windows folder is 40% dangerous and the file size is 44,544 bytes (50% of all occurrences) or 32,768 bytes.
  6. The security rating of rundll32.exe located in a subfolder of C:\Windows\System32 is 52% dangerous and the file size is 376,851 bytes (50% of all occurrences) or 256,512 bytes.
  7. The security rating of rundll32.exe located in a subfolder of C:\ is 24% dangerous and the file size is 44,544 bytes.
  8. The security rating of rundll32.exe located in the Windows folder for temporary files is 54% dangerous and the file size is 20,480 bytes.

How to Identify Fake Rundll32.exe Processes?

Usually, rundll32.exe is located at the Windows System32 folder, so you can adapt the following steps to check whether the rundll32.exe is fake.

Step 1: Type task in the search box next to Cortana.

Step 2: Click Task Manager.

Step 3: Click Details in the Task Manager window.

Step 4: Find rundll32.exe and right-click it

Step 5: Choose Open file location to check whether this rundll32.exe file is located at the Windows System32 folder

If the rundll32.exe file location is not in the Windows System32 folder, then you’d better run a full virus scan because the rundll32 may be the fake one.

How to Fix Rundll32.exe Windows 10 Error?

In most cases rundll32.exe error occurs caused by missing DLL files, corrupted DLL files, incorrect DLL entries in the Windows registry or a shared DLL file deleted or infected by a virus.

There are 7 efficient methods for you to fix rundll32.exe error Windows 10.

  1. Check antivirus software: if rundll32.exe is being added to the sandbox, then you need to remove it from the sandbox or uninstall your antivirus software to fix this error.
  2. Use the scannow command: you can use this method to fix the corrupted file.
  3. Replace the corrupted file using Startup Repair.
  4. Replace the corrupted rundll32.exe file: you can copy a genuine rundll32.exe file from another Windows 10 PC to a USB flash drive, then paste it into your computer.
  5. Clear the cache of your browser and close all tabs: if you open a scamming website, this error may occur, so clear your browsing history and cache.
  6. Make sure your computer is up to date: if there are some system errors, then there might be rundll32.exe error. Here is the way to check: open Settings > click Update & Security > click Windows Update > click Check for updates.
  7. Run System Restore.

About The Author

Position: Columnist

Author Sonya has been engaged in editing for a long time and likes to share useful methods to get rid of the common problems of Windows computers, such as Windows Update error. And she aims to help more people to protect their data. What’s more, she offers some useful ways to convert audio and video file formats. By the way, she likes to travel, watch movies and listen to music.

Замечали ли вы когда-нибудь загадочный файл rundll32.exe в процессах Windows? Не пугайтесь! Rundll32.exe – это не вирус, а важный системный компонент, который помогает запускать функции, хранящиеся в DLL-библиотеках. Более того, с его помощью можно получить доступ к скрытым настройкам Windows и оптимизировать работу системы. Хотите узнать, как? Тогда читайте дальше!

Что такое RunDLL32 и зачем он нужен?

RunDLL32.exe – это системный файл Windows, который выполняет функции, содержащиеся в динамически подключаемых библиотеках (DLL). Представьте себе DLL как контейнеры с инструментами. Сам по себе контейнер бесполезен, но инструменты внутри могут выполнять различные задачи. Rundll32.exe — это как рука, которая достает нужный инструмент из контейнера и использует его. Таким образом, он позволяет Windows использовать функционал, не загружая целые программы.

Как использовать RunDLL32?

Cписок команд Rundll32 в Windows 10

Для запуска команд RunDLL32 используйте диалоговое окно «Выполнить» (Windows + R). Введите rundll32, затем команду, и нажмите Enter. Будьте осторожны с командами, найденными в интернете, и используйте только проверенные источники, чтобы избежать возможных проблем.

Управление дисками и устройствами

Быстро открыть «Управление дисками» можно с помощью команды:

rundll32 diskmgmt.msc,DiskMgmt_RunDLL

Это удобнее, чем искать его через меню «Пуск».

Управление питанием

Хотите быстро настроить параметры электропитания? Используйте команду

rundll32.exe powercfg.cpl,,3

Это откроет окно «Параметры электропитания», где вы сможете выбрать подходящую схему.

Настройки экрана

Изменить разрешение экрана, ориентацию и другие параметры дисплея можно с помощью команды

rundll32.exe shell32.dll,Control_RunDLL desk.cpl

Удаление программ

Чтобы открыть окно «Установка и удаление программ» (или «Программы и компоненты» в более поздних версиях Windows), используйте команду

rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl

Список команд RunDLL32 для Windows

Открыть страницу персонализации рабочего стола на вкладке Фон

rundll32.exe shell32.dll, Control_RunDLL desk.cpl,,2

Запустить мастер установки принтера

rundll32.exe shell32.dll, SHHelpShortcuts_RunDLL AddPrinter

Запустить Мастер добавления стандартного порта TCP / IP принтера

rundll32.exe tcpmonui.dll, LocalAddPortUI

Пользовательский Интерфейс Принтер

rundll32.exe printui.dll, PrintUIEntry /?

папка Принтеры

rundll32.exe Shell32.dll, SHHelpShortcuts_RunDLL PrintersFolder

Открыть Панель управления

rundll32.exe shell32.dll, Control_RunDLL

Настройка даты и времени

rundll32.exe shell32.dll, Control_RunDLL timedate.cpl

Настройка дополнительных часов в  апплете Дата и время

rundll32.exe shell32.dll, Control_RunDLL timedate.cpl,,1

Настройка значков рабочего стола

RunDll32.EXE shell32.dll, Control_RunDLL desk.cpl,,0

Откройте Диспетчер устройств

rundll32.exe devmgr.dll DeviceManager_Execute

Изменить параметры экрана

rundll32.exe shell32.dll, Control_RunDLL desk.cpl

Открыть Центр специальных возможностей

rundll32.exe shell32.dll, Control_RunDLL access.cpl

Открыть параметры Проводника файлов на вкладке Общие

rundll32.exe shell32.dll, Options_RunDLL 0

Открыть параметры Проводника файлов на вкладке Поиск

rundll32.exe shell32.dll, Options_RunDLL 2

Открыть параметры Проводника файлов на вкладке Вид

rundll32.exe shell32.dll, Options_RunDLL 7

Открыть папку шрифты (Fonts)

rundll32.exe Shell32.dll, SHHelpShortcuts_RunDLL FontsFolder

Запустить Мастер забытых паролей

rundll32.exe keymgr.dll, PRShowSaveWizardExW

Открыть апплет Игровые устройства

rundll32.exe shell32.dll, Control_RunDLL joy.cpl

Hibernate или режим сна.

rundll32.exe powrprof.dll, SetSuspendState 0,1,0

Блокировка компьютера

rundll32.exe user32.dll, LockWorkStation

Изменение параметров индексирования

rundll32.exe shell32.dll, Control_RunDLL srchadmin.dll

Открыть апплет Инфракрасная связь

rundll32.exe shell32.dll, Control_RunDLL irprops.cpl

Открыть Сетевые подключения

rundll32.exe shell32.dll, Control_RunDLL ncpa.cpl

Запуск мастера — Подключить сетевой диск

rundll32.exe Shell32.dll, SHHelpShortcuts_RunDLL Connect

Замена левой и правой кнопки мыши

rundll32.exe User32.dll, SwapMouseButton

Открыть диалоговое окно Свойства: Мышь

rundll32.exe Shell32.dll, Control_RunDLL main.cpl @ 0,0

Администратор источника данных ODBC

RunDLL32 shell32.dll, Control_RunDLL odbccp32.cpl

Параметры Пера и сенсорного ввода

rundll32.exe shell32.dll, Control_RunDLL tabletpc.cpl

Электропитание

rundll32.exe Shell32.dll, Control_RunDLL powercfg.cpl

Процесс праздные задачи

rundll32.exe advapi32.dll, ProcessIdleTasks

Открыть программы и функциональные возможности

rundll32.exe shell32.dll, Control_RunDLL appwiz.cpl,,0

Откройте апплет Регион на вкладке Форматы

rundll32.exe Shell32.dll, Control_RunDLL Intl.cpl,,0

Откройте апплет Регион на вкладке Расположение

rundll32.exe Shell32.dll, Control_RunDLL Intl.cpl,,1

Откройте апплет Регион на вкладке Администрирование

rundll32.exe Shell32.dll, Control_RunDLL Intl.cpl,,2

Запуск Безопасное извлечение устройства

rundll32.exe Shell32.dll, Control_RunDLL HotPlug.dll

Откройте окно настроек Screen Saver

rundll32.exe shell32.dll, Control_RunDLL desk.cpl,,1

Открыть Центр безопасности и обслуживания

rundll32.exe shell32.dll, Control_RunDLL wscui.cpl

Настройка программ по умолчанию

rundll32.exe shell32.dll, Control_RunDLL appwiz.cpl,,3

Запустить Мастер настройки сети

rundll32.exe shell32.dll, Control_RunDLL NetSetup.cpl

Откройте апплет Звук на вкладке Воспроизведение

rundll32.exe Shell32.dll, Control_RunDLL mmsys.cpl,,0

Откройте апплет Звук на вкладке Запись

rundll32.exe Shell32.dll, Control_RunDLL mmsys.cpl,,1

Откройте апплет Звук на вкладке Звуки

rundll32.exe Shell32.dll, Control_RunDLL mmsys.cpl,,2

Откройте апплет Звук на вкладке Связь

rundll32.exe Shell32.dll, Control_RunDLL mmsys.cpl,,3

Открыть Параметры Windows- персонализация — Стартовая страница

rundll32.exe shell32.dll, Options_RunDLL 3

Сохранение имен пользователей и паролей

rundll32.exe keymgr.dll, KRShowKeyMgr

Открыть Свойства системы на вкладке Имя компьютера

rundll32.exe Shell32.dll, Control_RunDLL sysdm.cpl,,1

Откройте Свойства системы на вкладке Оборудование

rundll32.exe Shell32.dll, Control_RunDLL sysdm.cpl,,2

Откройте Свойства системы на вкладке Дополнительно

rundll32.exe Shell32.dll, Control_RunDLL sysdm.cpl,,3

Откройте Свойства системы на вкладке Защита системы

rundll32.exe Shell32.dll, Control_RunDLL sysdm.cpl,,4

Откройте Свойства системы на вкладке Удаленный доступ

rundll32.exe Shell32.dll, Control_RunDLL sysdm.cpl,,5

Откройте настройки панели задач в приложении Параметры

rundll32.exe shell32.dll, Options_RunDLL 1

Откройте апплет Учетные записи пользователей

rundll32.exe shell32.dll, Control_RunDLL nusrmgr.cpl

Открыть Включение и отключение компонентов Windows

rundll32.exe shell32.dll, Control_RunDLL appwiz.cpl,,2

Откройте брандмауэр Windows

rundll32.exe shell32.dll, Control_RunDLL firewall.cpl

Открыть свойства клавиатуры

rundll32.exe shell32.dll, Control_RunDLL main.cpl @ 1

Открыть окно сведения Windows

rundll32.exe SHELL32.DLL, ShellAbout

Дополнительно: здесь список rundll32.exe команд, которые позволят управлять Internet Explorer.

RunDLL32 команды для Internet Explorer

Удалить всю историю просмотра в Internet Explorer

rundll32.exe inetcpl.cpl, ClearMyTracksByProcess 255

Удалить всю историю просмотра и дополнений  в Internet Explorer

rundll32.exe inetcpl.cpl, ClearMyTracksByProcess 4351

Удалить файлы cookie и данные веб-сайтов в Internet Explorer

rundll32.exe inetcpl.cpl, ClearMyTracksByProcess 2

Удалить историю загрузок в Internet Explorer

rundll32.exe inetcpl.cpl, ClearMyTracksByProcess 16384

Удаление данных форм в Internet Explorer

rundll32.exe inetcpl.cpl, ClearMyTracksByProcess 16

Удалить историю в Internet Explorer

rundll32.exe inetcpl.cpl, ClearMyTracksByProcess 1

Удаление паролей в Internet Explorer

rundll32.exe inetcpl.cpl, ClearMyTracksByProcess 32

Удаление временных файлов Интернета и файлов веб-сайтов в Internet Explorer

rundll32.exe inetcpl.cpl, ClearMyTracksByProcess 8

Упорядочить избранное в Internet Explorer

Rundll32.exe shdocvw.dll, DoOrganizeFavDlg

Откройте Свойства обозревателя на вкладке Общие

rundll32.exe shell32.dll, Control_RunDLL inetcpl.cpl

Откройте Свойства обозревателя на вкладке Безопасность

rundll32.exe shell32.dll, Control_RunDLL inetcpl.cpl,,1

Откройте Internet Properties на вкладке Конфиденциальность

rundll32.exe shell32.dll, Control_RunDLL inetcpl.cpl,,2

Откройте Свойства обозревателя на вкладке Содержание

rundll32.exe shell32.dll, Control_RunDLL inetcpl.cpl,,3

Откройте Свойства обозревателя на вкладке Подключения

rundll32.exe shell32.dll, Control_RunDLL inetcpl.cpl,,4

Откройте Свойства обозревателя на вкладке Программы

rundll32.exe shell32.dll, Control_RunDLL inetcpl.cpl,,5

Откройте Свойства обозревателя на вкладке Дополнительно

rundll32.exe shell32.dll, Control_RunDLL inetcpl.cpl,,6

Практические советы по использованию RunDLL32

  • Всегда будьте осторожны при вводе команд RunDLL32. Ошибки могут привести к нестабильной работе системы.
  • Создавайте ярлыки для часто используемых команд. Это сэкономит ваше время.
  • Проверяйте команды из непроверенных источников перед использованием.

Заключение

RunDLL32 – это мощный инструмент для управления Windows. Он позволяет получить доступ к скрытым функциям и упростить выполнение рутинных задач. Попробуйте наши советы и оставьте отзыв! Мы будем рады узнать о вашем опыте использования RunDLL32.

After researching ways to export functions with their actual names from DLLs [1] the next thing I asked myself was: How I provide arguments to a DLL I execute via rundll32.exe. (When this post was first written) Bits and pieces of information existed out there. The post assembles this scattered information and presents it in a hopefully easy-to-digest way.

This post in sections:

  • rundll32.exe behind the scenes
    • A short demo of debugging rundll32
  • What is needed to pass arguments to a function using rundll32
  • Code to generate a DLL with exported function
  • Output of calling an exported function
  • Bonus 1: Additional Observation
  • Bonus 2: Powliks malware leveraging rundll32
  • References

rundll32.exe behind the scenes

Always fascinated about the mystery behind the windows native utility rundll32.exe, I was looking for more information on how it actually works behind the scenes. At that time I was aware that it could be used to execute an exported function from a DLL. Assuming we’re working with the DLL named test.dll, this can be achieved with the following syntax:

rundll32.exe test.dll,<exported function name>

The step forward is how to pass arguments to this exported function and that’s the reason why this post exists!

The research [2][3] revealed that arguments can be passed in this manner:

rundll32.exe test.dll,<exported function name> <argument1> <argument2> <…> <argumentN>

Assume you have a DLL you call test.dll and the function HelperFunc. This function takes two arguments — one and 2. This would be the way to call the function (notice there is no space between test.dll and HelperFunc):

rundll32.exe test.dll,HelperFunc one 2

The following list shows the actions rundll32.exe takes in order to execute the exported function:

  1. Parses the command line
  2. Loads the specified DLL via LoadLibrary
  3. Obtains the address of the exported function via GetProcAddress
  4. Calls the exported function passing the arguments provided via the command line
  5. Unloads the DLL and exits once the exported function returns

A short demo of debugging rundll32

In this section we use windbg to confirm/trace what rundll32.exe does in the background. We already know that the LoadLibrary APIs (exported by kernel32.dll) call the LdrLoadDll (exported by ntdll.dll). So the next logical step is to break on LdrLoadDll and inspect the arguments that are passed to it.

We setup the breakpoint:

bp ntdll!LdrLoadDll

The LdrLoadDll is called multiple times as the Windows loader loads the appropriate modules in the address space of rundll32. Thus, we expect to hit our breakpoint many times. In order to see exactly when the DLL we provided as input to rundll32 gets loaded, as we said earlier, we have to inspect the passed arguments.

Sadly and as it happens with many Windows APIs, LdrLoadDll is (at the time of writing) officially undocumented but a look around brings us to documentation written by researchers [4]. We are testing this on a x64 Windows 10 operating system. This means that the arguments to functions are passed in the registers RCX, RDX, R8, R9 [5]. The R8 register holds the name of the module to be loaded. To see which module is loaded each time we hit the breakpoint, we will be inspecting the R8 register. This register contains the pointer to a _UNICODE_STRING struct that has the actual name of the DLL to be loaded.

Once we hit the breakpoint, we issue the command:

dt _UNICODE_STRING @r8

Here is the output we got on the test machine:

unicodestring

We can also inspect the call stack and confirm that the call to LdrLoadDll originates from LoadLibraryExW:

What is needed to pass arguments to a function using rundll32

Someone can jump to the conclusion that rundll32.exe can be leveraged to execute any function from any DLL. This conclusion is not correct. Certain conditions apply for it to be true.

If the DLL that is called from rundll32.exe implements DllMain, this function is run as soon as the DLL is loaded in the address space of rundll32 (see the screenshot from DebugView later in this post).

The definition of the called function (exported from the DLL that is given as input to rundll32.exe) has to include certain parameters. The following example shows the definition of an example function exported from an unmanaged DLL:

void WINAPI ExportedFunctionExample(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow);

If you have or want to create an exported function from a managed DLL (a DLL created with .NET Framework, written in C# — Csharp), the function needs to be defined similarly. The following definition is the C# equivalent that will work for this purpose:

public static void ExportedFunctionExample(IntPtr hwnd, IntPtr hinst, string lpszCmdLine, int nCmdShow);

Code to generate a DLL with exported function

A straightforward approach to create export functions is described in this section of my post “Exporting functions from DLL using the actual function name”.

To demonstrate that it is possible to pass arguments to a function that is exported from a DLL, I wrote this code that once is compiled exports the function HelperFunc. The API OutputDebugStringA was used to print output to Sysinternal’s utility DebugView and thus trace the execution of this code.

#include <windows.h>
#include <debugapi.h>

#define DllExport comment(linker, "/EXPORT:HelperFunc=?HelperFunc@@YGXPAUHWND__@@PAUHINSTANCE__@@PADH@Z")

void WINAPI HelperFunc(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow)
{
    #pragma DllExport
    OutputDebugStringA("HelperFunc was executed");
    OutputDebugStringA(lpszCmdLine);
}

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
    switch(fdwReason)
    {
        case DLL_PROCESS_ATTACH:
            OutputDebugStringA("DllMain was executed");
            break;
        case DLL_PROCESS_DETACH:
        case DLL_THREAD_ATTACH:
        case DLL_THREAD_DETACH:
            break;
    }

    return TRUE;
}

Output of calling an exported function

The following screenshot shows output from DebugView when we execute the following:

rundll32.exe test.dll,HelperFunc one 2 three

Bonus 1: Additional observation

I’ve also checked if it would be possible to execute the DLL with extensions unrelated to PE images, like for example .txt .crt .random. The following executions were successful, even if the DLL didn’t have that extension.

runndll32.exe test.crt,HelperFunc one 2 three

runndll32.exe test.txt,HelperFunc one 2 three

runndll32.exe test.random,HelperFunc one 2 three

Bonus 2: Powliks malware leveraging rundll32

You can also check the analysis [6] of a technique the malware Powliks used back in 2014 to execute malicious JavaScript using rundll32.exe.

Microsoft published a really informative report on threat actors that targeted cybersecurity researchers. What is interesting in this report and lines up with the present article is how the attacker executed their payloads. Few examples listed in Microsoft’s report:

C:\Windows\System32\rundll32.exe C:\ProgramData\VirtualBox\update.bin,ASN2_TYPE_new 5I9YjCZ0xlV45Ui8 2907

In the above example the attakers executed the (exported) function ASN2_TYPE_new from the DLL update.bin. The arguments provided to this function were the strings 5I9YjCZ0xlV45Ui8 and 2907

In another example taken again from the same report:

Rundll32.exe dxgkrnl_poc.vcxproj.suo,CMS_dataFinal Bx9yb37GEcJNK6bt 4231

This time, the function CMS_dataFinal exported from the DLL dxgkrnl_poc.vcxproj.suo was executed with the arguments Bx9yb37GEcJNK6bt and 4231.

To identify if the provided arguments have been processed by the function further analysis of the malicious libraries is required.

* If you are interested to explore this corner of the web have a look at other posts

References

[1] https://stmxcsr.com/exporting-from-dll.html

[2] https://renenyffenegger.ch/notes/Windows/dirs/Windows/System32/rundll32_exe/index#rundll32-syntax

[3] https://www.fireeye.com/content/dam/fireeye-www/global/en/blog/threat-research/Flare-On%202017/Challenge6.pdf

[4] https://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FExecutable%20Images%2FLdrLoadDll.html

[5] https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention

[6] https://thisissecurity.stormshield.com/2014/08/20/poweliks-command-line-confusion/

[7] https://www.microsoft.com/security/blog/2021/01/28/zinc-attacks-against-security-researchers/

tags:

#reversing

Обновлено: 14.05.2019. Опубликовал: Админ, на

Содержание:

  • За что отвечает rundll32.exe
  • Месторасположение
  • Ошибки со ссылкой на процесс rundll32.exe
  • Как отключить процесс rundll32 в Windows
  • Вопросы и ответы: 0

Система Windows использует одновременно множество файлов, так как является многозадачной и запускает много фоновых служб. И каждое запущенное приложение также использует не только свои собственные файлы, но и функции системы, которые содержатся в файлах с расширением dll и называются библиотеками. В них запрограммированы определённые алгоритмы, которыми активно пользуются программисты. Это сильно облегчает использование возможностей системы и ускоряет разработку программ. Кстати, именно поэтому некоторые программы могут не работать на других версиях Windows – потому что в них нет нужных библиотек.

Работа с процессом rundll32.exe.

За что отвечает rundll32.exe

Если нажать клавиши Ctrl+Alt+Delete и перейти в диспетчер задач, то на вкладке «Службы» можно обнаружить множество запущенных процессов, которые работают в данный момент. Среди них найдётся и rundll32.exe, но что это такое? Многие почему-то считают его отдельным приложением, причём вредоносным. Вероятно, потому что в случае многих возникающих системных сбоев появляется сообщение с упоминанием этой службы. На самом деле хост-процесс Windows под названием rundll32 необходим для подключения в нужный момент нужных библиотек dll. Сами по себе они не являются исполняемыми, а содержат лишь некие алгоритмы. Делается это по требованию системы или разных приложений. Он как бы отыскивает и предоставляет доступ к нужным функциям тем программам, которым они требуются. Появление ошибки с упоминанием этого процесса чаще всего означает, что нужной библиотеки не нашлось. Это бывает из-за разных причин, в том числе и неправильно установленной программы.

Ошибка процесса rundll32.exe

Теперь вы знаете, что это за процесс. Также следует знать, что он не всегда необходим, так как срабатывает лишь при необходимости. Но иногда он прописывается в автозагрузке и стартует вместе с системой, что не всегда нужно, но создаёт лишнюю нагрузку и расходует память. Причём запускается он не сам по себе, а посредством какой-нибудь программы – если её отключить, то и rundll32.exe тоже не будет запускаться.

Месторасположение

Файл rundll32.exe располагается в папке установленной системы Windows, в поддиректории System32, если система 32-битная, или в SysWOW64 в случае 64-битной. Но иногда можно обнаружить, что запущенная служба с таким же именем находится в другой папке, иногда вообще за пределами системы – это вредоносная программа, которую просто маскируют под распространённую службу. Если такая обнаружена, нужно немедленно её остановить и проверить компьютер антивирусом. Точно узнать, из какого места запускается этот файл, несложно. Всю информацию может показать, например, приложение Process Explorer, которую можно скачать с сайта Microsoft. Оно выводит список всех фоновых процессов и подробную информацию по любому из них.

Месторасположение файла rundll32.exe

Ошибки со ссылкой на процесс rundll32.exe

Иногда можно увидеть сообщение об ошибке такого типа «Windows cannot find C:\Windows\Rundll32.exe. Make sure you typed the name correctly and try again». Это значит, что система не обнаружила rundll32.exe. Если такое случилось, это повод немедленно проверить компьютер антивирусом. Решить же проблему с отсутствующим файлом поможет диск или флешка с системой Windows. Действовать нужно по инструкции, которая появится при ошибке. Отсутствующий файл найдётся в дистрибутиве и скопируется в системную папку. Исправить проблему с rundll32.exe поможет и программа DLL Suite, которую несложно найти в Интернете. Она просканирует системные папки и найдёт все проблемы с библиотеками. В том числе это приложение проверяет наличие файла rundll32.exe, и при необходимости может скачать его официальную версию.

Программа DLL Suite

Как отключить процесс rundll32 в Windows

Как правило, этот процесс запускается не самостоятельно, а только вместе с какой-либо программой, которой требуется доступ к сторонним библиотекам. Чтобы отключить его, сначала нужно завершить работу этой программы, что не всегда просто, так как это может быть и драйвер какого-либо устройства. Выявить её поможет Process Explorer – эта утилита покажет, какое приложение запускает этот процесс. После этого действия несколько отличаются в зависимости от версии Windows. В 7 версии введите команду msconfig в командной строке и появится окно с вкладкой «Автозагрузка». Там нужно отключить приложение, которое и запускает нежелательный процесс. После перезагрузки его не должно быть в списке запущенных. В Windows 8 и 10 в Панели управления есть пункт «Автозагрузка», где можно сделать то же самое. Но помните: если отключить хост-процесс rundll32 в Windows, он всё равно запустится, когда в этом возникнет необходимость.

Как удалить rundll32.exe совсем? Это можно сделать, хотя и с трудом, так как Windows защищает системные файлы от удаления. Простейший способ обойти это – загрузиться с диск или флешки, а потом можно удалять что угодно. Но делать этого не нужно. Такой шаг повлечёт за собой множество проблем с самыми разными приложениями, в том числе с драйверами устройств, система станет нестабильной, будет часто показывать сообщение об ошибке, а некоторые программы перестанут работать. Безопасно, и даже полезно удалять этот файл, если он на самом деле вредоносный, маскирующийся под настоящий. Но свежий антивирус, скорее всего, выявит его сам и предупредит вас об этом.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Программы скачивания музыки для windows
  • Как удалить eset online scanner с компьютера windows 10
  • Невидимая панель задач windows 10 программа
  • Virtualhere usb server windows
  • Захват аудио с экрана компьютера windows 10