Luigi Auriemma

aluigi.org (ARCHIVE-ONLY FORUM!)
It is currently 19 Jul 2012 13:46

All times are UTC [ DST ]





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 
Author Message
 Post subject: [HELP] SteamPWD
PostPosted: 06 Mar 2009 04:42 

Joined: 06 Mar 2009 04:34
Posts: 4
I want to be able to open the file, and not have to choose the .blob file myself. Is there any way to open SteamPWD and have it choose automatically?

can i just add this \\ClientRegistry.blob to Software\\Valve\\Steam\\ and have it work? without having to choose the file?


[code]"Software\\Valve\\Steam\\ClientRegistry.blob", "SteamPath",
steampath, sizeof(steampath));
if(steampath[0]) {
for(p = steampath; *p; p++) {
if(*p == '/') *p = '\\';
}
}
fname = get_file(steampath);
} else
#endif


Top
 Profile  
 
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 06 Mar 2009 14:13 

Joined: 24 Sep 2007 02:12
Posts: 1114
Location: http://sethioz.co.uk
if you want it to work in all computers, then no. well it should work with the path if it is installed into default path, but for example my steam is in C:/Games/Steam


Top
 Profile  
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 06 Mar 2009 15:22 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
to automatically load clientregistry.blob it's enough that you substituite "fname = get_file(steampath);" with the following line:

fname = strcat(steampath, "\\ClientRegistry.blob");


Top
 Profile  
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 07 Mar 2009 01:27 

Joined: 06 Mar 2009 04:34
Posts: 4
Luigi do i just replace the code that you've fixed? and i've been having errors compiling is there any compiler you prefer? with all the files i need? Thanks a bunch. Haven't seen anyone so devoted in helping other people!

edit: Luigi if you don't mind just compiling it for me then thanks, but if you want me to learn then thanks too : )


Top
 Profile  
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 07 Mar 2009 01:52 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
practically after the modification that part of the code must look like:
Code:
...
            if(steampath[0]) {
                for(p = steampath; *p; p++) {
                    if(*p == '/') *p = '\\';
                }
            }
            //fname = get_file(steampath);
            fname = strcat(steampath, "\\ClientRegistry.blob");
        } else
#endif
I use Mingw as compiler:
http://www.mingw.org/wiki/HOWTO_Install ... iler_Suite
or the the most recent build http://www.tdragon.net/recentgcc/

about compiling is better if you do it by yourself because is bad to be dependent by someone else, in any field.


Top
 Profile  
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 07 Mar 2009 02:14 

Joined: 06 Mar 2009 04:34
Posts: 4
Thanks for the quick response, i don't know how to use mingc ...i'll try


edit: looks about right?
Code:
  fputs("\n"
        "Steam password decoder "VER"\n"
        "by Luigi Auriemma\n"
        "e-mail: aluigi@autistici.org\n"
        "web:    aluigi.org\n"
        "\n", stderr);

    fprintf(stderr, "\n"
        "Usage: %s [ClientRegistry.blob/password] [key]\n"
        "\n", argv[0]);

    if(argc < 2) {
#ifdef WIN32
        if(GetWindowLong(GetForegroundWindow(), GWL_WNDPROC)) {
            regkey(
                HKEY_CURRENT_USER,
                "Software\\Valve\\Steam\\ClientRegistry.blob", "SteamPath",
                steampath, sizeof(steampath));
            if(steampath[0]) {
                for(p = steampath; *p; p++) {
                    if(*p == '/') *p = '\\';
                }
            }
            //fname = get_file(steampath);
            fname = strcat(steampath, "\\ClientRegistry.blob");
        } else
#endif


I pressed g++ and got this
Code:
C:\MinGW>g++ C:\Users\Carlo\Desktop\src\steampwd.c
C:\Users\Carlo\Desktop\src\steampwd.c:26:25: error: openssl/aes.h: No such file
or directory
C:\Users\Carlo\Desktop\src\steampwd.c:27:25: error: openssl/sha.h: No such file
or directory
C:\Users\Carlo\Desktop\src\steampwd.c:28:26: error: openssl/hmac.h: No such file
or directory
C:\Users\Carlo\Desktop\src\steampwd.c: In function 'int main(int, char**)':
C:\Users\Carlo\Desktop\src\steampwd.c:91: warning: deprecated conversion from st
ring constant to 'TCHAR*'
C:\Users\Carlo\Desktop\src\steampwd.c:98: error: invalid conversion from 'u8*' t
o 'char*'
C:\Users\Carlo\Desktop\src\steampwd.c:98: error:   initializing argument 1 of 'c
har* strcat(char*, const char*)'
C:\Users\Carlo\Desktop\src\steampwd.c:98: error: invalid conversion from 'char*'
to 'u8*'
C:\Users\Carlo\Desktop\src\steampwd.c:108: error: invalid conversion from 'char*
' to 'u8*'
C:\Users\Carlo\Desktop\src\steampwd.c:112: error: invalid conversion from 'u8*'
to 'char*'
C:\Users\Carlo\Desktop\src\steampwd.c:112: error:   initializing argument 1 of '
int sprintf(char*, const char*, ...)'
C:\Users\Carlo\Desktop\src\steampwd.c: In function 'u8* get_file(u8*)':
C:\Users\Carlo\Desktop\src\steampwd.c:138: error: invalid conversion from 'const
u8*' to 'const CHAR*'
C:\Users\Carlo\Desktop\src\steampwd.c:140: error: invalid conversion from 'u8*'
to 'CHAR*'
C:\Users\Carlo\Desktop\src\steampwd.c:143: error: invalid conversion from 'u8*'
to 'const CHAR*'
C:\Users\Carlo\Desktop\src\steampwd.c: In function 'void get_key(u8*)':
C:\Users\Carlo\Desktop\src\steampwd.c:179: warning: deprecated conversion from s
tring constant to 'TCHAR*'
C:\Users\Carlo\Desktop\src\steampwd.c:185: warning: deprecated conversion from s
tring constant to 'TCHAR*'
C:\Users\Carlo\Desktop\src\steampwd.c:191: warning: deprecated conversion from s
tring constant to 'TCHAR*'
C:\Users\Carlo\Desktop\src\steampwd.c:194: error: invalid conversion from 'u8*'
to 'char*'
C:\Users\Carlo\Desktop\src\steampwd.c:194: error:   initializing argument 1 of '
int sprintf(char*, const char*, ...)'
C:\Users\Carlo\Desktop\src\steampwd.c:195: error: invalid conversion from 'u8*'
to 'char*'
C:\Users\Carlo\Desktop\src\steampwd.c:195: error:   initializing argument 1 of '
char* strcpy(char*, const char*)'
C:\Users\Carlo\Desktop\src\steampwd.c: In function 'int hex2byte(u8*, u8*)':
C:\Users\Carlo\Desktop\src\steampwd.c:221: error: initializer-string for array o
f chars is too long
C:\Users\Carlo\Desktop\src\steampwd.c: In function 'void AESPHM_GenerateIvFromSe
ed(u8*, u8*)':
C:\Users\Carlo\Desktop\src\steampwd.c:244: error: 'SHA256_DIGEST_LENGTH' was not
declared in this scope
C:\Users\Carlo\Desktop\src\steampwd.c:246: error: 'ivHash' was not declared in t
his scope
C:\Users\Carlo\Desktop\src\steampwd.c:246: error: 'SHA256' was not declared in t
his scope
C:\Users\Carlo\Desktop\src\steampwd.c: At global scope:
C:\Users\Carlo\Desktop\src\steampwd.c:254: error: variable or field 'myaesdec' d
eclared void
C:\Users\Carlo\Desktop\src\steampwd.c:254: error: 'AES_KEY' was not declared in
this scope
C:\Users\Carlo\Desktop\src\steampwd.c:254: error: 'ctx' was not declared in this
scope
C:\Users\Carlo\Desktop\src\steampwd.c:254: error: expected primary-expression be
fore 'int'
C:\Users\Carlo\Desktop\src\steampwd.c:254: error: expected primary-expression be
fore 'int'
C:\Users\Carlo\Desktop\src\steampwd.c:254: error: expected primary-expression be
fore '*' token
C:\Users\Carlo\Desktop\src\steampwd.c:254: error: 'iv' was not declared in this
scope
C:\Users\Carlo\Desktop\src\steampwd.c:254: error: expected primary-expression be
fore '*' token
C:\Users\Carlo\Desktop\src\steampwd.c:254: error: 'input' was not declared in th
is scope
C:\Users\Carlo\Desktop\src\steampwd.c:254: error: expected primary-expression be
fore '*' token
C:\Users\Carlo\Desktop\src\steampwd.c:254: error: 'output' was not declared in t
his scope


Top
 Profile  
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 07 Mar 2009 02:42 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
yes the modification is correct.

the exact compiling command is:

gcc -s -O2 -o steampwd steampwd.c c:\mingw\lib\libcrypto.a -lgdi32 -lcomdlg32

libcrypto.a is available here: http://downloads.sourceforge.net/gnuwin ... -1-lib.zip (put all the content of that zip in your c:\mingw folder)


Top
 Profile  
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 07 Mar 2009 02:50 

Joined: 06 Mar 2009 04:34
Posts: 4
THANKS ALOT. WOW GREAT HELP!

edit:
Hey Luigi how do you make it save to a .txt as a log file after it finds the password in the current directory?


Top
 Profile  
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 13 Mar 2009 23:47 

Joined: 16 Aug 2007 06:25
Posts: 367
I was interested in this change, and decided to modify it. It compiles fine, but the program claims it can't find the blob file. The message reported is:

Error: please specify the location of the blob file or directly the encrypted password.

I have checked on both Vista 64 bit and XP 32 bit, and am getting the same error in both places with this change. The registry entry for the steampath also exists on both machines, and the value of "SteamPath" is correct (comparing to where steam was installed).

Also, your compiled version (where you have to manually choose the blob file) works just fine on both machines. Is there a problem with the modification line? Maybe it's not querying the registry correctly? Reason I ask if there is a problem is because the change failed on 2 different machines, but it may be an error on my part too.

Here is a pastebin of the modified code: http://pastebin.com/f48359e29

Compiled with mingw gcc 3.4.5 using: gcc -s -O2 -o steampwd steampwd.c c:\mingw\lib\libcrypto.a -lgdi32 -lcomdlg32


Top
 Profile  
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 14 Mar 2009 00:24 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
that line is howed only if the tool is launched from command-line without arguments.

obviously it's not your case (otherwise you had the same effect also with my version) so the guilty is probably your version of gcc which doesn't have WIN32 defined (watch line 86).
are you using gcc from mingw or from cygwin?
if you use the cygwin one it's normal because it doesn't set that define WIN32


Top
 Profile  
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 14 Mar 2009 01:07 

Joined: 16 Aug 2007 06:25
Posts: 367
Ah stupid me, I was running it from the command line without arguments. Double clicking on the compiled .exe within Windows allowed it to work just fine. What change would you do to make it purely command line only, so it automatically:

- queries the registry for the steam path
- changes the "/" to "\\"
- echoes the password, and ends the program without waiting for the RETURN key

..?

Thanks!


Top
 Profile  
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 14 Mar 2009 01:28 

Joined: 13 Aug 2007 21:44
Posts: 4068
Location: http://aluigi.org
first the same modification explained above (for forcing the loading of the default blob file in steampath), then substituiting the first "GetWindowLong(GetForegroundWindow(), GWL_WNDPROC)" with 1 and the second one with 0.
if you need to convert / in \ you can use something like the following just after the assigning of fname:
Code:
fname = strcat(...blah...):
for(p = fname; *p; p++) {
    if(*p == '/') *p = '\\';
}


Top
 Profile  
 
 Post subject: Re: [HELP] SteamPWD
PostPosted: 14 Mar 2009 01:37 

Joined: 16 Aug 2007 06:25
Posts: 367
Thanks! Works great :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 13 posts ] 

All times are UTC [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for: