Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sub generate_payloads
- {
- # OMG THIS PART WAS ANNOYING TO CREATE!
- my %hash;
- # Yes this count is necessary Luke, don't delete it again!
- my $count = '0';
- foreach my $i (@characters_array)
- {
- $hash{$count} = \@{$i};
- $count++
- }
- my @keys = sort keys %hash;
- my @test_array;
- # product { my $test_string = join(',', map {"$_[$_]"} 0 .. $#keys), "\n"; push @test_array, $test_string } @hash { @keys };
- product { my $test_string = join(',', map {"$_[$_]"} 0 .. $#keys), "\n"; push @test_array, $test_string } @hash { @keys };
- # Probably extremely slow but this is the only way i could think of doing this, if anyone knows better send it to me.
- # $temp_payload =~ s{ (?: , [^,]*){$j} \K , }{$middle}xeg;
- print "@middle_marker_locations\n";
- foreach my $i (@test_array)
- {
- my @temp_payload = split(',', $i);
- my @temp_payload_2;
- my $count = 0;
- foreach my $j (@temp_payload)
- {
- print "$count\n";
- if ( $count ~~ @middle_marker_locations )
- {
- push @temp_payload_2, $middle;
- push @temp_payload_2, $j;
- $count++;
- }
- else
- {
- push @temp_payload_2, $j;
- $count++;
- }
- }
- my $payload = join('', map { "$_" } @temp_payload_2);
- my $payload = $prefix . $payload . $suffix;
- push @payloads, $payload;
- }
- foreach my $j (@payloads)
- {
- print "$j\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement