There's a few different ways. You can either go all-out and write and inject a DLL that sends information back and forth between processes--sockets, named pipes, shared memory, Windows messages--or, if you're only going to be needing the return value every so often, as with GetNumLootItems or something, you can put what you want to be returned into the EAX register, RETN, and then call kernel32.GetExitCodeThread(hThread);.
For instance, say you inject code that does something like:
Code:
CALL wow.GetNumLootItems ;return value will be in EAX
RETN
and execute it using CreateRemoteThread. Your code might look like:
Code:
//do whatever injection up here somewhere
HANDLE hThread = CreateRemoteThread(..whatever);
WaitForSingleObject(hThread, INFINITE);
DWORD dwNumLootItems = GetExitCodeThread(hThread);
CloseHandle(hThread);
Now dwNumLootItems holds the exit code, or value of EAX upon RETN, of your injected thread. Make sense?