summaryrefslogtreecommitdiffstats
path: root/src/godmode.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-07-21 18:34:14 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2014-07-21 18:34:14 +0200
commit179ddff52b82753def3b15d38b3f8a18173e46d7 (patch)
treec9de57cba617a4aa89c223ec7a36205fdafe0d28 /src/godmode.c
parente6b99a902be42a0da234cbe90d5a4bac633175b7 (diff)
Dsplay number of sectors as long long unsigned integer
Diffstat (limited to 'src/godmode.c')
-rw-r--r--src/godmode.c44
1 files changed, 33 insertions, 11 deletions
diff --git a/src/godmode.c b/src/godmode.c
index af2b6f2..de30f19 100644
--- a/src/godmode.c
+++ b/src/godmode.c
@@ -514,6 +514,7 @@ static void search_NTFS_from_backup(disk_t *disk_car, list_part_t *list_part, co
}
typedef enum { INDSTOP_CONTINUE=0, INDSTOP_STOP=1, INDSTOP_SKIP=2, INDSTOP_QUIT=3 } indstop_t;
+
static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_org, const int verbose, const int dump_ind, const int fast_mode, char **current_cmd)
{
unsigned char *buffer_disk;
@@ -570,15 +571,36 @@ static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_o
CHS_t start;
offset2CHS_inline(disk_car,search_location,&start);
#ifdef HAVE_NCURSES
- if(old_cylinder!=start.cylinder &&
- (disk_car->geom.heads_per_cylinder>1 || (start.cylinder & 0x7FFF)==0))
+ if(disk_car->geom.heads_per_cylinder>1)
+ {
+ if(old_cylinder!=start.cylinder)
+ {
+ old_cylinder=start.cylinder;
+ wmove(stdscr,ANALYSE_Y,ANALYSE_X);
+ wclrtoeol(stdscr);
+ wprintw(stdscr,"Analyse cylinder %5u/%u: %02u%%",
+ start.cylinder, disk_car->geom.cylinders-1,
+ (unsigned int)(search_location*100/disk_car->disk_size));
+ wrefresh(stdscr);
+ switch(check_enter_key_or_s(stdscr))
+ {
+ case 1:
+ ind_stop=INDSTOP_STOP;
+ break;
+ case 2:
+ ind_stop=INDSTOP_SKIP;
+ break;
+ }
+ }
+ }
+ else if((start.cylinder & 0x7FFF)==0)
{
- old_cylinder=start.cylinder;
wmove(stdscr,ANALYSE_Y,ANALYSE_X);
wclrtoeol(stdscr);
- wprintw(stdscr,"Analyse cylinder %5u/%u: %02u%%",
- start.cylinder, disk_car->geom.cylinders-1,
- (unsigned int)((uint64_t)start.cylinder*100/disk_car->geom.cylinders));
+ wprintw(stdscr,"Analyse sector %11llu/%lu: %02u%%",
+ search_location / disk_car->sector_size,
+ (disk_car->disk_size-1)/disk_car->sector_size,
+ (unsigned int)(search_location*100/disk_car->disk_size));
wrefresh(stdscr);
switch(check_enter_key_or_s(stdscr))
{
@@ -872,11 +894,11 @@ static list_part_t *search_part(disk_t *disk_car, const list_part_t *list_part_o
free(new_partition);
}
if(verbose>0)
- log_warning("This partition ends after the disk limits. (start=%lu, size=%lu, end=%lu, disk end=%lu)\n",
- (unsigned long)(partition->part_offset/disk_car->sector_size),
- (unsigned long)(partition->part_size/disk_car->sector_size),
- (unsigned long)(pos_fin/disk_car->sector_size),
- (unsigned long)(disk_car->disk_size/disk_car->sector_size));
+ log_warning("This partition ends after the disk limits. (start=%llu, size=%llu, end=%llu, disk end=%llu)\n",
+ (unsigned long long)(partition->part_offset/disk_car->sector_size),
+ (unsigned long long)(partition->part_size/disk_car->sector_size),
+ (unsigned long long)(pos_fin/disk_car->sector_size),
+ (unsigned long long)(disk_car->disk_size/disk_car->sector_size));
else
log_warning("This partition ends after the disk limits.\n");
}