Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1054919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:28:54+00:00 2026-05-16T17:28:54+00:00

I want to use dll from ssdeep ( http://ssdeep.sourceforge.net/ ). The API is: int

  • 0

I want to use dll from ssdeep (http://ssdeep.sourceforge.net/). The API is:

int fuzzy_hash_buf(unsigned char *buf, uint32_t buf_len, char *result);

then in Delphi, i write it like this:

function fuzzy_hash_buf(buf : Pbyte; buf_len : Cardinal; result : PAnsiChar): integer; stdcall; external ‘fuzzy.dll’ name ‘fuzzy_hash_buf’;

How to use that function in Delphi?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:28:55+00:00Added an answer on May 16, 2026 at 5:28 pm

    If fuzzy.dll exports a function fuzzy_hash_buf with the C declaration

    int fuzzy_hash_buf(unsigned char *buf, uint32_t buf_len, char *result);
    

    then you are right that the Delphi declaration would be

    function fuzzy_hash_buf(buf: PAnsiChar; buf_len: cardinal; result: PAnsiChar):
      integer;
    

    To use this in Delphi, in the interface section of a unit, write

    function fuzzy_hash_buf(buf: PAnsiChar; buf_len: cardinal; result: PAnsiChar):
      integer; stdcall;
    

    Then, in the implementation section of the very same unit, you do not implement the function yourself, but rather point to the external DLL:

    function fuzzy_hash_buf; external 'fuzzy.dll' name 'fuzzy_hash_buf`
    

    Notice that you do not have to redeclare the parameters, the result type, and the calling convention (stdcall).

    Now you can use this function as if it were an actual function of this unit. For instance, you might write

    val := fuzzy_hash_buf(buf, len, output);
    

    from any unit that uses the unit in which you declared fuzzy_hash_buf.

    Update

    I am afraid that I am not familiar enough with the CreateFileMapping function. However, after reading the MSDN documentation, I believe that you can do

    var
      buf: PAnsiChar;
    
    buf := MapViewOfFile(FFileMappingHandle, FILE_MAP_READ, 0, 0, 0);
    
    // Now, if I have understood MapViewOfFile correctly, buf points to the first byte of the file.
    
    var
      StatusCode: integer;
      TheResult: PAnsiChar;
    
    GetMem(TheResult, FUZZY_MAX_RESULT);
    
    StatusCode := fuzzy_has_buf(buf, FFileSize, TheResult);
    
    // Now TheResult points to the first byte (character) of the output of the function.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use pjsipDll.dll in a c++ code. I got this dll from
I have a VB6 COM DLL. I want to use it from C++. I
I want to use some code from a VB6 application in an ASP.NET (written
I want to use the ajax dll 3.5 in the website of framework 2.0
I want to use MSVC compiler to build a DLL file. The problem is
I want to use Microsoft.Office.Interop.Excel dll to write the data into excel sheet. I
I want to use in my wpf aplication notify icon (with .dll library in
I have project I want to upgrade to .Net4 and it use BackgroundCopyManager.dll. Anyone
I am building a DLL that another application would use. I want to store
I'm converting a VB6 dll to VB.Net using Visual Studio 2008 Express. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.