Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
afdff344
Commit
afdff344
authored
Jan 13, 2016
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rt_bck_dump wasn't updated to new backupfile format
parent
18eb5a17
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
12 deletions
+38
-12
src/exe/rt_bck_dump/src/rt_bck_dump.c
src/exe/rt_bck_dump/src/rt_bck_dump.c
+38
-12
No files found.
src/exe/rt_bck_dump/src/rt_bck_dump.c
View file @
afdff344
...
...
@@ -47,20 +47,36 @@
int
main
(
int
argc
,
char
**
argv
)
{
pwr_tInt32
csts
;
char
filename
[
512
];
FILE
*
f
;
BCK_FILEHEAD_STRUCT
fh
;
BCK_CYCLEHEAD_STRUCT
ch
;
BCK_DATAHEAD_STRUCT
dh
;
bck_t_cycleheader
ch
;
bck_t_writeheader
dh
;
char
timstr
[
24
];
int
c
,
d
;
unsigned
char
*
datap
,
*
p
;
char
*
namep
;
int
i
;
/*
* Open file
*/
if
(
argc
>
1
&&
strcmp
(
argv
[
1
],
"-h"
)
==
0
)
{
printf
(
"\
\n
\
rt_bck_dump Dump content of backupfile in hex.
\n
\
\n
\
Argument: Name of backupfile.
\n
\
\n
\
Example
\n
\
> rt_bck_dump $pwrp_load/pwr_backup.bck
\n
\
\n
\
"
);
exit
(
0
);
}
if
(
argc
==
1
)
{
printf
(
"Name of backup file: "
);
scanf
(
"%s"
,
(
char
*
)
&
filename
);
...
...
@@ -126,23 +142,33 @@ int main (int argc, char **argv)
for
(
d
=
0
;
d
<
ch
.
segments
;
d
++
)
{
printf
(
"
\n
Data header %d:
\n
"
,
d
+
1
);
fread
(
&
dh
,
sizeof
dh
,
1
,
f
);
if
(
dh
.
namesize
>
0
)
{
namep
=
malloc
(
dh
.
namesize
+
1
);
csts
=
fread
(
namep
,
dh
.
namesize
+
1
,
1
,
f
);
}
else
namep
=
NULL
;
printf
(
" Valid: %x
\n
"
,
dh
.
valid
);
printf
(
" Dynamic: %x
\n
"
,
dh
.
dynamic
);
printf
(
" Class: %x
\n
"
,
dh
.
cid
);
printf
(
" Attrref.Vid: %x
\n
"
,
dh
.
attrref
.
Objid
.
vid
);
printf
(
" Attrref.Oix: %x
\n
"
,
dh
.
attrref
.
Objid
.
oix
);
printf
(
" Attrref.Offset: %x
\n
"
,
dh
.
attrref
.
Offset
);
printf
(
" Attrref.Body: %x
\n
"
,
dh
.
attrref
.
Body
);
printf
(
" Attrref.Size: %x
\n
"
,
dh
.
attrref
.
Size
);
printf
(
" Attrref.Indirect: %x
\n
"
,
dh
.
attrref
.
Flags
.
b
.
Indirect
);
printf
(
" Dataname: %s
\n
"
,
dh
.
dataname
);
printf
(
" Objid.Vid: %d
\n
"
,
dh
.
objid
.
vid
);
printf
(
" Objid.Oix: %d
\n
"
,
dh
.
objid
.
oix
);
//printf (" Attrref.Vid: %x\n", dh.attrref.Objid.vid);
//printf (" Attrref.Oix: %x\n", dh.attrref.Objid.oix);
//printf (" Attrref.Offset: %x\n", dh.attrref.Offset);
//printf (" Attrref.Body: %x\n", dh.attrref.Body);
//printf (" Attrref.Size: %x\n", dh.attrref.Size);
//printf (" Attrref.Indirect: %x\n", dh.attrref.Flags.b.Indirect);
if
(
namep
)
printf
(
" Name: %s
\n
"
,
namep
);
printf
(
" Size: %d
\n
"
,
dh
.
size
);
#ifdef NODATA
fseek
(
f
,
dh
.
attrref
.
Size
,
1
);
#else
datap
=
malloc
(
dh
.
attrref
.
Size
);
fread
(
datap
,
dh
.
attrref
.
Size
,
1
,
f
);
datap
=
malloc
(
dh
.
size
);
fread
(
datap
,
dh
.
size
,
1
,
f
);
p
=
datap
;
for
(
i
=
0
;
i
<
dh
.
attrref
.
S
ize
;
i
++
,
p
++
)
{
for
(
i
=
0
;
i
<
dh
.
s
ize
;
i
++
,
p
++
)
{
if
((
i
%
16
)
==
0
)
printf
(
"
\n
"
);
printf
(
"%02x "
,
*
p
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment