Template and Setup

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Course
Time
13 hours 15 minutes
Difficulty
Beginner
CEU/CPE
14
Video Transcription
00:00
Hello. This is Dr Miller, and this is episode 1.1 of assembly.
00:08
So who should take this course? You should take this course if you're interested in the low level programming, if you want to know how compilers work and d compilers work,
00:17
if you're interested in reverse engineering malicious software or if you want to edit some binary softer that is no longer available where the source is gone.
00:27
So the requirements for this course, our access to an Lennox computer and the ability to install Lennox in a virtual machine one of these two would suffice and then having the ability to use an editor such a Zvi I PICO or Nano is a plus, but not a requirement.
00:44
So in this video, we're gonna learn how to download, install and then run the assembler and the compiler scripts,
00:50
and then we'll edit a sample file.
00:54
So who am I? I'm a professor of computer science and cybersecurity.
00:58
I'm a programmer and a hacker in both life and in computers, and I have a PhD in computer science from Kansas State University.
01:07
So let's install the software.
01:11
So this, after a prerequisites, are you have to install a version of a bun too. So, for example, a bun to 16. 04
01:19
And then we need these additional libraries to be installed.
01:23
So in order to install them, you can use the pseudo command so you can say Sudo apt install Nazem GCC multi lib and V. I am
01:34
so here. I have my a bun, too
01:38
Virtual machine, and I'll go ahead and open up the terminal and I'll go ahead and install those libraries that we wanted to install.
01:45
And all of these are in our lab guide. So if you need help on them, you can go ahead and look up that lab guy. You don't tell you all the steps that we're going to show here.
01:56
So I'm gonna go ahead and open up the terminal
02:00
and we can install the proof pre required libraries.
02:15
It will ask me for my password
02:21
if I can type it right.
02:23
And then I already insult these. So you see that it didn't actually install any of them. But if you didn't have them, it would ask you Do you want to install these and then you hit? Yes.
02:36
So now we have the required libraries for this course.
02:43
Now we have compiler scripts that make building these projects easy.
02:47
And so the process is we're gonna go ahead and download these scripts. The template called the template make.
02:54
We will extract the software, will go ahead and install it, and then we have to log out and create a project.
03:22
Okay, so I've downloaded it. No extract it.
03:30
If I look, I can see I have. So ls will show the files in a directory
03:35
So we can see here that I have downloaded this Targhee zip file.
03:38
And then when I extracted it made a directory, and that's the blue.
03:44
So go ahead and install the software.
03:51
Okay? And it says I'm supposed to log out. So I just closed my terminal,
03:55
open up a new one,
04:00
and then I can create a project.
04:09
Now, what that did is it created a folder under our Projects folder so we can
04:13
see that we have a folder called Projects here. So l s will show us our files and folders.
04:19
You want a full listing? Ls minus. H a l.
04:24
So I go ahead and go into the Projects folder.
04:28
And as I can see, I have a project here called My project.
04:32
Go ahead and enter that directory, and if I look inside of there, I'll see a bunch of different files that we can go ahead and
04:39
use for our class.
04:45
So V. I is a program that allows you to edit files when you open it. You start in non insert mode, and you can type I to enter insert mode
04:55
when we want to leave. Insert mode, weaken type escape
04:58
when we want to writing Quit. If we're not in escape mode, insert mode within type colon w Q. And if we are an insert mode and we want to escape and quit, we type escape colon W Q.
05:13
So here again is how we create a program So we'll go ahead and use the Gen make
05:17
to create a A project called Hello will enter the Project Directory will show the files inside of it.
05:25
Go ahead and added, our file using V I. And I'll tell you, as we're going
05:30
well, type in are a couple of strings in places that where they need to go and then we'll go ahead and build it.
05:35
And again, this is all in the guide.
05:44
All right,
05:45
so let's go ahead and create our project.
05:56
So if we look inside the projects we see we have a Hello ls Lagan shows us off our files.
06:01
Ls minus h. L will show them in Huebel human form, and I'll show all the files. So go ahead and enter my hello directory.
06:15
So the father we're going to edit is hollowed a SM soda editor with V i v I
06:21
hello dot sm.
06:24
We go ahead and look in here and it says that at the top were in the data section.
06:30
We're gonna put the code.
06:32
I typed I for insert high
06:35
d B.
06:38
Hello,
06:39
your type. Whatever you want in here. World
06:44
10 0
06:46
But I didn't use my arrow key to move down in this part. I'm gonna write movie a ex high
06:55
call print
06:57
string.
06:59
Now I'm in insert mode, so I want to
07:01
exit, insert mode and write in quick escape Colon W Q
07:06
All right now to build my project, I type make.
07:12
You wouldn't see that it went ahead and ran the Nazem commands in the GCC command.
07:16
And so now I can run my program by saying dot, slash and then the name of my program, which is hello
07:25
in a printed off Hello world.
07:30
So, in summary, we downloaded in salt our template. We learned how to create a project. Edit that assembly code and it's OK if you don't understand what you did. You just needed to be able to have the ability to
07:42
to edit it.
07:44
And then we assembled and compiled the code using the make command. And then we ran our program.
07:49
So, looking forward, we're gonna learn about assembly programming. We're gonna learn about binary and two's complement and Hexi Decimal.
07:58
If you have questions, you can contact me at Miller MJ at you and Keita et you. And you can find me on Twitter at Milhouse 30.
Up Next