I'm new

Reply

Join Date: Mar 2006
Posts: 8
Reputation: deutsch is an unknown quantity at this point 
Solved Threads: 0
deutsch's Avatar
deutsch deutsch is offline Offline
Newbie Poster

I'm new

 
0
  #1
Mar 15th, 2006
I am currently learning 32 bit Win programming in assembly. I used to write in C and C++ but didn't like the code bloat.

My hobbies are photography, stamp collecting,
wood working, and bike riding.

Thanks.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,541
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 704
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: I'm new

 
0
  #2
Mar 15th, 2006
Welcome! What assembler are you using? Are you working directly with the Win32 API for assembly GUI applications or are you actually doing something fun?

>I used to write in C and C++ but didn't like the code bloat.
Most of the bloat comes from poorly written (or clearly written, if footprint isn't as important as clarity) code and libraries. If you're writing Win32 assembly then you'll still see the bloat from the API you use, and that really can't be avoided for any non-trivial application. To really get the size benefits of assembly, you're looking at bare metal interrupts, but those have their own disadvantages.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 8
Reputation: deutsch is an unknown quantity at this point 
Solved Threads: 0
deutsch's Avatar
deutsch deutsch is offline Offline
Newbie Poster

Re: I'm new

 
0
  #3
Mar 15th, 2006
[QUOTE=Narue]Welcome! What assembler are you using? Are you working directly with the Win32 API for assembly GUI applications or are you actually doing something fun?

I am using Masm for straight assembly API like them good old DOS days. :-)

Right now I am struggling with this code.

Thanks. I have the SDK, but it's a little cryptic.

There is a problem with one/both RegCloseKey statements.
Maybe:

1. Their order should be reversed
2. Something else is needed in the code

What I want Ollydbg to do is go to my breakpoints and stop so I can see what's going on.
Then go one instruction at a time. This computer F-keys does their own thing.

; creatsub.asm Create a subkey of an existing registry key
; Help from AsmER,
; SLOW and EASY with this code !!!
.386

.MODEL FLAT, STDCALL
OPTION CASEMAP: NONE

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\advapi32.inc

include \masm32\macros\macros.asm

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\advapi32.lib

.DATA

APPKey BYTE "Marzipan", 0
SecondKey BYTE "basement", 0
Opened_Key BYTE "Registry Key sucessfully opened.",0
No_Key BYTE "Registry Key not present!",0
Key_Closed BYTE "Sub_Key creation suceeded.",0
Problem BYTE "Problem closing Registry Key !",0
Sample BYTE "Sample",0 ; title of message box

.DATA?

RegH PHKEY ? ; Handle for registry key DON'T use ADDR with these!
SubRegKey PHKEY ?

.CODE

Start:

jmp Next

Fill db "db eax",0

Next:

invoke RegOpenKey, HKEY_CURRENT_USER, ADDR APPKey, ADDR RegH ;to get handle of already created
;registry key.

.IF EAX == ERROR_SUCCESS

invoke MessageBox, 0, ADDR Opened_Key, ADDR Sample,MB_ICONINFORMATION

.ELSE

invoke MessageBox, 0, ADDR No_Key, ADDR Sample,MB_ICONINFORMATION
invoke ExitProcess, 0 ; exit, we have a problem

.ENDIF

invoke RegCreateKey, RegH, ADDR SecondKey, SubRegKey ;to create or open
;already existing sub reg. key

invoke RegCloseKey, RegH ; close handle for reg. key
int 3
invoke RegCloseKey, SubRegKey ; close handle for reg. key
int 3
.IF EAX == ERROR_SUCCESS

invoke MessageBox, 0, ADDR Key_Closed, ADDR Sample,MB_ICONINFORMATION

.ELSE ; something's amiss

invoke MessageBox, 0, ADDR Problem, ADDR Sample,MB_ICONINFORMATION

.ENDIF

invoke ExitProcess, 0

END Start
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Assembly Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC