This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.
JavaScript algorithmsartificial-intelligencebugbountycryptographycyber-threat-intelligencecybersecurity-projectsethical-hackinghacking-toolsmalwarenessusnetwork-monitoringnetwork-securitynmapportscannerpythonpythonprojectsthreat-intelligencevirus-scanning
Code
section .data
section .bss
buffer resb 1 ; Allocate 1 byte for the buffer
section .text
global _start
_start:
nop ; No operation (placeholder)
mov_immediate_data_to_register:
mov eax, 100 ; Move immediate value 100 into the EAX register
mov byte [buffer], 0x50 ; Move immediate value 0x50 into the memory location "buffer"
exit:
mov eax, 1 ; syscall: exit
mov ebx, 0 ; exit code 0
int 0x80 ; Call Linux kernel to exit
Key Notes:
resbDirective:resballocates uninitialized space in the.bsssection.- In your code,
buffer resblacks a size. Specify the number of bytes needed (e.g.,buffer resb 1for 1 byte).
Instruction Explanation:
mov eax, 100: Moves the immediate value100(decimal) into the EAX register.mov byte [buffer], 0x50: Moves the immediate value0x50(hexadecimal) into the buffer memory location. Thebytekeyword specifies the size of the move (8-bit).
Syscall:
- The
int 0x80interrupt is used for system calls in Linux (deprecated in modern x86-64, but still functional in x86). eax = 1: Indicates the sys_exit syscall.ebx = 0: Specifies the exit code.
- The
NOP Instruction:
- The
nopinstruction does nothing. It's typically used for alignment or as a placeholder during debugging.
- The
Assembly Workflow:
Assemble: Use
nasmto assemble the code into an object file.nasm -f elf32 program.asm -o program.oLink: Use
ldto link the object file into an executable.ld -m elf_i386 program.o -o programRun: Execute the program.
./program
Expected Behavior:
- The program sets
eaxto100and stores0x50in thebufferlocation. - Afterward, it exits with code
0.