When I have something like this:


alloc(asdf, 00000000000)

asdf:
cmp __________,333333
jne 111111

111111:
__________
__________


The code in 111111 is being executed even if _________ is equal to 333333. How would I make it so the code in 111111 is only executed when __________ isn't equal to 333333?

Posted on 2006-09-17 13:50:55 by blounder

asdf:
cmp __________,333333
je 222222

111111:
__________
__________
222222:
Posted on 2006-09-17 14:46:07 by Kvant
For some reason that isn't working for me. Could someone else reply and confirm?
Posted on 2006-09-17 16:21:27 by blounder

When I have something like this:


alloc(asdf, 00000000000)

asdf:
cmp __________,333333
jne 111111

111111:
__________
__________


The code in 111111 is being executed even if _________ is equal to 333333. How would I make it so the code in 111111 is only executed when __________ isn't equal to 333333?




The problem lies within the fact that you do not offer an alternative branch after "jne 111111", so the next set of instructions will be the branch you are trying to avoid.

Make it more like this....


alloc(asdf, 00000000000)

asdf:
cmp __________,333333 ;Is it equal to "333333"?
je 333333 ;If so, bypass the next code block

111111:
__________
__________
jmp end ;branch to make sure that 333333 isn't executed

333333:
;this bypasses the code block for 111111

end:
;do some function clean-up stuff here and return from the function
Posted on 2006-09-17 16:40:03 by SpooK
What If I'm looping. My code is supposed to scan and execute something when a value isn't equal to 0. 22222222 is executed even if =/= 0.


alloc(x, 1024)
alloc(y, 1024)
alloc(z, 1024)

x:
___________
mov eax,[11111111]
cmp ,0
Je y
___________

22222222:
___________
jmp z

y:
___________
mov eax,[11111111]
cmp ,0
Je x
___________

z:
___________
Posted on 2006-09-17 17:27:26 by blounder
Maybe the following line contains an error:
mov eax,[11111111]

Are you sure it's not supposed to be like this?
mov eax,11111111
Posted on 2006-09-17 17:51:07 by Kvant

Maybe the following line contains an error:
mov eax,[11111111]

Are you sure it's not supposed to be like this?
mov eax,11111111


I can guarantee you that Kvant is correct. Putting values in brackets (like [11111111]) tends to specify a memory address instead of an immediate value.

mov eax,[11111111] ;Load DWORD value from memory address @ 1111:1111
mov eax,11111111 ;Put immediate value of "11111111" into EAX

At any rate, blounder, your code shows some serious logic flaws in what you are trying to achieve at both instruction and algorithm levels. I would suggest learning Assembly Language basics more thoroughly before proceeding with this coding attempt.
Posted on 2006-09-17 18:38:03 by SpooK
I am specifying a memory address  :sad:


alloc(Scan, 1024)
alloc(Redirect, 1024)
alloc(End, 1024)

Scan:
push eax
mov eax,[11111111]
cmp ,0
Je Redirect
pop eax

55555555:
nop
jmp End

Redirect:
push eax
mov eax,[11111111]
cmp ,0
Je Scan
pop eax

End:



Maybe someone could revise this code? What it does is if 11111111 offset 123 =/= 0 55555555 is supposed to get nopped. I read a few tutorials yesterday and I wanted to try something out. It is so hard finding good tutorials on the internet  :sad:
Posted on 2006-09-17 20:12:59 by blounder

I read a few tutorials yesterday and I wanted to try something out. It is so hard finding good tutorials on the internet  :sad:


Oh my... what do we have here :?:

What I expected, yet didn't want to hear. I gave you the benefit of the doubt, but you rammed your foot right back into your mouth.

You have all but confirmed that, foremost, you don't know what you are doing with assembly language... especially the code you are referencing. What this foremost suggestion leads to, which is of more importance, is that you are meddling with something low-level that is beyond your comprehension... but for a specific reason.

I mean, you don't walk into a place you never have been, in an attempt to look for something you never seen before with the honest expectation of success :roll:

All subtle hints and sarcasm aside. We know you are trying to exploit GMS using the Auto Assembler scripting mechanism. Bottom line, we don't support such malicious and *lame* activities here... nor do we tolerate 2-bit requests from script kiddies who have ignored the simple requirement of reading and adhering the Community Rules.

Nothing annoys me more than people who do not read or respect the rules of others... especially at the expense of the host's generous nature. Now I know I placed a link to those darn rules somewhere obvious... oh... maybe in the THE REGISTRATION AGREEMENT YOU WERE REQUIRED TO READ... for starters. As far as I am concerned, you purposefully tried to deceive us in order to obtain the information you need by circumventing our rules.

You are right about one thing though, blounder, it is really hard to find good tutorials... especially with all the script-kiddie e-trash floating around the net.

Now take your lame-*** script-kiddie trash on out of here (start asking legit questions) before I throw you out (permanent ban).

Topic locked, pending deletion. Have a nice day :D
Posted on 2006-09-17 21:17:55 by SpooK
Geez.

Making a new account and editing label names etc. just isn't good enough. HOW STUPID do you think we are?
Posted on 2006-09-18 06:41:17 by f0dder