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 7884301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:45:45+00:00 2026-06-03T04:45:45+00:00

I have a DLL that takes an encoded string input and decodes it. The

  • 0

I have a DLL that takes an encoded string input and decodes it. The DLL was made on a Win7 64-bit using Codeblocks and mingw64. The C code alone runs fine but when I run it via JNA in a while loop with the same string it is decoded properly for about 70% calls and for the rest its incorrect. I want to debug the situation but I am not sure how to do it after the Java code hands the control over to JNA. Alternatively any ideas on where to look will also be helpful.

The method signature in C and JNA are as follows,

Java: int Decrypt_Blk(byte[] expkey, byte[] in, int size, byte[] out);  
C: __declspec (dllexport) int Decrypt_Blk (unsigned char *expkey, unsigned char *in, unsigned int insize, unsigned char *out);

the correctness is determined by the output, for example, if i take the string “helloworld” encrypt it (I am not going into the encryption details as they are irrelevant) then pass the encrypted output to this DLL method, 7 out of 10 times I get “HelloWorld” other 3 times I would get incorrect and varying characters. And for all 10 times I am in the same thread using the same variable, in the same loop. The 3 incorrect occurrences are also random, the only thing I can notice is that the first run is ALWAYS correct as many times as I have tested but the incorrect run happens at any of the 1-10 runs.

  • 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-06-03T04:45:47+00:00Added an answer on June 3, 2026 at 4:45 am

    In Microsoft Visual C++, from the Project Settings for the DLL project, you can select the Debug tab. As the executable for the debug session, provide the full path of the Java.exe. For the arguments, provide the remainder of the command line to run your Java app. Set break points in your C code and start the debug session. Voila!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have code written in c++. its a console app that takes an input
I have a DLL that's compiled, and I don't have the source code for
I have a dll function that takes BSTR parameters. These are cast as char*
I have a unmanaged DLL that exposes a function that takes a pointer to
I have a single plugin, that takes value for an input and returns the
I have the following C# project targetting .NET 4.0 that takes a source code
I would like to make a program that takes input as a string like
I have a simple COM dll with a method that takes two strings. In
I have a DLL with the following code using System.Text; using Microsoft.Win32; using System.Diagnostics;
I have just been re-working an old bit of compiler-like code written using bison.

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.