The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: mkdev on February 04, 2007, 01:49:14 PM

Title: pls help about this if you can
Post by: mkdev on February 04, 2007, 01:49:14 PM
pls help about this if you can   

MOV                ESI,OFFSET LOC_00416F58     "unikey-123132"- i whant to set this   in the dialog but  i get some error for that ?
pls help  :red thanks

i  ?
TEST               EAX,EAX
JLE                LOC_00405DAE
MOV                ECX,DWORD PTR [ESP+018h]
MOV                ESI,OFFSET LOC_00416F58
          mov  edi, esi
LOC_00405DAE: ;Ref: 00405D5B
     
      INVOKE SetDlgItemText, hWnd, IDC_SERIAL,esi



Title: Re: pls help about this if you can
Post by: dsouza123 on February 04, 2007, 04:12:02 PM
If the string (zero terminated) is in the .data section then the following would work.

.data
  szKey  db "unikey-123132",0


.code
  INVOKE SetDlgItemText, hWnd, IDC_SERIAL, ADDR szKey
Title: Re: pls help about this if you can
Post by: mkdev on February 04, 2007, 04:23:18 PM

.DATA


LOC_0040F34C    dd        020030424h
LOC_00413C5C   TCHAR    'UNIKEY-%08X',0   


INVOKE SetDlgItemText, hWnd, IDC_SERIAL, ADDR szKey

still same not working ?? im confuesd ??
Title: Re: pls help about this if you can
Post by: dsouza123 on February 04, 2007, 04:47:24 PM
Not sure what TCHAR is but at the very least

the code

INVOKE SetDlgItemText, hWnd, IDC_SERIAL, ADDR szKey    ; szKey was just an example, your variable name needs to be used

would be

INVOKE SetDlgItemText, hWnd, IDC_SERIAL, ADDR LOC_00413C5C
Title: Re: pls help about this if you can
Post by: mkdev on February 04, 2007, 04:57:00 PM
look the code i get ok number , but i when is CALL _SetDlgItemTextA@12h (INVOKE SetDlgItemText, hWnd, IDC_SERIAL, LOC_00413C5C)    i get error
how set the number to the dialog ?   :eek thanks for helping me 


  MOV EDX,DWORD PTR DS:[LOC_0040F34Ch]
  OR EDX,ECX
  PUSH EDX
  PUSH LOC_00413C5Ch
  PUSH LOC_00416F58h
  CALL _wsprintfAh
  ADD ESP,0Ch
  PUSH LOC_00416F58h
  CALL _lstrlenW@4h
  MOV ECX,DWORD PTR SS:[ESP+1Ch]
  CMP EAX,ECX
  JLE L013
  MOV EAX,ECX
L013:
  TEST EAX,EAX
  JLE L017
  MOV ECX,DWORD PTR SS:[ESP+18h]
  MOV ESI,LOC_00416F58h                        (ASCII "UNIKEY-20030424")
L017:
  PUSH 0h
  MOV AL,BYTE PTR DS:[LOC_00413C5Ch]       
  MOVZX AX,AL
  PUSH AX
  PUSH 195h
  PUSH DWORD PTR SS:[EBP+8h]
  CALL _SetDlgItemTextA@12h
  MOV EAX,1h
  JMP L031
  PUSH ??001Bh
  PUSH 195h
  PUSH DWORD PTR SS:[EBP+8h]
  CALL _SetDlgItemTextA@12h
  MOV EAX,0h
L031:
  POP EDI
  POP ESI
  POP EBX
  LEAVE
  RET 4h
Title: Re: pls help about this if you can
Post by: dsouza123 on February 04, 2007, 06:09:04 PM
A good example of SetDlgItemText is the dialog.asm and rsrc.rc files
from Iczelion's tutorial 10-2 that comes with MASM32.

The tutorials are a very good place to look for readable working code
that target various common topics.
Title: Re: pls help about this if you can
Post by: rags on February 04, 2007, 06:11:49 PM
If I understand your question correctly, If you want to send a number to the control on the dialog you would use:

invoke SetDlgItemInt ,hWnd, IDC_SERIAL, ADDR LOC_00413C5C, FALSE ;<-true if you want a signed number


regards,
     Rags
Title: Re: pls help about this if you can
Post by: BogdanOntanu on February 04, 2007, 09:09:33 PM
mkdev,

The code you show here looks very much like a dis assembly of a program that you did not write...
This is against the rules ... please explain :D

Title: Re: pls help about this if you can
Post by: mkdev on February 04, 2007, 09:23:00 PM
sorry im biginer in masm
Title: Re: pls help about this if you can
Post by: Tedd on February 05, 2007, 12:53:43 PM
keygen??
Title: Re: pls help about this if you can
Post by: hutch-- on February 05, 2007, 06:05:24 PM
The answer of being a beginner is not satisfactory under the forum rules so the topic hasd been closed.