8.2.4.2 Retrieve SecureDECODE SDK DLL Functions


   Retrieve SecureDECODE SDK DLL Exported Function Addresses


Here are code snippets on how to perform this action:



   C++


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
// SecureDecodeSDK.h
typedef int32_t (__stdcall *PF_SECUREDELTA_SDK_SECUREDECODE_MAIN)(SD_SDK_SECURE_DECODE_PARAMS& _encode_param_struct);

// C++ file code
PF_SECUREDELTA_SDK_SECUREDECODE_MAIN lpfnSecureDECODE_Dll_MainDecodeFnct = nullptr;    // Initialize function pointer

lpfnSecureDECODE_Dll_MainDecodeFnct = (PF_SECUREDELTA_SDK_SECUREDECODE_MAIN)GetProcAddress(h_SecureDecodeSDK_DLL_Handler_x86, SecureDELTA_SDK_DLL_SecureDECODE_Main_Func_);
if (!lpfnSecureDECODE_Dll_MainDecodeFnct)
{
        // unload DLL and exit
        FreeLibrary(h_SecureDecodeSDK_DLL_Handler_x86);
        return 0x02;
}



   VB .NET


1
 Dim secureDecodeMain As SecureDelta_SecureDECODE_Main = DirectCast(Marshal.GetDelegateForFunctionPointer(SecureDECODE_FunctionHandle, GetType(SecureDelta_SecureDECODE_Main)), SecureDelta_SecureDECODE_Main)



   C#


1
2
3
4
5
 private string cs_SD_SDK_SECURE_DECODE_MainFnct = "SecureDELTA_SDK_SecureDECODE_Main_";
 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
 private delegate Int32 SecureDELTA_SDK_SecureDECODE_Main_(ref SD_SDK_SecureDECODE_Struct _decode_struct);

 SecureDELTA_SDK_SecureDECODE_Main_ _decode_main_proc = (SecureDELTA_SDK_SecureDECODE_Main_)Marshal.GetDelegateForFunctionPointer(ipSD_DecodeMain, typeof(SecureDELTA_SDK_SecureDECODE_Main_));



   DELPHI


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
type
  TSD_SDK_SecureDECODE_Main_Func = function( {reference} var SD_SDK_SECURE_DECODE_PARAM: struct_SD_SDK_SECURE_DECODE_PARAM) : LongInt; stdcall;

var
  SD_SDK_SecureDECODE_Main_Func: TSD_SDK_SecureDECODE_Main_Func;

begin
  @SD_SDK_SecureDECODE_Main_Func := GetProcAddress(SecureDECODE_DLL_Handle, SecureDELTA_DLL_Record.SecureDECODE_DLL_Main_Ptr);
  if @SD_SDK_SecureDECODE_Main_Func <> nil then
   begin
   ...