Click here to Skip to main content
15,312,406 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys/Gals

Wondering if you can shed some light, i am trying to use a pre-exisiting DLL with no access to any source and limited documentation. I have scoured the internet for some time and struggling now, i used DUMPBIN /EXPORTS to get the entry points:
ordinal hint RVA      name

      1    0 00005650 ??0CAGDGatewayCallBack@@QAE@ABV0@@Z
      2    1 00005620 ??0CAGDGatewayCallBack@@QAE@XZ
      3    2 00006340 ??0CAGDGatewayInterface@@QAE@PADPAVCAGDGatewayCallBack@@0H0H@Z
      4    3 00006450 ??1CAGDGatewayInterface@@QAE@XZ
      5    4 00005670 ??4CAGDGatewayCallBack@@QAEAAV0@ABV0@@Z
      6    5 00005690 ??4CAGDGatewayInterface@@QAEAAV0@ABV0@@Z
      7    6 0004C4FC ??_7CAGDGatewayCallBack@@6B@
      8    7 00007170 ?CallBackUpdate@CAGDGatewayInterface@@QAE?AW4AGDClientError@@W4AGDCallbackUpdateType@@HHHPAD1@Z
      9    8 00005FF0 ?CallBackUpdateAck@CAGDGatewayCallBack@@UAEXW4AGDCallbackUpdateType@@HHHPAD1JAAUAGDGatewayDateTime@@@
     10    9 00005ED0 ?CallCleared@CAGDGatewayCallBack@@UAEXJJJJAAUAGDGatewayDateTime@@@Z
     11    A 00007E90 ?DeleteAllExclusions@CAGDGatewayInterface@@QAE?AW4AGDClientError@@XZ
     12    B 00007FF0 ?DeleteExclusion@CAGDGatewayInterface@@QAE?AW4AGDClientError@@JPADJ@Z
     13    C 00006D10 ?DeleteRecordSet@CAGDGatewayInterface@@AAE_NXZ
     14    D 000059D0 ?Disconnect@CAGDGatewayInterface@@AAEXXZ
     15    E 00006130 ?Disposition@CAGDGatewayCallBack@@UAEXJJJJAAUUserDefinedData@@AAUAGDGatewayDateTime@@@Z
     16    F 000077E0 ?EndSession@CAGDGatewayInterface@@QAE?AW4AGDClientError@@XZ
     17   10 00005B10 ?ExecuteCCDown@CAGDGatewayInterface@@QAEXXZ
     18   11 00005C50 ?ExecuteCCTimeOut@CAGDGatewayInterface@@QAEXXZ
     19   12 00005D80 ?ExecuteCCUp@CAGDGatewayInterface@@QAEXXZ
     20   13 00006060 ?FoundAgent@CAGDGatewayCallBack@@UAEXJJJPADAAUAGDGatewayDateTime@@@Z
     21   14 00005640 ?GetInterface@CAGDGatewayCallBack@@QAEPAXXZ
     22   15 00006730 ?GetMediaList@CAGDGatewayInterface@@QAE?AW4AGDClientError@@JJJ@Z
     23   16 000082C0 ?InsertExclusion@CAGDGatewayInterface@@QAE?AW4AGDClientError@@JPADJ00@Z
     24   17 00008180 ?InsertExclusionWithoutNotify@CAGDGatewayInterface@@QAE?AW4AGDClientError@@JPADJ00@Z
     25   18 000075E0 ?KillAllCallsInService@CAGDGatewayInterface@@QAE?AW4AGDClientError@@J@Z
     26   19 000074D0 ?KillCall@CAGDGatewayInterface@@QAE?AW4AGDClientError@@JJJ@Z
     27   1A 00006840 ?KillMediaCall@CAGDGatewayInterface@@QAE?AW4AGDClientError@@J@Z
     28   1B 00007970 ?LoginToCC@CAGDGatewayInterface@@AAE_NPADH@Z
     29   1C 000062E0 ?MediaCallGone@CAGDGatewayCallBack@@UAEX_NJ@Z
     30   1D 00006280 ?MediaListCall@CAGDGatewayCallBack@@UAEXJJJJJJJ@Z
     31   1E 000061F0 ?MediaListCall@CAGDGatewayCallBack@@UAEXJJJJJJJJ@Z
     32   1F 000072A0 ?NewCall@CAGDGatewayInterface@@QAE?AW4AGDClientError@@JAAUUserDefinedData@@J@Z
     33   20 00005F90 ?NewCallAck@CAGDGatewayCallBack@@UAEXJJJJJAAUAGDGatewayDateTime@@@Z
     34   21 000073B0 ?NewCallAgent@CAGDGatewayInterface@@QAE?AW4AGDClientError@@JAAUUserDefinedData@@JPAD@Z
     35   22 00006650 ?NotifyCCOfExclusionInsert@CAGDGatewayInterface@@QAE?AW4AGDClientError@@XZ
     36   23 00005830 ?PrintInBoundPacket@CAGDGatewayInterface@@AAEXPAX@Z
     37   24 00005710 ?PrintOutGoingPacket@CAGDGatewayInterface@@AAEXPAX@Z
     38   25 00006930 ?ProcessPacket@CAGDGatewayInterface@@AAEXPAX@Z
     39   26 000060C0 ?ReRoute@CAGDGatewayCallBack@@UAEXJJJJJJAAUUserDefinedData@@AAUAGDGatewayDateTime@@@Z
     40   27 00006640 ?SendNewCallPacket@CAGDGatewayInterface@@AAE?AW4AGDClientError@@PAXJ@Z
     41   28 00006480 ?SendPacket@CAGDGatewayInterface@@AAE?AW4AGDClientError@@PAXJ@Z
     42   29 00007B60 ?SendTECommand@CAGDGatewayInterface@@AAE_NHPAXHH@Z
     43   2A 00005F30 ?ServiceStatus@CAGDGatewayCallBack@@UAEXJJAAUAGDGatewayDateTime@@@Z
     44   2B 00005630 ?SetInterface@CAGDGatewayCallBack@@QAEXPAX@Z
     45   2C 00007C30 ?StartSession@CAGDGatewayInterface@@QAE?AW4AGDClientError@@XZ
     46   2D 000076D0 ?UpdateCallData@CAGDGatewayInterface@@QAE?AW4AGDClientError@@JJJAAUUserDefinedData@@@Z
     47   2E 00006190 ?UpdateCallDataAck@CAGDGatewayCallBack@@UAEXJJJJAAUAGDGatewayDateTime@@@Z


From here i used the undname command to retrieve the undecorated name for a call:
Undecoration of :- "?DeleteAllExclusions@CAGDGatewayInterface@@QAE?AW4AGDClientError@@XZ"
is :- "public: enum AGDClientError __thiscall CAGDGatewayInterface::DeleteAllExclusions(void)"


From here i am now trying to use DLLImport to perform the command but i keep getting 'Entry Point Not Found'

Could any one assist with this by any chance?

My Code:
VB
<DllImport("AGDGatewayInterface.dll")> _
Private Shared Function DeleteAllExclusions() As AGDClientError
End Function


Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Call DeleteAllExclusions()

End Sub


Error Returned when trying to run this:
XML
Unable to find an entry point named 'DeleteAllExclusions' in DLL 'AGDGatewayInterface.dll'.


Many Thanks
Dev
Posted
Comments
[no name] 20-Jul-15 11:14am
   
AFAIK, just because you found the undecorated name does not mean that the DLL magically uses undecorated names. You might try using the ordinal to make the function call.

1 solution

You are dealing with name mangling: http://en.wikipedia.org/wiki/Name_mangling[^].
For this and other similar purposes, the class System.Runtime.InteropServices has the property EntryPoint:
https://msdn.microsoft.com/en-us/library/System.Runtime.InteropServices.DllImportAttribute%28v=vs.110%29.aspx[^].

Use it. Give your imported method a non-mangled name or any semantically sensible human-readable name at your convenience, and use this property to specify exact mangled name. For the usage, please see VB.NET code sample here: https://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.entrypoint%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2[^].

—SA
   
Comments
Dev O'Connor 22-Jul-15 5:37am
   
Thanks for this, this has been a great help.
Sergey Alexandrovich Kryukov 22-Jul-15 10:51am
   
You are very welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900