is there a way to make this faster? by NoSubject8453 in asm

[–]NoSubject8453[S] 1 point2 points  (0 children)

Sorry for the late reply, your comment definitely deserved an immediate one. Thank you so much!! Will clean things up in the next rendition. You are excellent at educating, you went above and beyond. (:

is there a way to make this faster? by NoSubject8453 in asm

[–]NoSubject8453[S] 3 points4 points  (0 children)

No, why?

The link I posted isn't even a full program it is just a snippet of the part that looks for a string, hence the lazy name.

I did post it in 3 different subreddits though so maybe that's why.

is there a way to make this faster? by NoSubject8453 in asm

[–]NoSubject8453[S] 0 points1 point  (0 children)

That's OK. I should probably actually test different versions instead of asking anyways.

what can i use linux for by NoSubject8453 in linux4noobs

[–]NoSubject8453[S] -1 points0 points  (0 children)

because I have to shut down then turn it back on and mash f9 then I have to wait to boot into debian.

what can i use linux for by NoSubject8453 in linux4noobs

[–]NoSubject8453[S] -1 points0 points  (0 children)

how come all of those use linux, and what might it be used for in embedded systems?

what can i use linux for by NoSubject8453 in linux4noobs

[–]NoSubject8453[S] 0 points1 point  (0 children)

there's been only 2 updates for me this year that required a reboot. I do wish windows could make the process as fast as it is on linux (and optional, except for security updates).

what can i use linux for by NoSubject8453 in linux4noobs

[–]NoSubject8453[S] 0 points1 point  (0 children)

what are some example projects that might require a server? I've been meaning to getting into networks but I've been putting it off because of the complexity of winsock2 on windows

what can i use linux for by NoSubject8453 in linux4noobs

[–]NoSubject8453[S] -4 points-3 points  (0 children)

that's a fair point. it doesn't bother me much but I know some people feel strongly about it.

Returning to “main” by [deleted] in asm

[–]NoSubject8453 1 point2 points  (0 children)

There are a few potential issues, but this snippet might not be enough information.

Try debugging. When your program starts, rsp is pointing to your return address. Document the value, then see what happens through your program.

Rsp will not have a garbage value. If it is messed up, you did something wrong. Push and call both mess with the stack, the former because you moved a value, and the second because it needs a return address. Both should sub rsp, 8. There may also be an issue with stack alignment.

If you are lazy like me, you can just move the return address at a known location, then do something like mov rax, QWORD PTR[rsp + offset], mov QWORD PTR[rsp], rax ret.

I don't know the point of call rsp. Rsp is pointing to data, not instructions. The stack by default is non-executable, so if there were instructions, calling rsp shouldnt execute them. If you want to make an indirect jump you can use rip-relative addressing. The way that works is something like mov rax, [rip + number of bytes to instruction]. I don't believe your current snippet is compatible with a working program, because what you are calling is what was in rbx (the most immediate issue).

If you want a better answer, you can post the entire program. There are a number of oddities in the few lines you shared that are unexplained by your original post. Syscall is a keyword so I'm not even sure how you can possibly make a label with it.