GetProcAddress and problem in unicode

Just starting out? Need help? Post your questions and find answers here.
Fredi
Enthusiast
Enthusiast
Posts: 143
Joined: Wed Jul 23, 2008 10:45 pm

GetProcAddress and problem in unicode

Post by Fredi »

Hi

M$ doesn't support unicode in GetProcAddress API unfortunately so how can we fix this problem? I used PBOSL_LoadDllMemory but it doesn't work too in unicode...

I using this API for start hook, this is example:

Code: Select all

#WH_CALLWNDPROCRET = 12 

threadID = GetWindowThreadProcessId_(WindowID, @processID)
hDLL = OpenLibrary(0,"c:\1.dll")

SetWindowsHookEx_(#WH_CALLWNDPROCRET, GetProcAddress_(hDLL, "MyCallWndRetProc"), hDLL, threadID)
Any idea?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Code: Select all

#WH_CALLWNDPROCRET = 12

threadID = GetWindowThreadProcessId_(WindowID, @processID)
hDLL = OpenLibrary(0,"c:\1.dll")
function_u.s = "MyCallWndRetProc"
function_a.s = Space(StringByteLength(function_u, #PB_Ascii) + 1)
PokeS(@function_a, function_u, -1, #PB_Ascii)
SetWindowsHookEx_(#WH_CALLWNDPROCRET, GetProcAddress_(hDLL, @function_a), hDLL, threadID)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Fredi
Enthusiast
Enthusiast
Posts: 143
Joined: Wed Jul 23, 2008 10:45 pm

GetProcAddress and problem in unicode

Post by Fredi »

Many many thanks thomas, you are a kind man :D
Fred
Administrator
Administrator
Posts: 18167
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Is there a problem with GetFunction() ?

Code: Select all

SetWindowsHookEx_(#WH_CALLWNDPROCRET, GetFunction(0, "MyCallWndRetProc" ), hDLL, threadID) 
Post Reply