Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find an entrypoint for decode_string in libargon2.dll #9

Open
sombraguerrero opened this issue Mar 24, 2024 · 4 comments
Open

Comments

@sombraguerrero
Copy link

sombraguerrero commented Mar 24, 2024

The following method fails because there seems to be a mismatch between the entry point names in Argon2.cs and the content of libargon2.dll in the 1.16.1 package.

[MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static unsafe Argon2Error Decode(Argon2Context ctx, ReadOnlySpan<byte> str, int type)
    {
        fixed (byte* p_str = str)
        {
            return decode_string(ctx, p_str, type);
        }
    }

%USERPROFILE%\.nuget\packages\argon2.bindings\1.16.1\runtimes\win-x64\native>dumpbin /exports libargon2.dll
Microsoft (R) COFF/PE Dumper Version 14.39.33523.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file libargon2.dll

File Type: DLL

  Section contains the following exports for libargon2.dll

    00000000 characteristics
    FFFFFFFF time date stamp
        0.00 version
           1 ordinal base
          22 number of functions
          22 number of names

    ordinal hint RVA      name

          1    0 00001050 argon2_ctx
          2    1 00001D10 argon2_encodedlen
          3    2 00001B30 argon2_error_message
          4    3 00001370 argon2_hash
          5    4 00001000 argon2_type2string
          6    5 00001860 argon2_verify
          7    6 000019F0 argon2_verify_ctx
          8    7 000019C0 argon2d_ctx
          9    8 00001690 argon2d_hash_encoded
         10    9 00001700 argon2d_hash_raw
         11    A 000019A0 argon2d_verify
         12    B 00001B00 argon2d_verify_ctx
         13    C 000019D0 argon2i_ctx
         14    D 000015A0 argon2i_hash_encoded
         15    E 00001620 argon2i_hash_raw
         16    F 00001990 argon2i_verify
         17   10 00001B10 argon2i_verify_ctx
         18   11 000019E0 argon2id_ctx
         19   12 00001770 argon2id_hash_encoded
         20   13 000017F0 argon2id_hash_raw
         21   14 000019B0 argon2id_verify
         22   15 00001B20 argon2id_verify_ctx

  Summary

        2000 .data
        2000 .pdata
        B000 .rdata
        1000 .reloc
        1000 .rsrc
       14000 .text
        1000 _RDATA
@kamronbatman
Copy link
Contributor

kamronbatman commented Mar 24, 2024

Thanks I'll look into this. We should be using that entry point in ModernUO, and it isn't failing at the moment, so this is very curious.

CORRECTION: We don't use it. Damn. Ok, I'll try to fix it. Others are also welcome to make a PR, thank you!

@sombraguerrero
Copy link
Author

I should mention too that I am using Net 8 as opposed to 7, in case this is a versioning issue.

@kamronbatman
Copy link
Contributor

Yeah, I'll update it soon..should work on 6+ with no issues.

@sombraguerrero
Copy link
Author

Not urgent or anything. I created my own class to handle the metadata parsing in the meantime anyway, because other than this, everything else seems to still work perfectly. I appreciate your efforts in creating and maintaining these bindings!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants