Posted: 3rd Mar 2022 1:38
Hi,

I'm working on a dll and need mangled names to put into the command.txt file, but Dependency Walker doesn't work for me, it goes unresponsive and freezes. My dll was made in PureBasic. Does anyone else know what I can use or how I can get the mangled names? I'm using windows 10 64 bit and using PureBasic x86
Posted: 3rd Mar 2022 4:34
Explain more on what mangled names is?
Posted: 3rd Mar 2022 4:57
Are you using the old dependency walker cause that won?t run on windows 10. If u are then you may try the open source version here. https://github.com/lucasg/Dependencies. I believe I was able to get it to work under windows 10 but it?s been awhile since I needed to use it.
Posted: 3rd Mar 2022 5:14
Remove 'extern "c"' in code which prevents mangling. And dependency walker works fine on windows 10 make sure you downloaded the correct version and run as admin
Posted: 3rd Mar 2022 7:03
From my experience, I can say that dependency walker takes a very long time to read a dll.
It can take up to 5 minutes depending on the size of the dll.
Otherwise, I also recommend what BotR suggested, to suppress the manipulated names.
Posted: 3rd Mar 2022 9:01
yes, agreed, Depend Walker is sloooow, Also, play around with Visual Studio dumpbin command e.g. for dependencies etc
Posted: 3rd Mar 2022 13:29
"


Yes, I didn't know about a newer version. I'll try the github one.

Remove 'extern "c"'


I will definitely turn it off

play around with Visual Studio dumpbin command


I'll try that too

Thank you all for your advice and knowledge
Posted: 4th Mar 2022 0:03
@Game_Code_here

Here is an explanation of what name mangling is.

https://en.m.wikipedia.org/wiki/Name_mangling
Posted: 4th Mar 2022 2:06
Here is an explanation of what name mangling is.


Wow, I learned something new today, I know nothing about dlls.

I do not think There is any reason to learn.

Thank you for showing me.
Posted: 4th Mar 2022 11:33
Thank you for showing me.


You're welcome
Posted: 4th Mar 2022 14:24
If you open the DLL in Notepad., just scroll to the end... there is always a "Garbage Collection" Section (which isn't overly long) then an External Calls (these are Commands called from other DLL) and above that are going to be your Commands.

Mind if you're trying to quickly find the section., just press F3 and type in the name of your plug-in (not what you rename it for AGK., as obviously you have to rename based on platform, but what you originally exported it as... "MyLibrary.DLL" or w/e)

Still as a note., there isn't a need to Decorate Commands unless you're using Multiple for a Single Command.
i.e.

CreateColor( uint32_t Color )
CreateColor( uint8_t R, uint8_t G, uint8_t B )
CreateColor( uint8_t R, uint8_t G, uint8_t B, uint8_t A )

The would then become decorated ("mangled") within the C++ Export table and perhaps export as:
?CreateColor@@YAHXZ ?CreateColor@@YAXHHH ?CreateColor@@YAXHHHH

We can then add these to the command table linked to the same Command in AGK
i.e.
CreateColor, I, I, ?CreateColor@@YAHXZ
CreateColor, I, III, ?CreateColor@@YAXHHH
CreateColor, I, IIII, ?CreateColor@@YAXHHHH

Then within AppGameKit we have 3 Variations of the same Command... this isn't something we can do in C however because it doesn't have Overloading (introduced in C++)., hence the name decoration.
I've not used PureBasic in probably 15 years., frankly it's less of a headache to simply use Microsoft C/C++ but as I recall originally it ONLY exported Undecorated Commands (i.e. C Compatible); but then they added C++ Decorated Support., and this became the default; but by adding "C" to the end of the Procedure Command it switched it back to the original C (undecorated) output.
Posted: 4th Mar 2022 23:37
If you open the DLL in Notepad., just scroll to the end... there is always a "Garbage Collection" Section (which isn't overly long) then an External Calls (these are Commands called from other DLL) and above that are going to be your Commands.


I'll have to get use to what is there. I'm looking at the end now LOL