Wow I've been away for a LOOOOOOOONG time man
Anyways, I'm having trouble getting GetProcAddress to do what I want. I've managed to have it return a valid (and the right) address value for the ordinal value associated with LoadLibraryW, but it won't work for the string "LoadLibraryW". My code:
Javascript code:
var GetModuleHandle = function(ModuleName) {
Print("Getting module handle for " + ModuleName);
return Interop.Call("Kernel32.dll","GetModuleHandleW",ModuleName);
}
var GetProcAddress = function(hModule,ProcName) {
Print("Getting procedure address for " + ProcName);
return Interop.Call("Kernel32.dll","GetProcAddress",hModule,ProcName);
}
This code does return a valid hModule, but the procedure address is zero/NULL for the "LoadLibraryW" string. I've checked the ordinal value on Vista x64 SP2; it's not the same as the XP one. That's why I want this to work with the procedure name, rather than its ordinal value.
I've read the remarks in the MSDN article on GetProcAddress - that's why I came up with the ordinal value thing - but I can't figure out what I'm doing wrong. So, could anyone please help me with this issue?
FTR, I'm on Windows XP x86 SP 3.