View previous topic :: View next topic |
Author |
Message |
gunminiho Expert Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 144 Location: peru
|
Posted: Tue Jul 13, 2010 1:16 pm Post subject: define dword (dd) on c++ |
|
|
OK guys there's some scripts liek this:
[ Code: | ENABLE]
alloc(lol,400)
label check
label return
label skip
lol:
dd 00256315
dd 00256315
dd 00256315
dd 00256315
dd 00256315
dd 00256315
dd 00256315
dd 00256315
dd 00256315
dd 00256315
dd 00256315
dd 00256315
dd 00256315
.
.
.
dd 00
check:
cmp eax,lol
je skip
cmp eax,0
je return
add eax,4
jmp check
return:
jmp Address+6 |
how do i do that dd on C++?
i've seen doing it on builder like this:
Code: |
void __declspec(naked) lol()
{
__asm
{
dd 0x001F6EE0
dd 0x001F72C8
dd 0x001F6EE1
dd 0x001F72C9
.
.
.
|
and then use another naked function to emule this
Code: | check:
cmp eax,lol
je skip
cmp eax,0
je return
add eax,4
jmp check
return:
jmp Address+6 |
and i did it on C++ ( Visual Studio 2008 )
and it throws me an error on dd
Quote: | error C2400: syntax error inline assembly code in 'opcode', found 'constant' |
am i doing something wrong? or isn't dd a way to recreate it.
PS: i already declared a array of DWORDs but it doesn't work.
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Jul 13, 2010 2:10 pm Post subject: |
|
|
just create an array of DWORDS normally outside of the inline asm block
|
|
Back to top |
|
 |
gunminiho Expert Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 144 Location: peru
|
Posted: Tue Jul 13, 2010 3:45 pm Post subject: |
|
|
slovach wrote: | just create an array of DWORDS normally outside of the inline asm block |
i tried it doesn't work
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Jul 13, 2010 5:17 pm Post subject: |
|
|
Code: | #include <Windows.h>
int main()
{
DWORD scrote[] = { 1, 2, 3 };
__asm
{
mov eax, dword ptr [scrote]
mov ecx, dword ptr [scrote + 4]
mov edx, dword ptr [scrote + 8]
nop
}
return 0;
} |
|
|
Back to top |
|
 |
gunminiho Expert Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 144 Location: peru
|
Posted: Tue Jul 13, 2010 6:49 pm Post subject: |
|
|
slovach wrote: | Code: | #include <Windows.h>
int main()
{
DWORD scrote[] = { 1, 2, 3 };
__asm
{
mov eax, dword ptr [scrote]
mov ecx, dword ptr [scrote + 4]
mov edx, dword ptr [scrote + 8]
nop
}
return 0;
} |
|
OK this mov eax, dword ptr [scrote] will put a pointer in scrote.
i dont need that i need to state the real value instead of a pointer to first data.
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Jul 13, 2010 7:54 pm Post subject: |
|
|
the array decays into a pointer, yes.
eax will be 1, not the address of scrote.
same as doing something like:
Code: | #include <Windows.h>
int main()
{
DWORD scrote[] = { 1, 2, 3 };
DWORD butt;
butt = *scrote;
return 0;
} |
but i'm not entirely sure what you're trying to do anyway
|
|
Back to top |
|
 |
gunminiho Expert Cheater
Reputation: 0
Joined: 15 Dec 2008 Posts: 144 Location: peru
|
Posted: Tue Jul 13, 2010 9:02 pm Post subject: |
|
|
slovach wrote: | the array decays into a pointer, yes.
eax will be 1, not the address of scrote.
same as doing something like:
Code: | #include <Windows.h>
int main()
{
DWORD scrote[] = { 1, 2, 3 };
DWORD butt;
butt = *scrote;
return 0;
} |
but i'm not entirely sure what you're trying to do anyway |
holy crap this doesn't worked on Delphi xD!!
and works on C++ !!!!! <3333333333333333333333
i was lazy to test it still <33333
im trying to make a item filter
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Jul 14, 2010 3:46 am Post subject: |
|
|
it's just dereferencing the pointer
if you wanted to move the address into eax, you could use the lea instruction.
|
|
Back to top |
|
 |
|