Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add owasp zsc api #10

Closed
Ali-Razmjoo opened this issue Sep 28, 2015 · 4 comments
Closed

add owasp zsc api #10

Ali-Razmjoo opened this issue Sep 28, 2015 · 4 comments

Comments

@Ali-Razmjoo
Copy link

Hello, I'm trying to add an API for generating shellcode, But it getting me some error while adding command line "shellcode zsc" which you can see in line 2701 [i write there] at here
https://github.com/Ali-Razmjoo/gef/commit/04cb3787abd4006715b2691aa9ccecbc00242a24
what am i missing?

@hugsy
Copy link
Owner

hugsy commented Sep 28, 2015

By just a quick look at it, there seems to be an error in your code:
https://github.com/Ali-Razmjoo/gef/blob/04cb3787abd4006715b2691aa9ccecbc00242a24/gef.py#L2129

There is no global function zsc() defined. Did you mean to call self.zscget()?

@Ali-Razmjoo
Copy link
Author

sorry it was little mistake there, but error was not for that
I change some but still have this error [!] Failed to loadshellcode zsc: unsupported operand type(s) for +=: 'NoneType' and 'str'
https://github.com/Ali-Razmjoo/gef/commit/66765188aa99f55264845892810e04d25227f1ab
seems it cannot import shellcode zsc or something

@hugsy
Copy link
Owner

hugsy commented Sep 29, 2015

This is because you didn't add a description to your new command.
For example, if you change it with:

class ShellcodeGenerateCommand(GenericCommand):
    """My awesome command"""
    _cmdline_ = "shellcode zsc"
    _syntax_  = _cmdline_
    def do_invoke(self, argv):
        if len(argv) is 0:
            self.zscgenerate()

I'm pretty sure it will work.

That's because gef builds dynamically the content of the help menu, and uses the __doc__ param which is implicitly defined when you add a description to your class.

@Ali-Razmjoo
Copy link
Author

Thanks for your help, fixed

@hugsy hugsy closed this as completed Sep 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants