

![]() |
![]() |
|
|||||||
![]() |
![]() |
| Reverse Engineering Game hacking discussion and open source development. |
![]() |
|
|
LinkBack | Thread Tools |
![]() |
![]() |
|
|
#1 (permalink) |
|
rol 3905h, 8
Senior Member
Administrator ![]() Inquisitor Join Date: Jul 2004
Location: Canada
Posts: 5,182
![]() |
Thanks to Palomino's notes for clarifying what some parts of this are actually meant for.
Code:
.data
WC3FXN_Text dd 6F663740h
WC3FXN_GlobalClass dd 6F84CC20h
.code
Warcraft_TextOut proc textloc:DWORD
push eax
push edx
push ecx
push 0FFFFFFFFh
;Get the pointer to Warcraft's global class.
mov eax, WC3FXN_GlobalClass
mov eax, dword ptr ds:[eax]
;Get the pointer to the output class.
mov eax, dword ptr ds:[eax+3E0h]
mov edx, dword ptr ds:[eax]
push 0
push 41200000h
lea ecx, dword ptr ss:[esp+08h]
push ecx
;Push the text address.
mov ecx, textloc
push ecx
mov ecx, eax
call dword ptr [WC3FXN_Text]
pop ecx
pop edx
pop eax
ret
Warcraft_TextOut endp
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#6 (permalink) |
|
rol 3905h, 8
Senior Member
Administrator ![]() Inquisitor Join Date: Jul 2004
Location: Canada
Posts: 5,182
![]() |
Code:
void Warcraft_TextOut(DWORD sText)
{
static int WC3FXN_GlobalClass = 0x6F84CC20;
static int WC3FXN_Text = 0x6F663740;
__asm
{
push eax
push edx
push ecx
push 0x0FFFFFFFF
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 0x41200000
lea ecx, dword ptr ss:[esp+0x08]
push ecx
mov ecx, sText
push ecx
mov ecx, eax
call dword ptr [WC3FXN_Text]
pop ecx
pop edx
pop eax
}
}
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#11 (permalink) |
|
Mortal
Join Date: Jan 2008
Posts: 4
![]() |
Code:
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]
}
}
|
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#12 (permalink) |
|
Mortal
Join Date: Jan 2008
Posts: 4
![]() |
Code:
void Warcraft_TextOut(char *cText)
{
static unsigned long WC3CLS_OutputClass = (*(int*)(*(int*)0x6F84CC20+0x3E0));
static unsigned long WC3FXN_PrintText = 0x6F663740;
__asm {
push -1
push 0
push 0x41200000
lea ecx, dword ptr [esp+0x08]
push ecx
push cText
mov ecx, WC3CLS_OutputClass
call dword ptr [WC3FXN_Text]
}
}
I didn't do any work on Warcraft III yet, but this should work. |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#13 (permalink) |
![]() Heretic Join Date: Jul 2008
Posts: 28
![]() |
Do I need some special compiler / library to compile ASM that is integrated to C++?
I wasn't able to compile this code with Dev-C++ 4.9.9.2 so.. Someone explain? ![]()
__________________
In a world without walls and fences, you don't need windows or gates. |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#15 (permalink) |
![]() Heretic Join Date: Jul 2008
Posts: 28
![]() |
Yea google up abit and many other recommend VC++ to compile inline asm too.
Somebody said that syntax of inline assembler in gcc is strange, too. Well, gotta try with VC++ when I'm at home again. Thanks ![]()
__________________
In a world without walls and fences, you don't need windows or gates. |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#16 (permalink) |
![]() Heretic Join Date: Jul 2008
Posts: 28
![]() |
Yea googled up abit and many other recommend VC++ to compile inline asm too.
Somebody said that syntax of inline assembler in gcc is strange, too. Well, gotta try with VC++ when I'm at home again. Thanks ![]() EDIT: Sorry for double post :S
__________________
In a world without walls and fences, you don't need windows or gates. |
|
|
|
![]() |
![]() |
![]() |
![]() |
|
|
#17 (permalink) | |
![]() ![]() ![]() Blessed |
How do you guys think Inline ASM is accomplished? Inline ASM is possible only when the IDE makes use of an ASM compiler/linker. Inline ASM that uses MASM syntax therefore needs MASM compiling tools, which of course are built-in to Microsoft's Visual C++. To check to see if your IDE has the tools required to compile MASM code, search for the utility ml.exe (or ml64.exe for 64-bit compiling).
__________________
Ultimate Guide/Resource/Tutorial/Book Thread
Technobabble! - My Blog About All Things Technological Quote:
|
|
|
|
|
![]() |
![]() |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|