Updated to match new setfold.sh.

committer: mfx <mfx> 962042492 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2000-06-26 18:01:32 +00:00
parent aba09d07c9
commit 957ef351c4

View File

@ -29,11 +29,15 @@ $fname = shift || die;
sysopen (FH,$fname,2) || die;
binmode FH;
$fsize = (stat($fname))[7];
$val = shift || die "$val";
###print STDERR "$val\n";
$val = oct($val); # acutally hex()
###print STDERR "$val\n";
die unless $val;
$val = $val & 0xfff;
printf STDERR "$fname: setting fold to 0x%x, file size 0x%x\n", $val, $fsize;
die unless $val > 0;
die unless $val < $fsize;
$num = pack("V", $val);
# 0x34 = sizeof(Elf32_Ehdr)