Sign in to follow this  
Followers 0
MagnumXL

Help with calls to FFACE.dll

4 posts in this topic

I know that some topics for over a year ago do reference FFACE.dll but that was version 3. I am try to get up and running with autoit and FFACE v4.

I am fairly sure that my problem stems from being unframiliar with structures. But very often when I hit a brick wall like this its because I am not seeing the forest for the trees. So whats why I came here. I have posted on the FFACE forums but they really only support C#, C++ and VB, so I am not expecting much help there.

I have been trying to modify this code:

$dll = DllOpen("FFACE.dll")
$running = DllCall($dll, "int", "InitFFACE")
$nameStruct = DllStructCreate("char[256];int")
DllStructSetData($nameStruct, 2, "256")
$Result = DllCall($dll, "int:cdecl", "GetPlayerName", "ptr", DllStructGetPtr($nameStruct, 1), "int*", DllStructGetPtr($nameStruct, 2))
If @error Then Exit(@error)
$test = ConsoleWrite($Result[0] & @LF)
MsgBox(0,'name is',dllstructgetdata($namestruct,1))
DllClose($dll)

That was found in this post (Thank you onestcoder, martin and FreeFry)

I came up with:

$dll = DllOpen("FFACE.dll")
$running = DllCall($dll, "int", "CreateInstance")
$nameStruct = DllStructCreate("int;int;int;int;ushort;ushort;char;char;char;char[20]")
$Result = DllCall($dll, "int*", "GetPlayerInfo", "ptr", DllStructGetPtr($nameStruct, 1), "int*", DllStructGetPtr($nameStruct, 10))
If @error Then
    MsgBox(0,"Debug 1", @error)
    Exit
Else
    MsgBox(0,"Debug 2", "Success")
EndIf
$test = ConsoleWrite($Result[0] & @LF)
MsgBox(0,'name is',dllstructgetdata($namestruct,1))
DllClose($dll)

I have poked and proded it into a frankenstien I think. But that is what I have... it obviously does not work.

The FFACE v4 SDK is here.

A VB example is here.

I am hoping that someone is already using autoit with the FFACE.dll and can post an example dllCall.

Any help is greatly appreciated. Thank you in advance!

Share this post


Link to post
Share on other sites



hmmm, i guess I am barking up a dead tree, I am just going to move on. Access the memory directly. Thanks to everyone that gave it a look though.

Share this post


Link to post
Share on other sites

Dunno if this too late to help you but here's how you do it...

$pid= processlist("pol.exe")
$dll = DllOpen("FFACE.dll")
$face = DllCall($dll, "int:cdecl", "CreateInstance","ulong",$pid[1][1])

$target ="int CurrentID;int SubID;int CurrentSvrID;int SubSrvID;ushort CurrentMask;ushort SubMask;byte IsLocked;byte IsSub;byte HPP;char name[20]"

$info = DllStructCreate($target)
$junk = dllcall($dll,"none:cdecl","GetTargetInfo","int",$face[0],"ptr",DllStructGetPtr($info))
$tarname = DllStructGetData($info,"name")

$tarname will have the name of your target in it.

you could also do $tarname = DllStructGetData($info,10), since the name is the 10th entry in the structure.

Share this post


Link to post
Share on other sites

Dunno if this too late to help you but here's how you do it...

$tarname will have the name of your target in it.

you could also do $tarname = DllStructGetData($info,10), since the name is the 10th entry in the structure.

Thank you very much aznguy for taking the time to post this!

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