Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

Word Gatherer

Not long ago i was working on this script, for those who usually lurk this sub you should know that the help thread i made is related to this project.

The word gatherer works like the name says, it gathers every string of text in every text file located in the same folder as the batch or its subfolder. Then it puts it on a list, this list can later be used to crack encryptions through dictionary attack (for example).

Currentlly it works, but sometimes it crashes and i don't even know why. It also doesn't know where to end, repeating the process on the last sentence over and over again.
Feel Free to check it out and help me fix it if you want.
Code
@echo off
Setlocal EnableDelayedExpansion

set /a n=0
Findstr /I /S /P /R [a-z] *.txt>Grab.dic
:reset
set /a i=1

:Begin
if %n% GTR 0 (
  set SKIP=skip=%n%
) else (
  set SKIP=
)
for /f "%SKIP% tokens=2* delims=:" %%A in (Grab.dic) do (
set Line=%%A& goto Form1
)

:Form1
set /a n=%n%+1

IF Not defined Line goto Begin
call :getNumTokens "%Line%"

:Form2
For /f "tokens=%i% delims=*-()<>/=,.?:_ " %%B in ("%Line%") do (
echo %%B>>List.dic
)
@echo off
If %numTokens%==%i% goto reset
set /a i=%i%+1
goto Form2

:getNumTokens
    set numTokens=0
    set "textRemaining=%~1"
    :again
    for /f "tokens=1*" %%a in ("%textRemaining%") do (set /a numTokens+=1&& set "textRemaining=%%b")
    if "%textRemaining%" == "" goto :eof
    goto :again


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by AleksasNov 16, 2016 07:40 AM 2 141 Nov 16, 2016 07:40 AM
Last Post: Aleksas
[Shell] by nsevydSep 1, 2015 09:03 AM 9 307 Sep 1, 2015 09:03 AM
Last Post: Ventriloquism
[.NET] by KingDeath360Jan 19, 2015 03:51 PM 13 815 Jan 19, 2015 03:51 PM
Last Post: $lick