Thread: Help Please

  1. #1
    Registered User
    Join Date
    Nov 2001

    Help Please

    I need to know if someone here can conver this Visual C++ code into standard C++ code that will work with my borland compiler. I have looked it over many times and can't figure out what I can do to get it to work. I know I could add the iostream header and cout and cin... but what else do I need to do to make it work?

    #include <windows.h>
    #include <stdio.h>

    typedef struct tagPASSWORD_CACHE_ENTRY {
    WORD cbEntry; // size of this entry, in bytes
    WORD cbResource; // size of resource name, in bytes
    WORD cbPassword; // size of password, in bytes
    BYTE iEntry; // entry index
    BYTE nType; // type of entry
    BYTE abResource[1]; // start of resource name
    // password immediately follows resource name

    char *buf, *ob1;
    int cnt = 0;

    memmove(buf, x->abResource, x->cbResource);
    buf[x->cbResource] = 0;
    CharToOem(buf, ob1); // for non-English users
    printf("%-30s : ", ob1);

    memmove(buf, x->abResource+x->cbResource, x->cbPassword);
    buf[x->cbPassword] = 0;
    CharToOem(buf, ob1);
    printf("%s\n", ob1);

    return TRUE;

    void main()
    buf = new char[1024];
    ob1 = new char[1024];
    puts("There is no security in this crazy world!\n"
    "Win95 PWL viewer v1.01 (c) 1997, 98 Vitas Ramanchauskas\n"
    "!This program intended to be used for legal purpose only!\n"
    "This program shows cached passwords using standard (but undocumented)\n"
    "Windows API on local machine for current user (user must be logged in).\n"
    "You may invoke pwlview in this way: pwlview >> textfile.txt\n"
    "to save passwords in file (don't forget to press enter twice)\n"
    "Press Enter to begin...\n");

    HINSTANCE hi = LoadLibrary("mpr.dll");
    puts("Couldn't load mpr.dll. This program is for Windows 95 only");
    WORD (__stdcall *enp)(LPSTR, WORD, BYTE, void*, DWORD) =
    (WORD (__stdcall *)(LPSTR, WORD, BYTE, void*, DWORD))GetProcAddress(hi, "WNetEnumCachedPasswords");
    puts("Couldn't import function. This program is for Windows 95 only");
    (*enp)(0,0, 0xff, pce, 0);
    puts("No passwords found.\n"
    "Probably password caching was not used or user is not logged in.");
    puts("\nPress Enter to quit");

  2. #2
    Registered User
    Join Date
    Feb 2002

    Question Answer

    Im kind'a an ameteur but you have to use int and char and stuff like that to initiate the variables.

  3. #3

    go to this site and download the tuturials, in them they have a windows shell. This is the code needed to get windows programs to work. It is basically code that tells windows how to open a window and how to process messages, this is done for you in VC++ and thusly hidden from you. Goto that site, download the tutorials and cut/paste the code into your code, then it should work.
    My Avatar says: "Stay in School"

    Rocco is the Boy!

  4. #4
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Ive given it the once over and the code seems correct. Try a different compiler. Where in the code does the compiler complain about?
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :-

Popular pages Recent additions subscribe to a feed