Binary, Hex, மற்றும் Data Units விளக்கப்பட்டுள்ளது
Programming, networking, மற்றும் forensics வேலையில் பயன்படுத்தப்படும் binary, hexadecimal, மற்றும் data unit conventions-ன் ஒரு நடைமுறை சொற்களஞ்சியம்.
Hex editorல் நீங்கள் inspect செய்யும் ஒவ்வொரு byte-ம், நீங்கள் calculate செய்யும் ஒவ்வொரு subnet maskம், ஒரு tool report செய்யும் ஒவ்வொரு file sizeம் ஒரு சிறிய number systems மற்றும் unit conventions-ன் set-ஐ சார்ந்துள்ளது. இவற்றை தவறாக புரிந்துகொண்டால், நீங்கள் ஒரு buffer size-ஐ misjudge செய்வீர்கள், ஒரு memory dump-ஐ misread செய்வீர்கள், அல்லது 1 KB 1000 bytes-ஆ 1024 bytes-ஆ என்பது குறித்து ஒரு colleague-ன் உடன் வாதாடுவீர்கள்.
Binary: computer உண்மையில் பேசும் base
Binary base 2 — 0 மற்றும் 1 மட்டுமே. ஒற்றை binary digit ஒரு bit ஆகும். 8 bits-ஐ ஒன்றாக group செய்தால் நீங்கள் ஒரு byte-ஐ பெறுகிறீர்கள், இது 256 distinct values-ஐ represent செய்ய முடியும் (0 முதல் 255 வரை unsigned, அல்லது -128 முதல் 127 வரை signed two's complement).
நீங்கள் 01001000 என்பதைக் கண்டால், அது decimal-ல் 72, இது 'H'-க்கான ASCII code-க்கு ஆகிறது. Hand-ல் converting என்பது rightmost bit-இலிருந்து 2 powers-ஐ summing செய்வது மட்டுமே: 2^6 + 2^3 = 64 + 8 = 72. python3 -c "print(bin(72))" அல்லது ஒரு file-ல் xxd போன்ற tools இதை instantly செய்யும், ஆனால் நீங்கள் ஒரு bitmask-ஐ reverse engineer செய்கிறபோது அல்லது TCP header-ல் flag values-ஐ வேலை செய்யும்போது mathematics புரிந்துகொள்வது முக்கியமாகும்.
Hexadecimal: binary-ன் shorthand
Hex base 16, 0-9 மற்றும் A-F-ஐ பயன்படுத்துகிறது. Binary scale-ல் unreadable ஆக இருப்பதாலும் decimal byte boundaries-க்கு cleanly map செய்யாமல் இருப்பதாலும் இது உள்ளது. ஒரு hex digit சரியாக 4 bits-ஐ represent செய்கிறது, எனவே இரண்டு hex digits ஒரு full byte-ஐ represent செய்கிறது — 0x00 முதல் 0xFF வரை wasted space இல்லாமல் 256 byte values-ஐ cover செய்கிறது.
ஆதாலே hex dumps xxd, hexdump -C, அல்லது ஒரு disassembler-ன் memory view-ல் default ஆக இருக்கிறது. நீங்கள் ஒரு file-ன் start-ல் 0x4D 0x5A என்பதைக் கண்டால், அது Windows PE executable-ஐ identify செய்யும் MZ header ஆகும். Memory addresses, color codes (#FF5733), MAC addresses, மற்றும் IPv6 addresses-ஐ conventionally hex-ல் எழுதப்படுகிறது ஏனெனில் இது underlying byte மற்றும் nibble structure-க்கு so cleanly map செய்கிறது.
Hex-ஐ decimal-ஆக converting செய்யுங்கள்: 0x4D = (4 × 16) + 13 = 77. Python-ல், int('4D', 16) hand math இல்லாமல் உங்களை அங்கே கொண்டு செல்கிறது, மற்றும் hex(77) மற்ற way-க்கு செல்கிறது.
Binary, decimal, மற்றும் hex உண்மையில் practice-ல் meet செய்யும் இடம்
IP addresses என்பது மூன்று வகையிலும் colliding-ன் ஒரு நல்ல உதாரணம். 192.168.1.1 போன்ற IPv4 address உண்மையில் நான்கு bytes ஆகும்: binary-ல் 11000000.10101000.00000001.00000001, அல்லது hex-ல் C0.A8.01.01. Subnetting math — இரண்டு addresses ஒரே networkக்கு இருக்கிறதா என்பதை figure out செய்வது — fundamentally ஒரு subnet mask-க்கு எதிரான binary AND operations ஆக இருக்கிறது, எனினும் நாம் convenience-க்கு dotted decimal-ல் எல்லாவற்றையும் எழுதுகிறோம்.
Digital forensics மற்றும் malware analysis-ல், நீங்கள் constantly இந்த representations-களுக்கு இடையே translate செய்கிறீர்கள். ஒரு disassembler hex-ல் opcodes-ஐ காட்டுகிறது, ஆனால் CPU raw binary-ஐ execute செய்கிறது, மற்றும் register values context-ஐ சார்ந்து often decimal offsets அல்லது ASCII strings-ஆ interpret செய்யப்படுகிறது. 0x41 65 என்ற number ஆக இருப்பதாகவும் ASCII character 'A'-ஆக இருப்பதாகவும் தெரிந்து கொள்வது manual analysis-ஐ considerably speed up செய்யும் pattern recognition-ன் வகை ஆகும்.
Data units: 1000 vs 1024 problem
இதுதான் மக்கள் உண்மையில் affected ஆகிறார்கள். Storage manufacturers, filesystems, மற்றும் operating systems always agree செய்யாமல் இருக்கிறது ஒரு
AI உதவியுடன் எழுதப்பட்டது, Michal Pilch (CISSP), Korra Studio ஆல் மறுஆய்வு செய்யப்பட்டு வெளியிடப்பட்டது.
இது Korra Studio அறிவுத் தளத்தில் இருந்து ஒரு குறிப்பு — மேடை ஒவ்வொரு தலைப்பையும் 1-க்கு-1 மாற்றுச் சொற்களுடன் இணைக்கிறது.
இலவசமாக தொடங்கவும்arrow_forward