flat assembler
Message board for the users of flat assembler.

Index > Windows > Working/not Working App


-read post first- What's your Windows?
XP Pro
0%
 0%  [ 0 ]
XP Home
9%
 9%  [ 1 ]
XP Pro SP2
63%
 63%  [ 7 ]
XP Home SP2
9%
 9%  [ 1 ]
XP Pro x64
9%
 9%  [ 1 ]
Vista
0%
 0%  [ 0 ]
I don't think it's related
9%
 9%  [ 1 ]
Total Votes : 11

Author
Thread Post new topic Reply to topic
Daedalus



Joined: 25 Mar 2007
Posts: 52
Daedalus
Hey guys, me again,

So I created this app with the help of some on the forum now here, it works and looks nice!

Well it "works" On some systems it works, on other system, the program doesn't show up.

Eh?

So here's the code:
Code:
;Program:        KeygenTemplate
;Author:         Clockowl
;Description:    Keygen template for crackmes
;                Thanks goto tgrysztar and LocoDelAssembly Very Happy

format PE GUI 4.0
entry start

include 'win32a.inc'

section '.data' data readable writeable
  IDKEY  = 101
  IDNAME = 102
  IDGEN  = 103
  IDEXIT = 104

section '.code' code readable executable

  start: dummy = InitCommonControls
        invoke  GetModuleHandle,0
        invoke  DialogBoxParam,eax,37,HWND_DESKTOP,DialogProc, 0
        or      eax,eax
        jz      exit
  exit:
        invoke  ExitProcess,0

proc DialogProc hwnddlg,msg,wparam,lparam
        push    ebx esi edi
        cmp     [msg],WM_INITDIALOG
        je      wminitdialog
        cmp     [msg],WM_COMMAND
        je      wmcommand
        cmp     [msg],WM_CLOSE
        je      wmclose
        xor     eax,eax
        jmp     finish
  wminitdialog:
        jmp     processed
  wmcommand:
        cmp     [wparam],BN_CLICKED shl 16 + IDEXIT
        je      wmclose
        cmp     [wparam],BN_CLICKED shl 16 + IDOK
        jmp     processed
  wmclose:
        invoke  EndDialog,[hwnddlg], 0
  processed:
        mov     eax, 1
  finish:
        pop     edi esi ebx
        ret

endp

section '.idata' import data readable writeable

  library kernel,'KERNEL32.DLL',\
          user,'USER32.DLL',\
          comctl,'COMCTL32.DLL'

  import  kernel,\
          GetModuleHandle,'GetModuleHandleA',\
          ExitProcess,'ExitProcess'

  import  user,\
          DialogBoxParam,'DialogBoxParamA',\
          GetDlgItemText,'GetDlgItemTextA',\
          MessageBox,'MessageBoxA',\
          EndDialog,'EndDialog'

  import  comctl,\
          InitCommonControls,'InitCommonControls'

section  '.rsrc' resource data readable

  directory 24,manifest,\
            RT_DIALOG,dialogs

  resource manifest,\
         1,LANG_ENGLISH+SUBLANG_DEFAULT,man

  resource dialogs,\
           37, LANG_ENGLISH+SUBLANG_DEFAULT,mydialog

  dialog mydialog,'Clockowl - First KeyGens',6,5,242,66,10C00800h,00000088h
    dialogitem 'EDIT','Enter your desired username',IDNAME,4,5,230,15,10800101h
    dialogitem 'EDIT','Hit generate to generate a key',IDKEY,4,25,230,15,10800901h
    dialogitem 'BUTTON','&Generate',IDGEN,152,46,82,13,50010000h
    dialogitem 'BUTTON','E&xit',IDEXIT,4,46,82,13,50010000h
  enddialog

resdata man
  db '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',\
     '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">',\
     ' <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="CompanyName.ProductName.YourApp" type="win32"/>',\
     ' <description>First KeyGen</description>',\
     ' <dependency>',\
     '  <dependentAssembly>',\
     '   <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"/>',\
     '  </dependentAssembly>',\
     ' </dependency>',\
     '</assembly>'
endres    


I'd like you to compile it and execute it, tell me if it works or not and if it doesn't click your OS in the poll, and maybe if you are 133732 with ASM (which probably is the case) post your thoughts on why and how.

TIA,
Daedalus

PS:
A list of OSs:
Works on:

Vista Ultimate (fully updated)
Windows XP Pro Lite
Windows XP Home SP2

Does not work on:
Windows XP Pro SP2
Windows XP Home SP2
Post 26 Mar 2007, 18:09
View user's profile Send private message MSN Messenger Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan
remove from your code empty section
[section '.data' data readable writeable]
and it will work.
Post 26 Mar 2007, 19:04
View user's profile Send private message Reply with quote
Daedalus



Joined: 25 Mar 2007
Posts: 52
Daedalus
Sorry, that doesn't do the trick.
Post 26 Mar 2007, 19:31
View user's profile Send private message MSN Messenger Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
asmfan wrote:
remove from your code empty section
[section '.data' data readable writeable]
and it will work.


Worked for me. I have Windows xp sp2.
Post 27 Mar 2007, 05:25
View user's profile Send private message Reply with quote
KRA



Joined: 14 Jun 2005
Posts: 24
KRA
Worked for me ( after removal of the .data section )
However I do think you should
invoke InitCommonControls
instead of dummy = InitCommonControls
some versions of windows need this
Post 27 Mar 2007, 05:51
View user's profile Send private message Reply with quote
Daedalus



Joined: 25 Mar 2007
Posts: 52
Daedalus
Changed the
dummy = InitCommonControls
to
invoke InitCommonControls

I will check it at a friend tonight, thanks for your help so far! Smile
Post 27 Mar 2007, 08:09
View user's profile Send private message MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7802
Location: Kraków, Poland
Tomasz Grysztar
You've got an empty data section in your code, this causes problems on some Windows versions.
See http://board.flatassembler.net/topic.php?t=2330
Post 27 Mar 2007, 08:20
View user's profile Send private message Visit poster's website Reply with quote
Garthower



Joined: 21 Apr 2006
Posts: 158
Location: Ukraine
Garthower
On my Windows XP SP2 x64 it works only if I delete empty section.
Post 27 Mar 2007, 08:51
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
Daedalus



Joined: 25 Mar 2007
Posts: 52
Daedalus
I already changed the data section, but on one friend his machine it still refused to work as of last night, I'll check again tonight, together with the other small change.
Post 27 Mar 2007, 13:01
View user's profile Send private message MSN Messenger Reply with quote
Plue



Joined: 15 Dec 2005
Posts: 151
Plue
Doesn't work until I remove the data section. Then it works.
Post 27 Mar 2007, 14:44
View user's profile Send private message Reply with quote
Daedalus



Joined: 25 Mar 2007
Posts: 52
Daedalus
Hahaha, yes thanks all! No more empty sections for me, hehe. The friend misunderstood the "working" part.

"Well when I click generate nothing happens"

d'oh! Very Happy

On a side note:

Why did you even have a data section?
Because I didn't understand the " IDKEY = 101 " lines. It are #defines, constants, not variables.
Post 27 Mar 2007, 14:47
View user's profile Send private message MSN Messenger Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Post 27 Mar 2007, 16:07
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.