News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Self incrementing Counter info

Started by skywalker, March 02, 2006, 12:43:49 AM

Previous topic - Next topic

PBrennick

Skywalker,
I think you are proceeding very well here.  We will continue to help you as you develop this application.  About the semi-colon thing, it is the only way I know how except if you are using a debugger.  You can get a free copy of Olly debug and use int 3 to set breakpoints so you can see what is happening.  Be careful about relying on debuggers, though.  One made a fool of me earlier today.

Have fun and treat the structure as a long data string. end it iwith a zero and put quotes around each line of text of the structure and put 13, 10 at the end of each line.  You will learn to put variables between each line where you will put the data that is stored in the real structure.  Think about these things and let me know if you need any more help.  These are just ideas about only one way of solving this problem.  There is always more than one way so if you come up with another way, well, that's cool.

Have fun and let us know how it is going.  Congratulations on getting it to assemble.  It must have been a good feeling.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

skywalker

Quote from: PBrennick on March 06, 2006, 01:30:17 AM
Skywalker,
I think you are proceeding very well here.  We will continue to help you as you develop this application.  About the semi-colon thing, it is the only way I know how except if you are using a debugger.  You can get a free copy of Olly debug and use int 3 to set breakpoints so you can see what is happening.  Be careful about relying on debuggers, though.  One made a fool of me earlier today.

Have fun and treat the structure as a long data string. end it iwith a zero and put quotes around each line of text of the structure and put 13, 10 at the end of each line.  You will learn to put variables between each line where you will put the data that is stored in the real structure.  Think about these things and let me know if you need any more help.  These are just ideas about only one way of solving this problem.  There is always more than one way so if you come up with another way, well, that's cool.


Have fun and let us know how it is going.  Congratulations on getting it to assemble.  It must have been a good feeling.

Paul


Thanks, it's getting easier to learn and remember with all the help that is given.

I have Olly Debug, trying to figure how best to use it. Unlike 16 bit, it's harder stepping though it and seeing where you are in relation to your source code. :-)

I'll put in some int3s and let it run to that point and study my regs, etc.

I have room to install the 2003 SDK. Does it have source code examples ? For 100 megs, I would hope so. :-)

Andy

donkey

Hi skywalker,

The SDK comes with a few really good example snippets built in but unlike the MSDN library there are no working code examples. It is an excellent reference however and I rely on it for all my API questions. When used in conjunction with RadASM, you can just press F1 on any API call and have a complete explanation at your fingertips. Never underestimate the usefullness of reference material and never assume that you can have too much of it, you never know what you might need. For myself I constantly use the Platform SDK (the older XP one), x86eas.hlp, GoAsm.hlp, Agner's optimization manual, any thing I can find by Mark Larson and most of all the masm and winasm boards.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

PBrennick

Skywalker,

Quoteit's harder stepping though it and seeing where you are in relation to your source code.

Hutch always suggests, I think it is Hutch, to put a few nops before the code you want to check and after that code.  It is a very nice way of giving you something to search for.  nop means no operation so they will not compromise your code.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

donkey

Another good feature of OllyDbg is the ability to have it lock step your source line by line. When you link the project link it as a DEBUG project then you can have Olly open the source code, when you click on a line in the disassembled application it will hilite the line in the source that it pertains to. That is what the line number field in the PE specification is all about, something I sort of wish Jeremy would add to GoAsm but for now only MASM is capable of it AFAIK.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

AsmER

Hi everybody!

I have had the same idea in one of my c++'s program. I did it by writing 2 programs at the end but maybe it can help...
So first's program target was to open my application with self-incrementing counter, and write down 1 byte (because I needed value not grater than 256) at the end of it.
Main application just created a file handle to itself (EXE file) and read last byte (byte = counter), then modified it and overwrote last byte in file (from which was loaded to memory). In c++ nearly everything is possible (in c++ it worked), so if in assembler everything is possible, it should work as well.

I hope it is clearly enought. You can experiment with it (you know, for example you could encrypt it somehow - your choice ).

AsmER