neilh has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to translate this into either a Win32::API or Win32::API::Prototype programme.Function: bgfnTextDecrypt Description: Export Ordinal: 0 Returns Boolean: BOOL Parameters String: LPSTR Receive String: LPSTR
and#!perl use strict; use Win32::API; my $bgfnTextDecrypt = new Win32::API('eq_handy', 'bgfnTextDecrypt','PP +','P'); if(not defined $bgfnTextDecrypt) { die "Can't import API bgfnTextDecrypt: $!\n"; } print "Eerk\n"; my $lpBuffer = " " x 80; print "Eerk2\n"; my $return = $bgfnTextDecrypt->Call('password-crypt', $lpBuffer); print "Eerk3\n"; my $decrypt = substr($lpBuffer, 0, $return); print "$decrypt\n";
#!perl use strict; use Win32::API::Prototype; ApiLink( 'eq_handy.dll', 'BOOL bgfnTextDecrypt( LPSTRING lpString, LP +STRING, lpBuffer )' ) || die; my $lpString="password-crypt"; my $lpBuffer = pack( "L*", $lpString); bgfnTextDecrypt($lpString); my $pass = unpack( "L*", $lpBuffer ); print( "The pass is: $pass\n";
Thanks.
Neil
EDIT: Changed the dll name in the second example.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::API and ::Prototype assistance
by neilh (Pilgrim) on Jul 29, 2005 at 12:20 UTC | |
by neilh (Pilgrim) on Jul 29, 2005 at 12:42 UTC |