Jump to content











Photo
* * * * - 2 votes

PassPass - Bypass the Password


  • Please log in to reply
383 replies to this topic

#376 ner0

ner0

    Member

  • Members
  • 48 posts

Posted 04 December 2016 - 01:57 PM

I tested Chenall's version but auto-detection didn't work for me, it always returned "No Windows installation found!", twice.

Manually passing the disk and volume as arguments worked for patching options but booting from the menu wouldn't work either, giving the error "The selected disk does not exist". Not sure why auto-detection does not work.

 

EDIT: I think I'm starting to understand why it wasn't working, I must manually tell the script what is the max number of disks/partitions? This makes little sense to me, why isn't it determined programmatically? Or am I not understanding it correctly? What about this comment:

:: only checking the directory prefix with 'win'

If that really is the case, then why bother?


Edited by ner0, 04 December 2016 - 02:48 PM.


#377 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 December 2016 - 04:09 PM

Naaah, Chenall's version is a ("better" ;)) wenv-less version of the original PassPass by Holmes.Sherlock, some of the comments are left-overs from the latter version (and some are left-overs of previous experimental versions).

The "base" is the result of:
find --devices=h
If - for whatever reasons - the output of the above does not include your hard disk partition with the Windows install, it's game over.
Then the :autoloop calls the :findDLL for each device found and the :findDLL calls the :isWinDir for each directory in root of devices.
:unsure:

Maybe you have a peculiar setup? :dubbio:
Chenall version worked fine last time I tested it.

:duff:
Wonko

#378 ner0

ner0

    Member

  • Members
  • 48 posts

Posted 04 December 2016 - 04:38 PM

find --devices=h

returns two results:

(hd0,1)

(hd0,0)

 

(hd0,1)/Windows is where the OS is located, afaik there's nothing peculiar about it at all.

If I call the script with max hd and volume numbers then it will iterate through them and find it.



#379 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 December 2016 - 04:52 PM

(hd0,1)/Windows is where the OS is located, afaik there's nothing peculiar about it at all.

If I call the script with max hd and volume numbers then it will iterate through them and find it.


Yep, there is an exclusion for the boot drive, maybe that is the issue in your case:

if exist BOOTDEV goto :skipBoot
if "%?_BOOT:~0,4%"=="%dev:~0,4%" goto %0		## Prevents searching boot device

:duff:

Wonko



#380 ner0

ner0

    Member

  • Members
  • 48 posts

Posted 04 December 2016 - 04:58 PM

That's probably it, I was running the script from the same device and volume as Windows.

But I still don't understand how it iterates through folders. Does it go through all top level folders or just the ones that start with "win"?



#381 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 December 2016 - 05:21 PM

That's probably it, I was running the script from the same device and volume as Windows.

But I still don't understand how it iterates through folders. Does it go through all top level folders or just the ones that start with "win"?

All top level folders, it calls the :iswindir for all the output of  ls on the devices, one at the time:



ls %dllRoot%/ | call :isWinDir=

To easily check if that (boot device is the issue) re-map it to another device, *like*:

map (hd0) (hd2)

map --hook

before running the batch.

 

:duff:

 

Wonko



#382 steve6375

steve6375

    Platinum Member

  • Developer
  • 6461 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars
  •  
    United Kingdom

Posted 04 December 2016 - 06:28 PM

I have found that the routine which reads the version number one byte at a time can take several seconds using cat --length=1 each time.

The speed can be halved if we skip the 0 unicode byte by using an increment of 2 instead of 1

 

:fnext
if "%char%"=="." set version=%version%%%char%
set /a counter=%counter%+2 > nul
if "%counter%"=="30" goto :next
goto :loop


  • ner0 likes this

#383 ner0

ner0

    Member

  • Members
  • 48 posts

Posted 04 December 2016 - 06:32 PM

The speed can be halved if we skip the 0 unicode byte by using an increment of 2 instead of 1

 

Good idea!



#384 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 13329 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 04 December 2016 - 06:39 PM

Good idea!

Hey guys, the "best" (from the point of actual batch scripting) is obviously the version by Chenall (that though only checks for majmin, does skip 1,3,5), the new "base" should be IMHO that one.

Additionally, he uses a Temp location, using the 00 as "C terminator".

:: Only get majmin version
dd if=%file% of=%Temp% bs=1 skip=%offbase% count=32 > nul
cat --skip=1 %Temp% | set majmin=
cat --skip=3 %Temp% | set majmin=%majmin%
cat --skip=5 %Temp% | set majmin=%majmin%

This should be the "full version" loop using the same technique:

:: Get full version
dd if=%file% of=%Temp% bs=1 skip=%offbase% count=32 > nul
set /a counter=1 > nul
set majmin3=
:version_loop
cat --skip=%counter% %Temp% | set majmin3=%majmin3%
if "%majmin3:~-1,1%"==" " set majmin3=%majmin3:~0,-1% && goto :outofloop
set /a counter=%counter%+2 > nul
goto :version_loop

:outofloop

:duff:

Wonko






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users