Exploit database

GH-82fcde8452b83c6e8e00a0612704e4ef

fullmetal5/str2hax

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2009-0689

13 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files20
fullmetal5/str2haxRevision 44b0eda1fc8a

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

loader/font2c.pl

Perl · 943 bytes
#!/usr/bin/perl


# Read PPM file.

$sig = <>; chomp $sig;
$sizes = <>; chomp $sizes;
$cols = <>; chomp $cols;

{
	local $/;
	$data = <>;
}


# Sanity check.

$sig ne "P6" and die;
$sizes ne "90 256" and die;
$cols ne "255" and die;
(length $data) != 3 * 90 * 256 and die;


# Output header.

print "// GENERATED FILE DO NOT EDIT\n";
print "\n";
print "#include \"loader.h\"\n";
print "\n";
print "const u8 console_font_10x16x4[96*80] = {\n";

# Output data.

for my $ch (2..7) {
	for my $cl (0..15) {
		printf "\n\t// %x%x\n", $ch, $cl;
		for my $py (0..15) {
			print "\t";
			for my $px (0..9) {
				my $hor = $px + 10*($ch - 2);
				my $ver = $py + 16*$cl;
				my $wot = $hor + 90*$ver;
				my $bytes = substr($data, 3*$wot, 3);
				my $nyb = int ((ord $bytes) / 16);
				if (($px & 1) == 0) {
					printf "0x%x", $nyb;
				} else {
					printf "%x,", $nyb;
				}
			}
			print "\n";
		}
	}
}


# Output footer.

print "\n";
print "};\n";