## ExtBasic 11

Learn how to do code review

### Re: ExtBasic 11

@BhaaL

If you actually knew what you were talking about.. you would know he was right.

This is coming from the co-creator of the mission. No, the hash won't divide evenly by primes. If you modify the source of the mission to generate hashes, you'll notice that after a certain point the number won't be the logical product of the corresponding primes, sometimes even resulting in a negative hash. Smaller words and words containing letters lower in the alphabet fall under this limit and therefor could be solved by a logical method of division. For instance, lets use the word dickhead, since bhaal is being one. dickhead becomes 73018330

I wrote a program that divides the hash by prime numbers evenly until it becomes 1. It then outputs the converted combination of primes to a text file. hy.exe is a commandline calculator that supports decimals. If you would like I could supply a link to it.

@echo off
echo type hash
set /p hash=
set prime=0

:loop

if "%hash%"=="1" goto end
if "%prime%"=="0" set prime=2
if "%prime%"=="4" set prime=5
if "%prime%"=="6" set prime=7
if "%prime%"=="8" set prime=11
if "%prime%"=="12" set prime=13
if "%prime%"=="14" set prime=17
if "%prime%"=="18" set prime=19
if "%prime%"=="20" set prime=23
if "%prime%"=="24" set prime=29
if "%prime%"=="30" set prime=31
if "%prime%"=="32" set prime=37
if "%prime%"=="38" set prime=41
if "%prime%"=="42" set prime=43
if "%prime%"=="44" set prime=47
if "%prime%"=="48" set prime=53
if "%prime%"=="54" set prime=59
if "%prime%"=="60" set prime=61
if "%prime%"=="62" set prime=67
if "%prime%"=="68" set prime=71
if "%prime%"=="72" set prime=73
if "%prime%"=="74" set prime=79
if "%prime%"=="80" set prime=83
if "%prime%"=="84" set prime=89
if "%prime%"=="90" set prime=97
if "%prime%"=="97" set prime=101
if "%prime%"=="102" set prime=2

hy %hash% %prime% / > div.txt
for /f "delims= " %%a in (div.txt) do (set div=%%a
)
Echo %prime%
Echo %div%
Echo %hash%
if "%div:~0,1%"=="." goto notdiv
if "%div:~1,1%"=="." goto notdiv
if "%div:~2,1%"=="." goto notdiv
if "%div:~3,1%"=="." goto notdiv
if "%div:~4,1%"=="." goto notdiv
if "%div:~5,1%"=="." goto notdiv
if "%div:~6,1%"=="." goto notdiv
if "%div:~7,1%"=="." goto notdiv
if "%div:~8,1%"=="." goto notdiv
if "%div:~9,1%"=="." goto notdiv
if "%div:~10,1%"=="." goto notdiv
if "%div:~11,1%"=="." goto notdiv
if "%div:~12,1%"=="." goto notdiv
if "%div:~13,1%"=="." goto notdiv
if "%div:~14,1%"=="." goto notdiv
if "%div:~15,1%"=="." goto notdiv
:isdiv

if "%prime%"=="2" set alpha=a
if "%prime%"=="3" set alpha=b
if "%prime%"=="5" set alpha=c
if "%prime%"=="7" set alpha=d
if "%prime%"=="11" set alpha=e
if "%prime%"=="13" set alpha=f
if "%prime%"=="17" set alpha=g
if "%prime%"=="19" set alpha=h
if "%prime%"=="23" set alpha=i
if "%prime%"=="29" set alpha=j
if "%prime%"=="31" set alpha=k
if "%prime%"=="37" set alpha=l
if "%prime%"=="41" set alpha=m
if "%prime%"=="43" set alpha=n
if "%prime%"=="47" set alpha=o
if "%prime%"=="53" set alpha=p
if "%prime%"=="59" set alpha=q
if "%prime%"=="61" set alpha=r
if "%prime%"=="67" set alpha=s
if "%prime%"=="71" set alpha=t
if "%prime%"=="73" set alpha=u
if "%prime%"=="79" set alpha=v
if "%prime%"=="83" set alpha=w
if "%prime%"=="89" set alpha=x
if "%prime%"=="97" set alpha=y
if "%prime%"=="101" set alpha=z

set hash=%div%
:notdiv

set /a prime= %prime% + 1
goto loop

:end

This would output an anagram of the word dickhead.

So to bhaal, settle down man.. itll be okay     mutants_r_us_guild
Poster Posts: 246
Joined: Fri May 30, 2008 7:56 pm
Blog: View Blog (0)

### Re: ExtBasic 11

@mutants_r_us_guild; Don't fuel the fire.
shutdown -h 0 "Since when is death an option?"   xelix
Experienced User Posts: 52
Joined: Mon Oct 20, 2008 1:00 pm
Location: mv -f / /dev/null && shutdown -h 0 "You just lost the game."
Blog: View Blog (0)

### Re: ExtBasic 11

UBAL, try debugging the batch.
anonHacker
Experienced User Posts: 76
Joined: Sun Jul 27, 2008 10:51 am
Blog: View Blog (0)

### Re: ExtBasic 11

Not meant to be a hostile reply, just a slight hint in the right direction. Knowing that certain thing about it ("if he knew what he was doing"), he'd find out that he got a load of possibilities ("that this is not the only number that should work").

My apologies if anyone felt offended by that one.
BhaaL
Poster Posts: 270
Joined: Sun Apr 13, 2008 11:16 am
Blog: View Blog (0)

### Re: ExtBasic 11

Well that's good to hear... it always makes me angry to see someone on HTS talk to someone else like an they're an idiot. The point of HTS is to learn. You can't learn anything when people reply to your honest questions in a hostile manner. So I'm glad to hear someone of your stature hasn't sunk so low to assume a position of superiority.    mutants_r_us_guild
Poster Posts: 246
Joined: Fri May 30, 2008 7:56 pm
Blog: View Blog (0)

### Re: ExtBasic 11

Thanks for your replies guys and thanks for the hints and help.

Just saw them now. I will continue working on the challenges.

Thanks.
UBAL
New User Posts: 7
Joined: Sat Oct 04, 2008 11:49 am
Blog: View Blog (0)

### Re: ExtBasic 11

2 to the 32nd power will help you a lot here... google around and you'll find what you need to know.    mutants_r_us_guild
Poster Posts: 246
Joined: Fri May 30, 2008 7:56 pm
Blog: View Blog (0)

### Re: ExtBasic 11

I didn't want to make it that obvious in first place. For a challenge like this (where its all about that number), i tend to see it as "check robots.txt and look at the folder it forbids" rather than "wasn't there a file for web crawlers somewhere?".
BhaaL
Poster Posts: 270
Joined: Sun Apr 13, 2008 11:16 am
Blog: View Blog (0)

### Re: ExtBasic 11

well i havent told him the key word he needs to know, i just gave him some information to google for. The rest is up to him. Once he finds the name for the phenomenon that is occurring, he'll know what to do with that number.    mutants_r_us_guild
Poster Posts: 246
Joined: Fri May 30, 2008 7:56 pm
Blog: View Blog (0)

### Re: ExtBasic 11

Thanks for all the help! I had already modified your code to show the output after each run, but hadn't noticed the difference in outputs. So this really helped:

mutants_r_us_guild wrote:... you'll notice that after a certain point the number won't be the logical product of the corresponding primes, sometimes even resulting in a negative hash.

After that I realised why it didn't work and why my vb program couldn't work. So I made a "program" in batch file with your code embedded to find the password. And it just found it, so thanks a lot. It was a very good and educational challenge.

Still need extended 10 though, but I'm scouring the web for info on that.

But again, thx and great challenge.
UBAL
New User Posts: 7
Joined: Sat Oct 04, 2008 11:49 am
Blog: View Blog (0)

PreviousNext