From the course: Learning Assembly Language
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Executing system commands - Python Tutorial
From the course: Learning Assembly Language
Executing system commands
- [Narrator] We can execute a Windows command from our assembly code by using either the legacy WinExec function or using the create process function. Let's take a look at WinExec. I'll define a constant called SW_SHOW and set it to five to define the way we want the window to show when we execute. In the data area, I'll set up the command string to execute C:windows, system 32, notepad.exe, and in the code section we invoke WinExec with the address of command and SW_SHOW. So let's build this and run it and hey, presto, we get Notepad popping up. We might want to just pop up a command window. We can do that as well by executing cmd.exe, build, run, and we get our command window. If we want to run a more powerful shell, we can, of course, run PowerShell or PowerShell_ise. Let's do that. Build, build starter, build, run, and we get the annotated PowerShell.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Calling subprograms9m 20s
-
(Locked)
Working with floating point6m 23s
-
(Locked)
Managing arrays4m 43s
-
(Locked)
Adding plugs to the Enigmatic encryptor2m 54s
-
(Locked)
The Windows API5m 4s
-
(Locked)
More on the Windows API4m 20s
-
(Locked)
Calling the printf external function1m 33s
-
(Locked)
Executing system commands1m 54s
-
(Locked)
Jump tables3m 29s
-
(Locked)
Reading data files6m 33s
-
-
-
-
-