473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Getting function names from ordinals in a dll

vekipeki
229 Expert 100+
Hi, first of all sorry if this isn't exactly C++ related, but didn't know where it would be more appropriate.

I am trying to get actual function names from their ordinal numbers from a COM dll. I tried using dumpbin.exe but it only returns [NONAME] for each ordinal (except the first few):

Expand|Select|Wrap|Line Numbers
  1.     ordinal hint RVA      name
  2.  
  3.          21    0 00002439 DllCanUnloadNow
  4.          25    1 00007F41 DllGetClassObject
  5.         116    2 0000539C DllMain
  6.         138    3 00008633 DllRegisterServer
  7.         176    4 00008640 DllUnregisterServer
  8.           1      0009152E [NONAME]
  9.           2      00154CA7 [NONAME]
  10.           3      00154C0B [NONAME]
  11.           4      000140C9 [NONAME]
  12.         ...
The directory containing the .dll file doesn't contain any other files (*.tlb, *.lib).

I also tried using OLE/COM object viewer, but didn't find the relation between them.

Could someone tell me how to get a list of these? Or at least the name of a specific ordinal using registry or something?
Mar 16 '09 #1
3 5611
vekipeki
229 Expert 100+
Additional info:

I cannot find the .def file for the COM dll, so I cannot use it to get the name. I am not interested in instantiating the COM class, I only want to know what function is related to a specified ordinal.

My original problem is that I have found an exception using WinDbg, which happens in ChartFXClientServerCore!Ordinal5507(+0x97b7), so I would like to see the specific function to try to isolate the problem.
Mar 16 '09 #2
weaknessforcats
9,208 Expert Mod 8TB
Use the Visual Studio.NET debugger to display the call stack. One click will put you at the calling function.
Mar 16 '09 #3
vekipeki
229 Expert 100+
But it doesn't display the call stack for the unmanaged side (COM). The problem is that exception happens in the message loop, so the method at breakpoint is Application.Run():

Expand|Select|Wrap|Line Numbers
  1. -- Message: Attempted to read or write protected memory.
  2.    This is often an indication that other memory is corrupt.
  3. -- Stack trace:
  4.    at System.Windows.Forms.UnsafeNativeMethods
  5.       .DispatchMessageW(MSG& msg)
  6.    at System.Windows.Forms.Application.ComponentManager
  7.       .System.Windows.Forms.UnsafeNativeMethods
  8.       .IMsoComponentManager.FPushMessageLoop
  9.       (Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
  10.    at System.Windows.Forms.Application.ThreadContext
  11.       .RunMessageLoopInner(Int32 reason, ApplicationContext context)
  12.    at System.Windows.Forms.Application.ThreadContext
  13.       .RunMessageLoop(Int32 reason, ApplicationContext context)
  14.    at System.Windows.Forms.Application.Run(ApplicationContext context)
  15.    at MyApp.Program.Main()
If I try to catch it, RunMessageLoopInner disposes my form before it throws the actual exception.

Using WinDbg, I managed to get this:

Expand|Select|Wrap|Line Numbers
  1. (ca84.c98c): Access violation - code c0000005 (first chance)
  2. First chance exceptions are reported
  3. before any exception handling.
  4. This exception may be expected and handled.
  5. eax=00000000 ebx=06e67c38 ecx=06e67c38
  6.  edx=000018c6 esi=06e7df30 edi=317a9e80
  7. eip=31666110 esp=0015e040 ebp=0015e08c iopl=0 nv up ei pl zr na pe nc
  8. cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010246
  9.  
  10. ChartFX_ClientServer_Core!Ordinal5507+0x97b7:
  11. 31666110 8a404d mov  al,byte ptr [eax+4Dh] ds:0023:0000004d=??
Mar 16 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Falc2199 | last post by:
Hi, Does anyone know how to make this work? var sectionId = 5; repeat_section_sectionId(); function repeat_section_5(){ alert("firing"); }
12
by: Eric | last post by:
I've got a pretty large C program with global variables and function names strewn about (i.e. no "static" declarations in front of them). Now I want to expose the ability for user's to supply their...
3
by: joseluismarchetti | last post by:
Hello everybody, Although I am sure this is an important question for this group, I am not sure this question belongs to this group and I will be happy to move it to the correct one after you...
2
by: newhand | last post by:
If somehow a bunch of function names in string can be passed into an executible, is it possible that for each name call, it will trigger the corresponding function of that name? Of course, this can...
7
by: Petr Jakes | last post by:
I have got names of functions stored in the file. For the simplicity expect one row only with two function names: printFoo, printFOO In my code I would like to define functions and then to read...
5
by: Sakcee | last post by:
python provides a great way of dynamically creating fuctions calls and class names from string a function/class name can be stored as string and called/initilzed e.g def foo(a,b): return...
2
by: hemant.singh | last post by:
I am stuck with strange JS issue My product gives user to show some images(which track mouseover) on page by embedding script like <script src=http://domain.com/GetDynamicJS?domagic=1>...
16
by: Xiaoxiao | last post by:
Hi, I got a C library, is there a way to view the public function names in this library so that I can use in my C program? Thanks.
0
by: AJ Evans | last post by:
hello all, A newbie here wondering if there is anyone out there who has some knowledge about assembly language, or translations of it. I am trying to explore a mid-sized DLL from the system32...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.