One Hat Cyber Team
Your IP :
216.73.217.15
Server IP :
157.15.65.100
Server :
Linux 157-15-65-100.cprapid.com 5.14.0-362.24.2.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Sat Mar 30 14:11:54 EDT 2024 x86_64
Server Software :
Apache
PHP Version :
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
cynet
/
data
/
src
/
View File Name :
file.c
// This program, and the other programs and scripts ("programs", "these programs") in this software directory/folder/repository ("repository") are published, developed and distributed for educational/research purposes only. I ("the creator") do not condone any malicious or illegal usage of these programs, as the intend is sharing research and not doing illegal activities with it. I am not legally responsible for anything you do with these programs. #include <stdlib.h> #include <fcntl.h> #include <stdio.h> #include <unistd.h> #include "file.h" // micro function (don't print "doing X..." status) // removes error checking boilerplate void write_file(const char *filename, const char *buf, size_t buflen, unsigned int flags) { int fd; fd = open(filename, O_WRONLY | O_CREAT | flags, 0755); if (fd < 0) { perror("open$write_file"); exit(EXIT_FAILURE); } if (write(fd, buf, buflen) != buflen) { perror("write$write_file"); exit(EXIT_FAILURE); } close(fd); } int read_file(const char *filename, void *buf, size_t buflen) { int fd; int retv; fd = open(filename, O_RDONLY); if (fd < 0) { perror("open$read_file"); exit(EXIT_FAILURE); } retv = read(fd, buf, buflen); if (retv < 0) { perror("read$read_file"); exit(EXIT_FAILURE); } close(fd); return retv; }