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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:19:24+00:00 2026-06-14T07:19:24+00:00

I am using js-sctypes to connect to a shared library in Linux from Firefox.

  • 0

I am using js-sctypes to connect to a shared library in Linux from Firefox.
I am declaring a function from the library as follows:

var read_memory = libc.declare("read_memory", ctypes.default_abi, ctypes.int,
                   ctypes.uint32_t, ctypes.char.ptr, ctypes.int, ctypes.int);

In C++ library this function is declared as follows:

read_memory(unsigned int address, char *buf, int unit_size, int unit_count)

I am calling the read_memory function in the following way:

var my = new ctypes.char().address();
read_memory(0, my, 4, 1);
st = st + my.readString();

And it works fine, but when I am calling the function with greater unit_size and unit_count, for example read_memory(0, my, 4, 10), the Firefox crashes.

Is it because ctypes.char is limited in size, or there is another reason for this fault?
Any help on this matter would be appreciated.

Thank you.

  • 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-14T07:19:25+00:00Added an answer on June 14, 2026 at 7:19 am

    I had the same problem and the problem is because of character encoding. In my problem I need to convert them from windows-1250 to utf-8.

    I used code below:

    result = myFunctionToInvoke();
    var util = priv.Load("LibToConvert.dll");
    var wi12502utf8 = util.declare("win12502utf8", ctypes.default_abi, ctypes.char.ptr, ctypes.char.ptr);
    var val = wi12502utf8(result);
    result = val.readString();
    

    In this code I created my own lib (LibToConvert.dll) in C++ to convert characters.

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

Sidebar

Related Questions

Using CMake I want to check if a particular function (cv::getGaborKernel) from OpenCV library
I'm trying to connect to my phone from my Windows 7 PC using PySerial
I've written some function callbacks using python's ctypes to access functions in a DLL.
Using mercurial, I've run into an odd problem where a line from one committer
Using Delphi 2010. I am looking for (possibly) a function or procedure which can
Using php/html, I want to retrieve email addresses (plus other information) from MySQL and
Using jQuery, how do I get the value from a textbox and then load
I'm using Python's ctypes library to talk to a Windows DLL. When I run
Using Java,I have to fetch multiple sets of values from an XML file to
Using the Exiv2 library to write some exif tags to an image i'm running

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.