Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Sleuthkit
Commits
ad2f6767
Commit
ad2f6767
authored
14 years ago
by
Brian Carrier
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some RAW CD issues and added offset of 24 bytes to choices
parent
5d53e055
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tsk3/fs/fs_io.c
+58
-14
58 additions, 14 deletions
tsk3/fs/fs_io.c
tsk3/fs/iso9660.c
+7
-0
7 additions, 0 deletions
tsk3/fs/iso9660.c
xcode/sleuthkit.xcodeproj/project.pbxproj
+1
-0
1 addition, 0 deletions
xcode/sleuthkit.xcodeproj/project.pbxproj
with
66 additions
and
14 deletions
tsk3/fs/fs_io.c
+
58
−
14
View file @
ad2f6767
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
ssize_t
ssize_t
tsk_fs_read
(
TSK_FS_INFO
*
a_fs
,
TSK_OFF_T
a_off
,
char
*
a_buf
,
size_t
a_len
)
tsk_fs_read
(
TSK_FS_INFO
*
a_fs
,
TSK_OFF_T
a_off
,
char
*
a_buf
,
size_t
a_len
)
{
{
TSK_OFF_T
off
;
TSK_OFF_T
off
=
0
;
// do a sanity check on the read bounds, but only if the block
// do a sanity check on the read bounds, but only if the block
// value has been set.
// value has been set.
...
@@ -61,15 +61,40 @@ tsk_fs_read(TSK_FS_INFO * a_fs, TSK_OFF_T a_off, char *a_buf, size_t a_len)
...
@@ -61,15 +61,40 @@ tsk_fs_read(TSK_FS_INFO * a_fs, TSK_OFF_T a_off, char *a_buf, size_t a_len)
}
}
off
=
a_off
+
a_fs
->
offset
;
off
=
a_off
+
a_fs
->
offset
;
if
(((
a_fs
->
block_pre_size
)
||
(
a_fs
->
block_post_size
))
&&
(
a_fs
->
block_size
))
{
if
(((
a_fs
->
block_pre_size
)
||
(
a_fs
->
block_post_size
))
&&
(
a_fs
->
block_size
))
{
TSK_DADDR_T
blk
=
a_off
/
a_fs
->
block_size
;
TSK_OFF_T
cur_off
=
a_off
;
if
(
a_fs
->
block_pre_size
)
ssize_t
retval
=
0
;
off
+=
((
blk
+
1
)
*
a_fs
->
block_pre_size
);
TSK_OFF_T
end_addr
=
a_off
+
a_len
;
if
(
a_fs
->
block_post_size
)
off
+=
(
blk
*
a_fs
->
block_post_size
);
}
return
tsk_img_read
(
a_fs
->
img_info
,
off
,
a_buf
,
a_len
);
// we need to read block by block so that we can skip the needed pre and post bytes
while
(
cur_off
<
end_addr
)
{
TSK_DADDR_T
blk
=
cur_off
/
a_fs
->
block_size
;
TSK_OFF_T
read_off
=
off
;
ssize_t
retval2
=
0
;
size_t
read_len
=
a_fs
->
block_size
-
cur_off
%
a_fs
->
block_size
;
if
(
read_len
+
cur_off
>
end_addr
)
read_len
=
end_addr
-
cur_off
;
if
(
a_fs
->
block_pre_size
)
read_off
+=
((
blk
+
1
)
*
a_fs
->
block_pre_size
);
if
(
a_fs
->
block_post_size
)
read_off
+=
(
blk
*
a_fs
->
block_post_size
);
retval2
=
tsk_img_read
(
a_fs
->
img_info
,
read_off
,
&
a_buf
[
retval
],
read_len
);
if
(
retval2
==
-
1
)
return
-
1
;
else
if
(
retval2
==
0
)
break
;
retval
+=
retval2
;
cur_off
+=
retval2
;
}
return
retval
;
}
else
{
return
tsk_img_read
(
a_fs
->
img_info
,
off
,
a_buf
,
a_len
);
}
}
}
...
@@ -114,12 +139,31 @@ tsk_fs_read_block(TSK_FS_INFO * a_fs, TSK_DADDR_T a_addr, char *a_buf,
...
@@ -114,12 +139,31 @@ tsk_fs_read_block(TSK_FS_INFO * a_fs, TSK_DADDR_T a_addr, char *a_buf,
PRIuDADDR
")"
,
a_addr
);
PRIuDADDR
")"
,
a_addr
);
return
-
1
;
return
-
1
;
}
}
off
=
a_fs
->
offset
+
(
TSK_OFF_T
)
(
a_addr
)
*
a_fs
->
block_size
;
if
((
a_fs
->
block_pre_size
==
0
)
&&
(
a_fs
->
block_post_size
==
0
))
{
return
tsk_img_read
(
a_fs
->
img_info
,
off
,
a_buf
,
a_len
);
}
else
{
size_t
i
;
ssize_t
retval
=
0
;
for
(
i
=
0
;
i
<
a_len
;
i
++
)
{
ssize_t
retval2
;
TSK_OFF_T
off2
=
off
+
i
*
a_fs
->
block_size
;
off
+=
((
a_addr
+
1
)
*
a_fs
->
block_pre_size
);
off
+=
(
a_addr
*
a_fs
->
block_post_size
);
retval2
=
tsk_img_read
(
a_fs
->
img_info
,
off2
,
&
a_buf
[
retval
],
a_fs
->
block_size
);
if
(
retval2
==
-
1
)
return
-
1
;
else
if
(
retval2
==
0
)
break
;
retval
+=
retval2
;
}
return
retval
;
}
off
=
a_fs
->
offset
+
(
TSK_OFF_T
)
a_addr
*
a_fs
->
block_size
;
if
(
a_fs
->
block_pre_size
)
off
+=
((
a_addr
+
1
)
*
a_fs
->
block_pre_size
);
if
(
a_fs
->
block_post_size
)
off
+=
(
a_addr
*
a_fs
->
block_post_size
);
return
tsk_img_read
(
a_fs
->
img_info
,
off
,
a_buf
,
a_len
);
}
}
This diff is collapsed.
Click to expand it.
tsk3/fs/iso9660.c
+
7
−
0
View file @
ad2f6767
...
@@ -2154,6 +2154,13 @@ load_vol_desc(TSK_FS_INFO * fs)
...
@@ -2154,6 +2154,13 @@ load_vol_desc(TSK_FS_INFO * fs)
fs
->
block_post_size
=
304
-
fs
->
block_pre_size
;
fs
->
block_post_size
=
304
-
fs
->
block_pre_size
;
goto
ISO_RETRY_MAGIC
;
goto
ISO_RETRY_MAGIC
;
}
}
else
if
(
fs
->
block_pre_size
==
16
)
{
if
(
tsk_verbose
)
tsk_fprintf
(
stderr
,
"Trying RAW ISO9660 with 24-byte pre-block size
\n
"
);
fs
->
block_pre_size
=
24
;
fs
->
block_post_size
=
304
-
fs
->
block_pre_size
;
goto
ISO_RETRY_MAGIC
;
}
else
{
else
{
fs
->
block_pre_size
=
0
;
fs
->
block_pre_size
=
0
;
fs
->
block_post_size
=
0
;
fs
->
block_post_size
=
0
;
...
...
This diff is collapsed.
Click to expand it.
xcode/sleuthkit.xcodeproj/project.pbxproj
+
1
−
0
View file @
ad2f6767
...
@@ -512,6 +512,7 @@
...
@@ -512,6 +512,7 @@
isa
=
PBXProject
;
isa
=
PBXProject
;
buildConfigurationList
=
026FB3840D19C831000434C7
/* Build configuration list for PBXProject "sleuthkit" */
;
buildConfigurationList
=
026FB3840D19C831000434C7
/* Build configuration list for PBXProject "sleuthkit" */
;
compatibilityVersion
=
"Xcode 2.4"
;
compatibilityVersion
=
"Xcode 2.4"
;
developmentRegion
=
English
;
hasScannedForEncodings
=
0
;
hasScannedForEncodings
=
0
;
knownRegions
=
(
knownRegions
=
(
English
,
English
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment