Sign in to follow this  
Followers 0
Morthawt

Attempting to mess with COM objects. I have the DLL but need some help.

2 posts in this topic

#1 ·  Posted (edited)

Here is the link: http://www.yubico.com/develop/open-source-software/low-level-library/

At the bottom right there are download links for the PDF, x86 and x64 API DLL.

User guide (pdf)

Binary installer for 32-bit / x86 (Digitally signed)

Binary installer for 64-bit / x64 (Digitally signed)

I know basically nothing about COM so I am doing what I always do and just messing with it to see if something clicks and goes from "impossible" to "Hmm I think I get it.."

I have attempted to do this so far:

$hYubikey = ObjGet('C:\Program Files\Yubico\Yubikey Client API\Bin\x64\YubiClientAPI.dll')
;~ $hYubikey = ObjGet('C:\Program Files (x86)\Yubico\Yubikey Client API\Bin\x86\YubiClientAPI.dll')
$test = $hYubikey.readSerial('ycCALL_MODE_BLOCKING')

So far it complains: H:\Autoit projects\ewre5thy6jk.au3 (3) : ==> Variable must be of type "Object".:

Here is what the PDF says as an example (I think it is a c# example)

4.5 Serial number read

The non-alterable device serial number can be read (unless disabled in the device

configuration) via an API call.

The call completes in around 50 ms, so generally an asynchronous call is typically not

needed.

Synopsis

Property readSerial(ycCALL_MODE mode) As ycRETCODE rc

The basic principle (using blocking calls) is

returnCode = readSerial(ycCALL_MODE_BLOCKING)

if returnCode = ycRETCODE_OK Then

dataEncoding = ycENCODING_UINT32

print dataBuffer -- Response is here as 32-bits integer

Else

print “An ycRETCODE_xx error occurred”

EndIf

What do you think I need to do to perform a check like this using the provided DLL ? I am basically an idiot when it comes to COM and this is my first introduction to it. As I understand it a COM / DLL is almost like a chunk of functions that can be called over and over by various means. Could be wrong because I have not really looked indepth into it. I would just like a bit of help understanding the basics of what is involved in getting communication going with the API. Edited by Morthawt

Share this post


Link to post
Share on other sites



What you need is a COM error handler. This will give you detailed information why your script failed. See the help file for ObjEvent.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0