before you code, learn how computers work

Low Level Learning
7 Feb 202407:05

Summary

TLDREn este video, el presentador, conocido como 'low level', comparte sus consejos para aprender programación de bajo nivel rápidamente. Recomienda aprender a programar en C, un lenguaje de bajo nivel que enseña la gestión de memoria y cómo escribir código seguro. Sugiere crear un servidor HTTP para entender profundamente el protocolo y la programación defensiva. Además, insta a los espectadores a aprender ensamblador para comprender cómo funciona el CPU y a realizar ingeniería inversa para entender la compilación y la estructura de los binarios. Finalmente, anima a los novatos a aprender programación en microcontroladores para una comprensión práctica de la arquitectura de CPU.

Takeaways

  • 💻 Para aprender sobre programación de bajo nivel, el presentador recomienda aprender un lenguaje de bajo nivel como C.
  • 🔒 Aprender C te obliga a manejar la memoria de manera efectiva y a escribir código seguro.
  • 🌐 Escribir un servidor HTTP como proyecto para aprender C enseña no solo el protocolo HTTP sino también habilidades defensivas de programación.
  • 📚 Aprender a leer documentación y man pages es esencial para entender cómo funciona el lenguaje y las funciones.
  • 🛠️ Aprender un lenguaje ensamblador te da una comprensión profunda de cómo se comporta el código en el nivel de la CPU.
  • 🔄 Compilar un fragmento de código C y descompilarlo te enseña los fundamentos de la arquitectura de la CPU.
  • 🔍 Aprender ingeniería inversa te enseña cómo están construidos los binarios y cómo funciona el compilador.
  • 🏆 Participar en desafíos de ingeniería inversa, como los de crack.one, es una forma efectiva de aprender y mejorar estas habilidades.
  • 🎓 Escribir código C para microcontroladores como el STM32 o Arduino te enseña a interpretar datasheets y a portar código a diferentes arquitecturas.
  • 🌟 Mantenerse conectado con cómo funcionan los CPUs a nivel básico es importante para la próxima generación de arquitectos de sistemas.

Q & A

  • ¿Qué tipo de lenguajes de programación enseña 'low level' en su canal de YouTube?

    -En su canal, 'low level' enseña a programar en lenguajes como C y les enseña cómo funcionan las computadoras a través de lenguajes como ensamblador.

  • ¿Por qué recomienda 'low level' aprender a programar en C para comprender a un nivel bajo?

    -Recomienda C porque te obliga a aprender la gestión de memoria efectiva y a escribir código que sea inequívocamente seguro, ya que de lo contrario, el código podría ser inseguro y fallar.

  • ¿Qué proyecto sugiere 'low level' para aquellos que están aprendiendo a programar en C?

    -Sugiere escribir un servidor HTTP, que no solo enseñará los detalles del RFC de HTTP sino también aspectos importantes de la programación, como la programación defensiva y la lectura de documentación.

  • ¿Qué ventaja ofrece aprender ensamblador según 'low level'?

    -Aprender ensamblador y comprender cómo funciona el CPU a nivel de instrucciones te da una buena comprensión de cómo se comportará tu código y cómo se optimizará su rendimiento.

  • ¿Cuál es la tercera recomendación de 'low level' para avanzar en programación de bajo nivel?

    -Después de aprender a programar en un lenguaje de bajo nivel y entender cómo se compila el código, recomienda aprender las bases de la ingeniería inversa.

  • ¿Por qué es útil el aprendizaje de la ingeniería inversa según 'low level'?

    -El aprendizaje de la ingeniería inversa te enseña no solo cómo funcionan las cosas sino también cómo están diseñadas, lo que te ayuda a entender mejor los binarios y cómo están construidos en sistemas operativos como Linux.

  • ¿Qué recursos recomienda 'low level' para practicar la ingeniería inversa?

    -Recomienda el sitio web crack.one, donde hay desafíos de ingeniería inversa que puedes descargar y ejecutar en tu computadora o una máquina virtual.

  • ¿Cuál es el consejo adicional que 'low level' ofrece para mejorar en programación de bajo nivel?

    -Además de los tres pasos principales, 'low level' sugiere aprender a programar en C en una placa de desarrollo, como una placa STM32 o Arduino, lo que te permitirá leer y interpretar hojas técnicas y portar tu código a diferentes arquitecturas.

  • ¿Cuál es el objetivo final de 'low level' al enseñar cómo funcionan las computadoras a nivel bajo?

    -El objetivo es recordar a las personas cómo funcionan las computadoras y formar una nueva generación de arquitectos de bajo nivel que entiendan cómo funcionan los CPUs a nivel básico, para mantener la continuidad del conocimiento cuando la generación actual de expertos se retire o se vaya.

  • ¿Qué tipo de desafíos sugiere 'low level' para los que están aprendiendo la ingeniería inversa?

    -Los desafíos de ingeniería inversa suelen estar basados en hechos específicos que debes conocer, como el uso del flag de trampa en CPUs de Intel o el uso de la tabla de desplazamiento global, lo que te enseña aspectos específicos del funcionamiento de los binarios.

Outlines

00:00

💻 Aprendiendo a programar a bajo nivel

El presentador, conocido como 'low level', es un investigador de seguridad y enseña a programar en lenguajes como C y ensamblador. Para aprender a programar a bajo nivel, recomienda aprender un lenguaje de bajo nivel como C, que le dará acceso directo a la memoria del sistema. Destaca la importancia de aprender a manejar la memoria de manera efectiva y a escribir código seguro. Sugiere escribir un servidor HTTP para aprender sobre el protocolo y a programar de manera defensiva. También menciona que aprender ensamblador y entender cómo funciona el CPU a nivel de instrucciones es beneficioso para diseñar código eficiente.

05:01

🔍 Inmersión en la ingeniería inversa y aprendizaje de placas

El presentador sugiere aprender la ingeniería inversa, que es esencial para entender cómo están construidos los binarios y cómo funcionan los sistemas. Recomienda sitios web como crack.one para practicar desafíos de ingeniería inversa. Además, propone aprender a programar en una placa de desarrollo, como una STM32 o Arduino, para entender cómo se ejecuta el código en diferentes arquitecturas de microcontroladores. El objetivo es mantener un conocimiento profundo de cómo funcionan los CPUs y no perderse en la complejidad creciente de la tecnología, asegurando que haya una nueva generación de arquitectos de sistemas que entiendan cómo funcionan los ordenadores a nivel básico.

Mindmap

Keywords

💡C programming language

El lenguaje de programación C es un lenguaje de programación de propósito general que fue diseñado en los años 70 por Dennis Ritchie. Se considera un lenguaje de bajo nivel que permite a los programadores tener un control directo y detallado sobre la memoria y el hardware del sistema. En el guion, se menciona que el aprendizaje de C es esencial para entender la programación de bajo nivel, ya que obliga a los programadores a manejar la memoria de manera efectiva y a escribir código seguro y robusto.

💡Memory management

La gestión de memoria es el proceso de asignar, usar y liberar la memoria en un sistema informático. Es fundamental en lenguajes de bajo nivel como C, donde el programador tiene la responsabilidad de administrar manualmente la memoria. En el video, se destaca la importancia de aprender a gestionar la memoria para evitar fugas y garantizar que el código sea seguro y confiable.

💡HTTP server

Un servidor HTTP es un software que implementa el protocolo de transferencia de hipertexto (HTTP), permitiendo a los usuarios acceder a páginas web y otros recursos a través de Internet. En el guion, se sugiere escribir un servidor HTTP como un proyecto educativo para aprender no solo sobre el protocolo HTTP sino también sobre la programación defensiva y la lectura de documentación técnica.

💡Assembly language

El lenguaje ensamblador, o simplemente ensamblador, es un lenguaje de programación de bajo nivel que está muy cercano al código máquina. Se utiliza para programar directamente en el nivel de la CPU, lo que permite un control preciso y eficiente sobre el hardware. En el video, se menciona que aprender un lenguaje ensamblador y entender cómo funciona la CPU a nivel de instrucciones puede dar una ventaja en la comprensión de cómo se comporta el código.

💡Reverse engineering

El ingeniería inversa es el proceso de analizar un sistema, dispositivo o software para descubrir cómo funciona, a menudo con el objetivo de duplicar o mejorar su funcionamiento. En el contexto del video, se sugiere que el aprendizaje de la ingeniería inversa puede enseñar a los programadores cómo funciona el código una vez compilado y cómo se puede optimizar o depurar.

💡Malware reverse engineering

La ingeniería inversa de malware es una práctica dentro del ámbito de la seguridad informática donde se analiza el código malicioso para comprender su funcionamiento y desarrollar estrategias de defensa. Se menciona en el guion como una de las aplicaciones prácticas del aprendizaje de la ingeniería inversa.

💡Bug hunting

La caza de bugs es el proceso de buscar y solucionar errores en el software. En el video, se sugiere que el aprendizaje de la ingeniería inversa puede ser útil para los 'Bug Hunters', quienes buscan fallos en los programas con el objetivo de mejorar la seguridad y la estabilidad del software.

💡Compiler

Un compilador es un programa que convierte el código fuente escrito en un lenguaje de programación de alto nivel, como C, en código máquina que puede ejecutar el hardware. En el guion, se habla sobre la importancia de entender cómo un compilador traduce el código fuente en código de máquina y cómo esto afecta el rendimiento y la seguridad del programa.

💡Microcontroller

Un microcontrolador es una unidad de computadora integrada en un solo chip que incluye un procesador y otros componentes de hardware necesarios para la operación de un sistema. En el video, se menciona que aprender a programar en un microcontrolador, como el STM32, puede proporcionar una comprensión práctica de cómo funciona el hardware y cómo se puede adaptar el código para diferentes arquitecturas.

💡Data sheet

Una hoja de datos es un documento técnico que proporciona información detallada sobre el diseño, las especificaciones y la funcionalidad de un componente electrónico, como un microcontrolador. En el guion, se sugiere que aprender a interpretar hojas de datos es esencial para programar en microcontroladores y entender cómo se implementa el código en el hardware.

Highlights

Emphasizes the importance of learning low-level programming for a deep understanding of computer systems.

Recommends starting with coding in a low-level language like C for direct memory access and process control.

Suggests writing an HTTP server as a project to learn C, which teaches HTTP RFC and defensive programming.

Advocates learning assembly language to understand CPU architecture and improve code performance.

Encourages reverse engineering to understand how compilers work and to analyze binary code.

Highlights the value of learning on microcontroller boards to apply C and assembly knowledge in a practical context.

Mentions the potential of Rust to replace C in the future for systems programming.

Discusses the necessity of memory management and writing bulletproof code in C.

Stresses the importance of learning to read documentation and man pages when working with C.

Describes the process of reverse engineering a piece of C code to understand CPU architecture.

Recommends the website crack.one for reverse engineering challenges to enhance low-level skills.

Expresses concern about the loss of understanding of basic CPU functions in the era of advanced computing.

Aims to educate and remind people of the fundamentals of how computers work through the YouTube channel.

Invites viewers to join the community of low-level architects to preserve knowledge as older generations retire.

Endorses learning on an STM32 board as a way to understand data sheets and cross-porting code.

Provides a link to another video about an interview question that teaches about CPU operations.

Transcripts

play00:00

I get asked all the time in stream you

play00:02

know if I were to start over again and

play00:04

have to relearn all the stuff that I

play00:05

know what would I do today to learn

play00:07

about the lowest level for those of you

play00:09

that don't know my name is low level

play00:10

learning my day job I'm a security

play00:12

researcher but on the internet I teach

play00:14

people how to code in languages like C

play00:17

and teach them how computers work

play00:18

through languages like assembly and

play00:20

others if you're new here welcome to the

play00:22

channel hit that sub button and let's

play00:23

learn how to be lowlevel together so how

play00:26

would I get from zero to lowlevel as

play00:28

fast as possible thought about this

play00:30

question really hard and I came up with

play00:31

the following three answers three things

play00:33

that I would do today to get good at the

play00:36

low level starting with number one code

play00:39

in a lowlevel language this probably

play00:42

goes without saying but if you know how

play00:44

to code right now maybe you know how to

play00:45

code in python or Ruby or God forbid

play00:49

JavaScript I would say take that

play00:51

knowledge of programming and go and

play00:52

learn a language that gives you raw

play00:54

unfettered access to the memory of your

play00:57

process space and the language I

play00:58

recommend for that is the c programming

play01:00

language I know there's a lot of talk

play01:01

and I talk about this a lot on my

play01:02

YouTube channel if C is the appropriate

play01:05

language for the future when it comes to

play01:06

systems programming I think that rust

play01:09

eventually will take over for C we're

play01:11

not talking about that today in this

play01:12

video I want to talk about why C is the

play01:14

best language to learn with also we're

play01:16

not going to get into the holy war of

play01:18

whether or not C is a high or low-level

play01:20

language for the purposes of this video

play01:23

C is a low-level language discussed in

play01:25

the comments learning to code

play01:27

effectively in C forces you to learn

play01:30

effective memory management it forces

play01:32

you to learn how to write code that is

play01:34

bulletproof because if you don't the

play01:36

code will just inherently be unsafe

play01:38

there are lots of things you have to do

play01:40

in C to not leak memory to not give your

play01:42

code access to hackers and to not have

play01:45

the crash the code just crash whenever

play01:47

it runs the number one project I tell

play01:49

people to write when they're trying to

play01:51

learn to code maybe they know the

play01:52

language but don't have a project to go

play01:54

after is to write an HTTP server and I

play01:57

know that sounds fairly Advanced for

play01:58

somebody who may be new to a language

play02:00

but it will teach you not only the ins

play02:02

and outs of the HTTP RFC but a lot of

play02:05

really important things about

play02:07

programming for example when you're

play02:08

writing the HTTP parser you have to not

play02:10

only write the code that adheres to the

play02:12

RFC but then you also have to think of

play02:14

your code defensively you're going to be

play02:16

inprocessing and reading code from

play02:19

literally anybody on the internet you

play02:20

have to treat your code as if it's being

play02:22

attacked you have to code defensively

play02:24

writing an HTTP server will allow you to

play02:27

get really familiar with how to read the

play02:28

documentation of language you're not

play02:30

just going to know the networking stack

play02:32

off the top of your head you have to

play02:33

learn how to read Man pages read

play02:36

documentation and read how return values

play02:38

work in the language of your choosing I

play02:40

think learning C teaches you how

play02:42

computers work at a fairly high level so

play02:45

go and take your programming knowledge

play02:46

and learn a language like C as step one

play02:49

step two go learn an assembly variant

play02:52

I'm not saying you have to be some

play02:54

wizard who can just look at an assembly

play02:56

blob and tell you exactly what's going

play02:57

on as fast as possible I am saying that

play02:59

knowing an assembly variant and knowing

play03:02

how the CPU works at the instruction

play03:04

level gives you a really really good

play03:06

understanding of how your code is going

play03:08

to behave and also if you can look at a

play03:10

blob of c and figure out basically how

play03:13

it's going to happen under the hood in

play03:14

the CPU architecture it gives you a

play03:16

superpower in choosing what code you

play03:19

make and deciding how to design your

play03:21

code so that it performs better the best

play03:22

way you can learn assembly right now is

play03:24

by taking this snippet of C code and

play03:26

I'll put it in the description below and

play03:28

go and compile that in

play03:30

if you can object dump this piece of

play03:32

code go to the main function and in

play03:34

reverse engineer how it works you will

play03:36

learn the basic 101 of that CPU

play03:39

architecture and that will give you a

play03:40

significant advantage on how things work

play03:43

and number three once you've learned how

play03:45

to code in a low-l language once you've

play03:47

begin to understand when you write that

play03:49

low-l code what architecture code gets

play03:52

spit out by the compiler and generally

play03:54

how the architecture works I recommend

play03:56

learning the basics of reverse

play03:58

engineering now now this pays off in a

play04:00

number of ways one maybe your job is

play04:02

just a malware reverse engineer maybe

play04:04

you're a Bug Hunter looking for bugs and

play04:06

taking binaries apart or maybe you're

play04:08

just somebody who is looking at code and

play04:10

you can't figure out why it doesn't work

play04:12

learning the basics of reverse

play04:14

engineering will teach you fundamentally

play04:17

not only how things work but how things

play04:19

are engineered and what the final output

play04:22

of the compiler will be also when you do

play04:24

reverse engineering challenges typically

play04:26

they're all based around a specific

play04:29

thing that you should know or like a

play04:31

specific fact like maybe it has to do

play04:33

with the Trap flag in the Intel CPU or

play04:35

maybe it has to do with the global

play04:37

offset table all these challenges teach

play04:39

you a little thing that you can kind of

play04:41

put into your toolbox of knowledge that

play04:43

over time you'll just begin to H have a

play04:45

holistic picture of how binaries are how

play04:49

binaries are constructed in the Linux

play04:52

operating system for example and I

play04:53

highly recommend going to crack. one

play04:56

this is not sponsored this is not an ad

play04:57

it's just a website that I like where

play04:59

there are people who write reverse

play05:01

engineering challenges and you can

play05:02

download them run them on your computer

play05:04

run them in a VM because you have no

play05:06

idea if the code is mici or not um but I

play05:08

think these challenges are really cool

play05:10

and an easy and fast way to learn the

play05:13

skills of reverse engineering and

play05:15

ultimately one of the lowest level

play05:16

techniques and then finally actually

play05:18

number four secret bonus um I think that

play05:21

another way to get really good at low

play05:22

level stuff is to pick up a board to

play05:25

learn to write C on that board so this

play05:27

for example is an stm32 it's an

play05:30

arm-based board this is the stm32 F7

play05:33

nucleo if you can learn C if you then

play05:36

learn an assembly architecture if you

play05:38

can then get that c code to run on a

play05:41

specific architecture of microcontroller

play05:44

so again be it like an STM maybe an

play05:45

Arduino or risk vbo an esp32 something

play05:48

like that it will give you the ability

play05:50

to read a data sheet to understand how

play05:53

to interpret that data sheet and how to

play05:55

crossport your code to a board that can

play05:58

run somewhere else as Computing gets

play06:00

more advanced as computers get older and

play06:03

older and they get more technologically

play06:05

Superior as time goes on I feel like we

play06:08

lose touch with how CPUs work at a basic

play06:11

level I can literally take out my iPhone

play06:13

and access any information that I need

play06:16

to in the world and the whole Magic of

play06:18

what's going on we literally tricked

play06:20

rocks into thinking I think it's kind of

play06:22

lost on us so part of what I made this

play06:24

YouTube channel to do is to teach people

play06:26

and remind people that you know how

play06:29

computers work and to make sure that we

play06:31

have a cohort of people moving on into

play06:34

the future that once the gray beards of

play06:36

the world the line of TS of the world

play06:38

that built these systems move on and

play06:40

possibly pass away you know we have the

play06:42

second generation of low-l Architects

play06:45

that that know how CPUs work so if you

play06:47

think that's cool or you enjoyed this

play06:49

video or you want to be a part of that

play06:50

cohort hit that sub button really

play06:51

appreciate it and uh yeah we'll see you

play06:53

guys on the next video you can go check

play06:54

out this other video that I made about

play06:56

an interview question that I got asked

play06:57

it was really cool and it taught me a

play06:59

lot about how CPUs work you can go find

play07:01

that out right there see you guys

Rate This

5.0 / 5 (0 votes)

Étiquettes Connexes
Programación BajaSeguridad InformáticaAprende CEnsamblajeHTTP ServerReversa IngenieríaSTM32ArduinoMicrocontroladoresEducación Técnica
Besoin d'un résumé en anglais ?