 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
gunminiho Expert Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 144 Location: peru
|
Posted: Sat Apr 24, 2010 8:06 pm Post subject: AA to ASM code |
|
|
hey guys i need some help on converting an AA script on to ASM can some one please translate it :S if its posible in delphi otherwise if not C/C++ i'll try my best to translate C/C++ to delphi
Code: | [enable]
alloc(ItemEdit, 256)
label(CS)
label(back)
registersymbol(counter)
alloc(counter, 64)
counter:
db 00 00
ItemEdit:
mov [counter], eax
cmp eax,1F72C8 //Blue Arrows
je CS
cmp eax,1F6EE0 //Brown Arrows
je CS
cmp eax,3D7E3C //MonsterCards
je CS
@@@@@@@
mov [edi+34],eax
mov edi, [ebp-14]
jmp 49421b
CS:
mov [edi+34],0
mov edi, [ebp-14]
jmp back
4956F8:
jmp ItemEdit
nop
back:
[disable]
4956F8:
mov [edi+34], eax
mov edi, [ebp-14]
|
this is what i think it'll be on delphi
Code: | procedure ItemFilter(ItemIDHex:String); stdcall;
label
CS,
back;
var
ItemEditAddy:DWORD;
Counter:DWORD;
CounterAddy:DWORD;
begin
/////CounterAddy:=VirtualAlloc(nil,64,$1000 | $2000,PAGE_EXECUTE_READWRITE);
CounterAddy:=@Counter;
VirtualProtect(pointer($CounterAddy), 4, PAGE_EXECUTE_READWRITE, nil)
PByte(@CounterAddy)^:=$00;
PByte(@CounterAddy+1)^:=$00;
asm
ItemEdit:
mov [counter], eax
cmp eax,$ItemIDHex //Blue Arrows
je CS
mov [edi+$34],eax
mov edi, [ebp-$14]
jmp $49421b
CS:
mov [edi+$34],0
mov edi, [ebp-$14]
jmp [back]
$4956F8:
jmp [ItemEdit]
nop
back:
end; |
[disable]
4956F8:
mov [edi+34], eax
mov edi, [ebp-14]
i have no idea about disable part
|
|
Back to top |
|
 |
NoMercy Master Cheater
Reputation: 1
Joined: 09 Feb 2009 Posts: 289
|
Posted: Sun Apr 25, 2010 1:49 am Post subject: |
|
|
I dont't know Delphi, but works like C++, your code isn't going to do, what it you want it to do.
The adress 004( i blieve) is a jump, so you need a jmp
jmp to
and from the asm part you have to make a jmp back +5 of adress
and adress +6 is a nop, so 0x90 in hex
If u use the CE search thing you can find a few c++ versions of AA->ASM and you will understand what i wrote
|
|
Back to top |
|
 |
gunminiho Expert Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 144 Location: peru
|
Posted: Sun Apr 25, 2010 10:45 am Post subject: |
|
|
NoMercy wrote: | I dont't know Delphi, but works like C++, your code isn't going to do, what it you want it to do.
The adress 004( i blieve) is a jump, so you need a jmp
jmp to
and from the asm part you have to make a jmp back +5 of adress
and adress +6 is a nop, so 0x90 in hex
If u use the CE search thing you can find a few c++ versions of AA->ASM and you will understand what i wrote |
believe me i did i basicly know what i have to do ( in theory ) but all i readed was on C++ so this what i did:
Code: | procedure ItemFilterASM; stdcall;
label
CS,
back;
var
Counter;
begin
Counter:=0;
asm
ItemEdit:
MOV DWORD PTR[Counter], EAX
//Arrows
CMP EAX, $1F6EE0 //Arrow for Bow
je CS
CMP EAX, $1F72C8 //Arrow for Crossbow
je CS
CMP EAX, $1F6EE1 //Bronze Arrow for Bow
je CS
CMP EAX, $1F72C9 //Bronze Arrow for Crossbow
je CS
//Potions
CMP EAX, $1E8480 //Red Potion
je CS
CMP EAX, $1E8481 //Orange Potion
je CS
CMP EAX, $1E8482 //White Potion
je CS
CMP EAX, $1E8483 //Blue Potion
je CS
CMP EAX, $1E8486 //Mana Elixer
je CS
CMP EAX, $1E8487 //Red Pill
je CS
CMP EAX, $1E8488 //Orange Pill
je CS
CMP EAX, $1E8489 //White Pill
je CS
CMP EAX, $1E848A //Blue Pill
je CS
CMP EAX, $1E848B //Mana Elixer Pill
je CS
CMP EAX, $1E8484 //Elixer
je CS
CMP EAX, $1E8485 //Power Elixer
je CS
CMP EAX, $1F47D4 //All Cure Potion
je CS
CMP EAX, $1F47D0 //Antidote
je CS
CMP EAX, $1F47D1 //Eye Drop
je CS
CMP EAX, $1F47D3 //Holy Water
je CS
CMP EAX, $1F47D2 //Tonic
je CS
CMP EAX, $1E8C50 //Dexterity Potion
je CS
CMP EAX, $1E8C52 //Magic Potion
je CS
CMP EAX, $1E8C55 //Sniper Potion
je CS
CMP EAX, $1E8C51 //Speed Potion
je CS
CMP EAX, $1E8C54 //Warrior Potion
je CS
CMP EAX, $1E8C53 //Wizard Potion
CMP EAX, $1E8C59 //Dexterity Pill
je CS
CMP EAX, $1E8C57 //Magic Pill
je CS
CMP EAX, $1E8C58 //Sniper Pill
je CS
CMP EAX, $1E8C5A //Speed Pill
je CS
CMP EAX, $1E8C56 //Warrior Pill
je CS
CMP EAX, $1EAB93 //Orange
je CS
CMP EAX, $1EAB94 //Lemon
je CS
//Mini-Game Items
CMP EAX, $1D7E3C //Monster Card
je CS
CMP EAX, $1D7E3D //Bloctopus Omok Piece
je CS
CMP EAX, $1D7E31 //Mushroom Omok Piece
je CS
CMP EAX, $1D7E3A //Octopus Omok Piece
je CS
CMP EAX, $1D7E39 //Omok Table
je CS
CMP EAX, $1D7E3F //Panda TeCMP EAX, $y Omok Piece
je CS
CMP EAX, $1D7E3B //Pig Omok Piece
je CS
CMP EAX, $1D7E3E //Pink TeCMP EAX, $y Omok Piece
je CS
CMP EAX, $1D7E30 //Slime Omok Piece
je CS
CMP EAX, $1D7E40 //Trixter Omok Piece
je CS
//Ores
CMP EAX, $1D3013 //Adamantium Ore
je CS
CMP EAX, $1D3010 //Bronze Ore
je CS
CMP EAX, $1D3012 //Mithril Ore
je CS
CMP EAX, $1D3015 //Orihalcon Ore
je CS
CMP EAX, $1D3014 //Silver Ore
je CS
CMP EAX, $1D3011 //Steel Ore
je CS
//Jewel Ores
CMP EAX, $1D5721 //Amethyst Ore
je CS
CMP EAX, $1D5722 //Aquamarine Ore
je CS
CMP EAX, $1D5723 //Emerald Ore
je CS
CMP EAX, $1D5720 //Garnet Ore
je CS
CMP EAX, $1D5724 //Opal Ore
je CS
CMP EAX, $1D5725 //Sapphire Ore
je CS
CMP EAX, $1D5726 //Topaz Ore
je CS
MOV DWORD PTR[edi+34],eax
MOV EDI, DWORD PTR[ebp-14]
JMP 50421B
CS:
MOV DWORD PTR[edi+34],0
MOV EDI, DWORD PTR[ebp-14]
JMP back
end; |
Code: | procedure creaItemFilter; stdcall;
begin
PByte(ItemFilter)^:=$E9;
PDword(ItemFilter+1)^:=jmp($0050E851,ItemFilter);
end; |
and this doesn't compile i get an error in every "je CS"
in creaItemFilter, the problem is that jmp is seted to get 2 Integer values so when i just put it like: ItemFilter, i get an error about Integer and Procedure incompatibility types, OK i said then i use @ to get addy from it
and when i use
Code: | PDword(ItemFilter+1)^:=jmp($0050E851,@ItemFilter); |
i get an error about: Integer and Poiner incompatibility types!!!!
and i dont know what to do with counter label and ItemEdit Label :S
i also got this script which in theory will be same thing
Code: | Alloc(filter,124)
label(ifreject)
label(end)
label(skip)
Alloc(iftable,16024)
label(ifexit)
filter:
push ebx
push esi
xor ebx, ebx
mov esi,iftable
ifreject:
cmp eax,[esi]
je skip
cmp [esi],ebx
je end
add esi,4
jmp ifreject
skip:
mov eax,00
end:
pop esi
pop ebx
mov [edi+34], eax
mov edi, [ebp-14]
jmp ifexit
iftable:
//Usable Items
dd 1F6EE0 //Arrow for Bow
dd 1F72C8 //Arrow for Crossbow
dd 1F6EE1 //Bronze Arrow for Bow
dd 1F72C9 //Bronze Arrow for Crossbow
//Potions
dd 1E8480 //Red Potion
dd 1E8481 //Orange Potion
dd 1E8482 //White Potion
dd 1E8483 //Blue Potion
dd 1E8486 //Mana Elixer
dd 1E8487 //Red Pill
dd 1E8488 //Orange Pill
dd 1E8489 //White Pill
dd 1E848A //Blue Pill
dd 1E848B //Mana Elixer Pill
dd 1E8484 //Elixer
dd 1E8485 //Power Elixer
dd 1F47D4 //All Cure Potion
dd 1F47D0 //Antidote
dd 1F47D1 //Eye Drop
dd 1F47D3 //Holy Water
dd 1F47D2 //Tonic
dd 1E8C50 //Dexterity Potion
dd 1E8C52 //Magic Potion
dd 1E8C55 //Sniper Potion
dd 1E8C51 //Speed Potion
dd 1E8C54 //Warrior Potion
dd 1E8C53 //Wizard Potion
dd 1E8C59 //Dexterity Pill
dd 1E8C57 //Magic Pill
dd 1E8C58 //Sniper Pill
dd 1E8C5A //Speed Pill
dd 1E8C56 //Warrior Pill
dd 1EAB93 //Orange
dd 1EAB94 //Lemon
//Rocks
//dd 3D2071 //The Summoning Rock
//dd 3D2070 //The Magic Rock
//Mini-Game Items
dd 3D7E3C //Monster Card
dd 3D7E3D //Bloctopus Omok Piece
dd 3D7E31 //Mushroom Omok Piece
dd 3D7E3A //Octopus Omok Piece
dd 3D7E39 //Omok Table
dd 3D7E3F //Panda Teddy Omok Piece
dd 3D7E3B //Pig Omok Piece
dd 3D7E3E //Pink Teddy Omok Piece
dd 3D7E30 //Slime Omok Piece
dd 3D7E40 //Trixter Omok Piece
//Ores
dd 3D3013 //Adamantium Ore
dd 3D3010 //Bronze Ore
//dd 3D3016 //Gold Ore
dd 3D3012 //Mithril Ore
dd 3D3015 //Orihalcon Ore
dd 3D3014 //Silver Ore
dd 3D3011 //Steel Ore
//Jewel Ores
dd 3D5721 //Amethyst Ore
dd 3D5722 //Aquamarine Ore
//dd 3D5728 //Black Crystal Ore
//dd 3D5727 //Diamond Ore
dd 3D5723 //Emerald Ore
dd 3D5720 //Garnet Ore
dd 3D5724 //Opal Ore
dd 3D5725 //Sapphire Ore
dd 3D5726 //Topaz Ore
dd 00
00491571:
jmp filter
db 90
ifexit:
[DISABLE]
dealloc(filter)
dealloc(IFTable)
0050E851: //89 47 34 8B 7D ?? 8B CE E8 ?? ?? ?? ?? 89 47 ?? 8B
MOV [EDI+34], EAX
MOV EDI, [EBP-14] |
but i got a huge doubt how the hell do i simule Quote: | dd 3D3011 //Steel Ore? in ASM??? |
Last edited by gunminiho on Sun Apr 25, 2010 11:06 am; edited 1 time in total |
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sun Apr 25, 2010 10:54 am Post subject: |
|
|
dd just meant define DWORD im or something like that, if you just make an array of DWORD's like
DWORD dwRejects = { 0x101010, 0x0101020, etc... };
and use that as 'iftable' then it would work the same.
_________________
|
|
Back to top |
|
 |
gunminiho Expert Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 144 Location: peru
|
Posted: Sun Apr 25, 2010 11:13 am Post subject: |
|
|
lurc wrote: | dd just meant define DWORD im or something like that, if you just make an array of DWORD's like
DWORD dwRejects = { 0x101010, 0x0101020, etc... };
and use that as 'iftable' then it would work the same. |
:O that's pretty usefull :O
another question can i make a source code dynamic? i mean let's say i have a GUI to user add some hex values to an array, then i wanna use all that values on an __inline asm?
something like: DWORD dwRejects = { 0x101010, 0x0101020,0x0101030, etc...};
and then use:
procedure lol; stdcall;
begin;
asm
CMP EAX, dwRejects[0] //Arrow for Bow
je CS
CMP EAX,dwRejects[1] //Arrow for Crossbow
je CS
CMP EAX, dwRejects[2] //Bronze Arrow for Bow
je CS
.
.
.
CMP EAX, dwRejects[n] //Bronze Arrow for Crossbow
je CS
end;
something like that? can i make it?
and how do i simule this?
Code: | Alloc(filter,124)
label(ifreject)
label(end)
label(skip)
Alloc(iftable,16024)
label(ifexit) |
EDITED:
OK i solved __inline asm problem at delphi but now the only problem is:
Code: | procedure creaItemFilter; stdcall;
begin
PByte(ItemFilter)^:=$E9;
PDword(ItemFilter+1)^:=jmp($0050E851,ItemFilterASM);
end; |
im getting this error: " incompatibility types: Cardinal and 'Pointer,Untyped Pointer,Untyped parameter' "
EDITED2:
tried to fix this is way:
Code: | procedure creaItemFilter; stdcall;
var
punteroProc: procedure(parametro: boolean; otro: string);
begin
punteroProc:=@ItemFilterASM;
PByte(ItemFilter)^:=$E9;
PDword(ItemFilter+1)^:=jmp($0050E851,punteroProc);
end; |
but still fails i get this error o.o: not enough actual parameters
and this is my jmp function:
Code: | function jmp(from,too:DWORD): DWORD;
var
jmpto:dword;
begin
jmpto:=dword(from)-NativeInt(too)-5;
Result := jmpto;
end; |
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|