- memory optimizations
- memory optimizations
git-svn-id: https://siedziba.pl:790/svn/repos/dbxrecover@229 455248ca-bdda-0310-9134-f4ebb693071a
diff --git a/dbxrecover b/dbxrecover
index 7ce528a..c6915d2 100755
--- a/dbxrecover
+++ b/dbxrecover
@@ -179,8 +179,6 @@ use strict;
# it also helps in cases when there are dbx files contained inside dbx
$self->{file}->seek($chunksize, 1);
- $self->{hash} = undef;
- ($self->{id}, $self->{chunksize}, $self->{datasize}, $self->{next}) = ($id, $chunksize, $datasize, $next);
bless ($self, $class);
return $self;
}
@@ -215,22 +213,23 @@ use strict;
sub data
{
my $self = shift;
+ my $datasize = unpack("V", substr($self->{header}, 8, 4));
my $data;
$self->{file}->setpos($self->{filepos});
- $self->{file}->read($data, $self->{datasize});
+ $self->{file}->read($data, $datasize);
return $data;
}
sub id
{
my $self = shift;
- return $self->{id};
+ return scalar unpack("V", $self->{header});
}
sub next
{
my $self = shift;
- return $self->{next};
+ return scalar unpack("V", substr($self->{header}, 12, 4));
}
}