Author Topic: using demo5 by Bryant Keller  (Read 3807 times)

Offline william427

  • Jr. Member
  • *
  • Posts: 23
using demo5 by Bryant Keller
« on: July 31, 2014, 05:25:21 PM »
can you jump out of proc and then return with an answer?
is it allright to jump where I commented ;;;;jump here ?
and will it return to that spot?
thanks


Code: [Select]
proc    Wm_CommandProc
.hwnd    argd
.wparam  argd
.lparam  argd


    cmp      argv(.wparam), dword 201
    je       .cmd_idok
    cmp      argv(.wparam), dword 200
    je       .cmd_idgo
    xor      eax, eax
    ret

.cmd_idok:
    invoke   EndDialog, dword argv(.hwnd), byte 1
    mov      eax, 1
    ret

.cmd_idgo:
    invoke   SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXTLENGTH, dword NULL, dword NULL
    cmp      eax, 0
    jne      .fine
    invoke   MessageBoxA, dword argv(.hwnd), dword szContent, dword szTitle, dword MB_OK | MB_ICONERROR
    mov      eax, 1
    ret

.fine:
    inc      eax
    mov      ecx, eax
    push     eax
    invoke   GetProcessHeap
    mov      [dwHeap], eax
    invoke   HeapAlloc, eax, dword 0x000008, ecx
    mov      [dwText], eax
    pop      eax
    invoke   SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXT, eax, dword dwText
 ;;;;;   jump here
    invoke   SendDlgItemMessageA, dword argv(.hwnd), dword 206, dword WM_SETTEXT, dword 0, dword dwText
    invoke   HeapFree, dword dwHeap, dword 0x000008, dword dwText
    mov      eax, 1
    ret

endproc



Offline william427

  • Jr. Member
  • *
  • Posts: 23
Re: using demo5 by Bryant Keller
« Reply #1 on: July 31, 2014, 05:39:33 PM »
is it ok to alter an rc file?
thanks

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 430
  • Country: us
Re: using demo5 by Bryant Keller
« Reply #2 on: August 01, 2014, 12:21:02 AM »
You are free to jump around "within" the procedure itself ( just remember to use the "dot" notation for labels within the proc.

If you're going to jump "into" a proc from an outside location you should know how the names are mangled depending on the operating system being assembled for.  You must also ensure that you set up the stack properly prior to the jump so that it does not become corrupted when the procedure ends.

Feel free to modify the RC files to your hearts content.  They are just text files that you can edit with a text editor.  Look up the keywords used within those resource files so you understand what each token does.  If you're using Windows there is a tool named ResEd in the nasmx/bin directory that you can use to easily create and/or modify RC files.

Offline william427

  • Jr. Member
  • *
  • Posts: 23
Re: using demo5 by Bryant Keller
« Reply #3 on: August 12, 2014, 02:20:46 PM »
hey yall
is gettext a storage place like a string?and what does dwtext do ?
thanks
william


Code: [Select]
invoke   SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXT, eax, dword dwText


Offline william427

  • Jr. Member
  • *
  • Posts: 23
Re: using demo5 by Bryant Keller
« Reply #4 on: August 12, 2014, 02:33:38 PM »
hey yall
is gettext a storage place like a string?and what does dwtext do ?
thanks
william
is the lParam  of SendDlgItemMessageA the
pointer to the buffer that is to receive the text


Code: [Select]
invoke   SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXT, eax, dword dwText


Offline encryptor256

  • Full Member
  • **
  • Posts: 250
  • Country: lv
  • Win64 .
    • On Youtube: encryptor256
Re: using demo5 by Bryant Keller
« Reply #5 on: August 12, 2014, 02:59:03 PM »
hey yall
is gettext a storage place like a string?and what does dwtext do ?
thanks
william


Code: [Select]
invoke   SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXT, eax, dword dwText


WinAPI home environment is C programming language, that's the place you should start, at least that's my opinion AND that would get you at least somewhere.

Stop using those Dialog Boxes, first you need to learn is basics - creating window and window procedure manually.

This is nice web site to learn WinAPI: theForger's Win32 API Programming Tutorial

Code: [Select]
invoke   SendDlgItemMessageA, dword argv(.hwnd), dword 205, dword WM_GETTEXT, eax, dword dwText
Quote
is gettext a storage place like a string?and what does dwtext do ?

Omg. You have to provide a pointer to place where window text will be stored.

C / C++:
Code: [Select]

char windowText[2048];
SendMessage(windowHandle,WM_GETTEXT,2048,(LPARAM)windowText);

Encryptor256's Investigation \ Research Department.

Offline william427

  • Jr. Member
  • *
  • Posts: 23
Re: using demo5 by Bryant Keller
« Reply #6 on: August 12, 2014, 05:10:08 PM »
thanks so much