06/18/2026
chastext 64-bit
I have converted my chastext program to 64 bit Assembly for Linux. Next to chastehex, this is the program I am most proud of because it can find and replace exact strings of text. It isn't quite the same as the Linux "sed" tool, but it is faster, smaller, and I wrote it myself and can do whatever I want with it. So of course what I did was write shell script to show what it is capable of! main.asm ;Linux 64-bit Assembly Source for chastext ;a basic text search and replace program format ELF64 executable entry main include 'chastelib64.asm' main: pop rax mov ,rax ;save the argument count for later cmp qword ,1 ja help_skip ;if more than 1 argument is given, skip the help message and process the other arguments help: mov rax,help_message call putstring jmp main_end help_skip: pop rax ;pop the next arg which is the name of the program we are running get_filename: pop rax ;pop the next arg which is the name of the file we will open mov ,rax ; save the name of the file we will open to read arg_open_file: ;Linux system call to open a file mov rsi,0 ;open file in read only mode mov rdi,rax ;filename should be in rax before this function was called mov rax,2 ;invoke SYS_OPEN (kernel opcode 2 on 64 bit systems) syscall ;call the kernel cmp rax,0 jns file_open_no_errors ;if rax is not negative/signed there was no error ;Otherwise, if it was signed, then this code will display an error message....
I have converted my chastext program to 64 bit Assembly for Linux. Next to chastehex, this is the program I am most proud of because it can find and replace exact strings of text. It isn’t qu…