Results 1 to 6 of 6
  1. #1
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow

    Still in need of help.

    Yay i'm so proud of myself. My first assembly program. I'm sure i've seen nothing yet. But hey, i'm still learning

    Code:
    .386
    .model flat,stdcall
    option casemap:none
    
    
    include\masm32\include\windows.inc
    include\masm32\include\kernel32.inc
    
    includelib\masm32\lib\kernel32.lib
    
    bufferSize = 256
    
    .data
    buffer BYTE bufferSize DUP(?),0
    
    bytesread db ?
    byteswritten db ?
    
    inHandle HANDLE ?
    outHandle HANDLE ?
    
    .code
    main:
    	
    	invoke GetStdHandle,STD_INPUT_HANDLE
    	mov [inHandle],eax
    	invoke GetStdHandle,STD_OUTPUT_HANDLE
    	mov [outHandle],eax
    	
    	
    	push 0
    	push offset bytesread
    	push bufferSize
    	push offset buffer
    	push inHandle
    	call ReadConsole
    	
    	
    	push 0
    	push offset byteswritten
    	push bufferSize
    	push offset buffer
    	push outHandle
    	call WriteConsole
    	
    	push 0
    	call ExitProcess
    end main
    All it does is get's the users input, max 256 characters, and then outputs it.

    I can't seem to find anyway to hold the window open, it just closes right away. If anyone could point me in the right direction here that would be much appreciated.

    I tryed not using that invoke method to calling functions. My program looks really ugly now D:

  2. #2
    zeco's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    683
    Reputation
    12
    Thanks
    78
    My Mood
    Cynical
    Hey. Where are you learning assembly from? Eitherway good job =D. Now i want to learn assembly too xD

    Code:
    .386
    .model flat,stdcall
    option casemap:none
    What does that above part do? Well except the stdcall part, i get that.

  3. #3
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Honestly, I have no idea. I'm not learning from any site specificaly. I just google my problems.

  4. #4
    B1ackAnge1's Avatar
    Join Date
    Aug 2009
    Gender
    male
    Posts
    455
    Reputation
    74
    Thanks
    344
    My Mood
    Cynical
    Just run it from the commandline the way it was meant to

  5. #5
    radnomguywfq3's Avatar
    Join Date
    Jan 2007
    Gender
    male
    Location
    J:\E\T\A\M\A\Y.exe
    Posts
    8,858
    Reputation
    381
    Thanks
    1,823
    My Mood
    Sad
    Call sleep, or run an infinite loop. I.e

    @jmp_recursive1:
    jmp jmp_recursive1

    Run it through as if your a computer, you finish all the instructions up to call WriteConsole, what are you gonig to do now? Suddenly stop for some reason? No, you're going to continue to the instructions which cause you to exit.

    O''yea and remember the callee doesn't always clean-up the stack, it depends what calling convention you use. I believe you're with that, Windows uses the stdcall calling convention, which does clean up the stack after the call. Make sure you're aware of the function you're using, and which calling convention it uses. Provided the stack address grows:

    push SomeParamater
    call ThisUsesTheCDeclConvention
    sub esp, 4(provided the first parameter was a DWORD)
    Last edited by radnomguywfq3; 12-11-2009 at 10:05 AM.



    There are two types of tragedies in life. One is not getting what you want, the other is getting it.

    If you wake up at a different time in a different place, could you wake up as a different person?


  6. The Following User Says Thank You to radnomguywfq3 For This Useful Post:

    Void (12-11-2009)

  7. #6
    Obey's Avatar
    Join Date
    Jan 2008
    Gender
    male
    Location
    The Magical Mushroom
    Posts
    24,850
    Reputation
    1117
    Thanks
    3,486
    My Mood
    Buzzed
    Jeta, you too smart brah :/

Similar Threads

  1. [Help Request] FET I NEED YOUR HELP! PM ME!
    By FetJr in forum Combat Arms Help
    Replies: 3
    Last Post: 07-08-2011, 09:29 AM
  2. [Help Request] need serious help guys
    By pyrozombie in forum Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    Replies: 7
    Last Post: 06-09-2011, 10:29 AM
  3. [Help Request] Need some help to make a bot
    By Domo in forum Vindictus Help
    Replies: 6
    Last Post: 05-21-2011, 10:15 AM
  4. [Help Request] I need some help with binding eps7
    By v1zhaixingv1 in forum Vindictus Help
    Replies: 3
    Last Post: 05-18-2011, 09:25 PM
  5. [Help Request] please i need ur help norton deleted (crossfire.exe) and the game stoped
    By nooraleman in forum CrossFire Help
    Replies: 22
    Last Post: 05-14-2011, 07:00 PM