Posts

Showing posts with the label Computer

Understanding Executable File Modification and Protection

Image
1. Executable File Structure We have already examined the structure of executable files through the following topic. How an Executable File Operates Just like document files are organized in a defined format, executable files also have a similar structured format. Among their components, the machine code in the .text section is loaded and executed . 2. Modifying an Executable File This means that by directly modifying the machine code stored in the .text section , the execution behavior of a program can be changed. Using this characteristic, it is possible to alter the execution result without modifying the program source code. 2.1. bin to hex Use the xxd command to convert an executable file into a text-based hex file. $ objdump -d -M intel add Disassembly of section .text: 0000000000401000 <_start>: 40...

How an Executable File Operates

Image
1. Assembly The machine language understood by the CPU is binary code . Assembly expresses machine language in human-readable mnemonic instructions. Therefore, the programming language most similar to machine code is Assembly . To understand how machine code is executed, we will examine a simple Assembly program. The following Assembly code performs the operation of printing the result of "2 + 3". ; Ubuntu 24.04 x86-64 (NASM, ELF64) section .data msg db "result: " msg_len equ $ - msg newline db 0x0a section .bss buf resb 1 section .text global _start _start: mov al, 2 add al, 3 mov bl, al mov rax, 1 mov rdi, 1 mov rsi, msg mov rdx, msg_len syscall mov al, bl add al, '0' mov [buf], al mov rax, 1 mov rdi, 1 mov rsi, buf mov rdx, 1 syscall mov rax, 1 mov rdi, 1...

Computer Operations Explained with Gate Circuits

Image
1. Computer A computer is a machine that performs calculations. But how does it actually carry them out? A computer performs logical and arithmetic operations using " Gate Circuit "s made up of numerous transistors. 2. Operation 2.1. Basic When current flows ( ON ), the light bulb turns on, and when it does not flow ( OFF ), it turns off. 👉  circuitjs-basic ※ In actual physics, the electrons that create electric current move from (–) to (+) . However, before electrons were known to exist, Franklin defined electric charge as moving from (+) to (–), and that convention remained in use for a long time. As a result, even today, the direction of current is conventionally described as flowing from (+) to (–). 2.2. Transistor A Semiconductor can either allow electricity to flow or block it. One representative example is the Transistor , which uses this property of semiconductors to control the flow of current . 👉  circuitjs-transi...

Understanding How Computers Work with 0s and 1s

Image
1. ON/OFF When electricity flows through a light bulb, the bulb turns ON . When no electricity flows, the bulb turns OFF . In the same way, computers use the binary system (Binary), where ON is represented as 1 and OFF as 0. 1.1. Bit and Byte The smallest unit used to represent values with 0 and 1 is called a bit . (0 or 1) 8 bits make up 1 byte, and 1 byte is the basic unit used to represent a character. 1.2. Char 8 bits, or 1 byte, are used to represent English (ASCII) characters as a char . When representing code, binary values such as "00010001" are long and difficult to read. For this reason, hexadecimal notation such as "0x11" , which can express 8 bits (1 byte) in two digits, is commonly used.       [Source] Computer Architecture - The ASCII character representations 1.3. Code Just as characters are defined using binary code, executable code is also defined in binary form. The CPU operates based on machine language ( Assembly ), and t...