oMBRa Posted November 16, 2008 Share Posted November 16, 2008 Hi, can anyone translate this code to autoit? void TextOut(char * text,DWORD msgtype,float StayUpTime) // prints text to the chat/ chatlog { DWORD TextToScreen = 0x6F2FA900; DWORD TextToChatLog = 0x6F34E100; DWORD plNum = GetPlayerNumber(); __asm { MOV EAX, DWORD PTR DS:[0x6FAA1988]; PUSH StayUpTime; PUSH msgtype; PUSH text; PUSH plNum; MOV ECX,EAX; CALL TextToScreen; PUSH msgtype; PUSH text; PUSH plNum; MOV EAX, DWORD PTR DS:[0x6FAA1988]; MOV EAX, DWORD PTR SS:[EAX+0x23C]; MOV EAX, DWORD PTR DS:[EAX+0xC]; MOV ECX,EAX; CALL TextToChatLog; } } if is not possible translate it, can anyone make a dll ? Link to comment Share on other sites More sharing options...
monoceres Posted November 16, 2008 Share Posted November 16, 2008 (edited) Not possible in autoit since you can't do assembly in it. Not possible to compile a dll either since there are unknown identifiers in the code (GetPlayerNumber() etc). Edited November 16, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
trancexx Posted November 16, 2008 Share Posted November 16, 2008 Not possible in autoit since you can't do assembly in it.Not possible to compile a dll either since there are unknown identifiers in the code (GetPlayerNumber() etc).I think that you are wrong about assembly.If we could get Ward to talk you wuld see that it's very possible to manipulate with that. Ward showed few examples of that.Who is Ward? This guy. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
monoceres Posted November 16, 2008 Share Posted November 16, 2008 I think that you are wrong about assembly.Yeah, I know. I wasn't specific. I was talking about inline assembly which allows you to call functions in your regular language from the assembly code.What ward does is using compiled machine code and using some trick with CallWindowProc to achieve the result. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
MilesAhead Posted November 16, 2008 Share Posted November 16, 2008 There are several issues. Hard coded addresses such as x6F2FA900 won't be there when you make a dll. You would have to change the function to include paramaters for any external functions you need. Then you also have C++ "name mangling" so your public function should be declared with extern C modifier. Then you'd need to make sure the public function in the dll used the same calling convention as the code that calls it expects. Probably safest to use the same conventions as WinApi calls. Then again it would depend on what other functions this function needs to call and where they are. I'm assuming it's a stand-alone .exe file. If you have the source to the ancillary functions it may be easier just to code 'em all in assembler and make a .dll that way. My Freeware Page Link to comment Share on other sites More sharing options...
oMBRa Posted November 16, 2008 Author Share Posted November 16, 2008 (edited) if u can try to compile this to dll: void Warcraft_TextOut(char *cText) { static unsigned long WC3FXN_GlobalClass = 0x6F84CC20; static unsigned long WC3FXN_Text = 0x6F663740; __asm { push 0FFFFFFFFh mov eax, WC3FXN_GlobalClass mov eax, dword ptr ds:[eax] mov eax, dword ptr ds:[eax+0x3E0] mov edx, dword ptr ds:[eax] push 0 push 41200000h mov ecx, esp lea ecx, dword ptr ss:[ecx+0x08] push ecx mov ecx, cText push ecx mov ecx, eax call dword ptr [WC3FXN_Text] } } Edited November 16, 2008 by oMBra Link to comment Share on other sites More sharing options...
monoceres Posted November 16, 2008 Share Posted November 16, 2008 Hmm, well here's the dll (feeling generous). Since I felt that those hard coded addresses were suspicious I made them into parameters instead. Here's how to call it: DllCall("RandomDll.dll","none:cdecl","str","blabla","ulong",0x6F84CC20,"ulong",0x6F663740) RandomDll.dll Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
oMBRa Posted November 16, 2008 Author Share Posted November 16, 2008 (edited) I get this: Incorrect number of parameters in function call. and thx for your help Edited November 16, 2008 by oMBra Link to comment Share on other sites More sharing options...
monoceres Posted November 16, 2008 Share Posted November 16, 2008 I get this:Incorrect number of parameters in function call.Oops, sorry. Forgot the function name DllCall("RandomDll.dll","none:cdecl","Warcraft_TextOut","str","blabla","ulong",0x6F84CC20,"ulong",0x6F663740) Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 16, 2008 Moderators Share Posted November 16, 2008 (edited) I get this:Incorrect number of parameters in function call. and thx for your helpDo you know how to use the DllCall function? He's just giving you a rough example (incorrect format mind you (forgot: Warcraft_TextOut)).Edit:See, monoceres to your rescue. Edited November 16, 2008 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
oMBRa Posted November 16, 2008 Author Share Posted November 16, 2008 (edited) since the code I posted hooks a function of a game, I think the memory should be opened before or the dll wont work, so if u can modify it adding a memory open, I would be glad. I think this will help if u have to get the pid: process name = ''war3.exe'' Edited November 16, 2008 by oMBra Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 16, 2008 Moderators Share Posted November 16, 2008 since the code I posted hooks a function of a game, I think the memory should be opened before or the dll wont work, so if u can modify it adding a memory open, I would be glad.I think this will help if u have to get the pid: process name = ''war3.exe''Gift horse? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
oMBRa Posted November 16, 2008 Author Share Posted November 16, 2008 yes I know but, it wont work unless the process is opened, and I dont know how to do it in C++ Link to comment Share on other sites More sharing options...
monoceres Posted November 16, 2008 Share Posted November 16, 2008 (edited) I have a strong feeling that that code is meant to be injected into the target process... Edited November 16, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
oMBRa Posted November 17, 2008 Author Share Posted November 17, 2008 basicaly that code should make appear some text on the screen of a game, like if I have wrote it Link to comment Share on other sites More sharing options...
monoceres Posted November 17, 2008 Share Posted November 17, 2008 basicaly that code should make appear some text on the screen of a game, like if I have wrote itThen you must definitely must be in that games address space. Thus this is impossible (at least using that code) in autoit. So this topic is really not relevant anymore. Maybe try a C++ forum instead. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now