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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:34:12+00:00 2026-05-31T03:34:12+00:00

This is possibly more of a ctypes question than a pydbg question, but I

  • 0

This is possibly more of a ctypes question than a pydbg question, but I still don’t understand why the results are inconsistent in the way they are.

I have an exit_hook set on LoadLibraryA using pydbg and its utils.hook_container class like this:

def exit_LoadLibraryA(dbg, args, ret):
    libname = c_char_p(args[0])
    # or: libname = ctypes.cast(args[0], ctypes.c_char_p)
    print "LoadLibraryA(%s) -> %08X" % (str(libname), ret)
    return DBG_CONTINUE

unfortunately the output is inconsistent. While some of the values get converted to (and shown as) strings, some others get shown as numbers like this:

LoadLibraryA(c_char_p(2007516492)) -> 7C800000
LoadLibraryA(c_char_p(17426164)) -> 77DD0000
LoadLibraryA(c_char_p(17426164)) -> 76C30000
LoadLibraryA(c_char_p('UxTheme.dll')) -> 5AD70000
LoadLibraryA(c_char_p('IMM32.dll')) -> 76390000
LoadLibraryA(c_char_p('COMCTL32.dll')) -> 773D0000
LoadLibraryA(c_char_p('Secur32.dll')) -> 77FE0000
LoadLibraryA(c_char_p(1033757216)) -> 7C9C0000

what I would like is to reliably convert the char* (and later the wchar_t* of LoadLibraryW) to a Python string to output it.

  • 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-31T03:34:13+00:00Added an answer on May 31, 2026 at 3:34 am

    IIUC, you want to read the string at the memory address args[0] which is an integer.

    In this case, you need the string_at (or wstring_at) function. However, if there is no valid NUL-terminated string at the specified memory address, a WindowsError will be raised which you may want to catch.

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

Sidebar

Related Questions

This is more of a cryptography theory question, but is it possible that the
This is quite possibly a very stupid question but I've tried searching for and
I don't understand how this example can possibly work: double * GetSalary() { double
Might not be a JSF issue but JSF experts would know this possibly more
I'm wondering if there's a solution to this: (possibly not, but you never know!)
This could quite possibly be the dumbest question ever asked. Our client wants us
Is this possible to have two (or more) different kinds of cells to be
First of all, is this possibly ready-made? Hibernate 3.6 , JDBC batch_size 500 ,
(Running MingW on 64-bit Windows 7 and the GCC on Kubuntu) This may possibly
What could possibly cause this weird python behaviour? Python 2.6.2 (r262:71600, May 31 2009,

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.