News:

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

numbers?

Started by cekic, September 18, 2007, 01:23:46 AM

Previous topic - Next topic

cekic

hi ;
I m new in this forum.I have information about asm16 bit...But I can't understand that big programs or any of programs include interesting code and numbers :£
for example .com files have some numbers or the other programs have numbers in data section .. I can't understand if the programs need that numbers or programmers write them randomize ?

for example ı have saw a source code ı couldn't know while I m surfing on the web...
please explain me what these means numbers and codes?

.model  tiny
        .code   
               
        org     0100h
               
carrier:
        db      0E9h,0,0               
               
start:
        mov     bp, sp                 
        int     0003h                   
next:
        mov     bp, ss:[bp-6]
        sub     bp, offset next
         

mov     dl, 0000h               
        mov     ah, 0047h 
        lea     si, [bp+offset origdir+1]
        int     0021h
               
        lea     dx, [bp+offset newDTA]
        mov     ah, 001Ah               ; Set DTA
        int     0021h

      restore_COM:
        mov     di, 0100h
        push    di
        lea     si, [bp+offset old3]
        movsb                           
        movsw                                         
        mov     byte ptr [bp+numinfect], 0000h
       .........

     ...........
like this code go on ....
so how can I understand like this code and numbers in this code ?
thanx for your help
and I m sorry for my bad english
god bless you


MichaelW

That appears to be code from a virus writing guide, and regardless of your intent, it is a clear violation of the forum rules:

The Rules Of The Forum

eschew obfuscation

cekic

hi :(
you have understood me wrongly....
1)I ask you that while I am learning asm how can I write virus code:(
2)this is not form virus giıde this is the codes from my friends post me for example code to lern this language (assembly)
3)I just want to give an example about numbers and this things..
4)for example you said
;The 0000:7C00 is an address in segment-offset format that consists of a segment address of 0000h and an offset address of 7C00h. Addresses in the BIOS data area, which is located in segment 40h, are frequently expressed in a similar format, for example 40:6C, which is the address of the DWORD where the BIOS stores the count of timer ticks since midnight.
I ask you that how can I learn about which numbers do what things ?
I wonder that for exmple:   you  said tha appears to be virus codes you understood this the code that "org 100h" ? or understood that the code that "db      0E9h,0,0   "?
so I ask these things like this...how can I leaarn this adress numbers's means?you know any source aabout this ?or you know anything about this ?
if I can tell you on my head I m will be very happy and I want to say "I m sorry about if I have been understood wrongly"
thanx for help
god bless you   

Mark Jones

Quote
        lea     si, [bp+offset origdir+1]
...
        lea     dx, [bp+offset newDTA]
...
        lea     si, [bp+offset old3]
...
        mov     byte ptr [bp+numinfect], 0000h

Some friend you have there!
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

cekic

I couldn't what you mean but I try to tell you as well I understood as .
you say "some friend you have there" I coludn't understand..
but I told you that a firend of my friends send me it.he kow that I try to learn asm.. so While he was explore on the web he saw this codes and sent me..
so I have wanted to ask this what these codes mean?
so I don t know whrere he find them ... :'(

that s all  :red
so still I wonder and I will waiting asnwer my question above... :eek
pleasse ansawer it
god bless you
regards

raymond

At this stage, it would be useless to explain those numbers because you don't have any basic knowledge of assembly. You would not be able to understand any explanation anyway. You should first try to gather some of that basic knowledge. Search the internet for:
Art of Assembly Language Programming

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

MichaelW

Quote from: cekic on September 18, 2007, 10:41:55 AM
2)this is not form virus giıde this is the codes from my friends post me for example code to lern this language (assembly)

I have now verified that the code is part of a virus. In addition to being a violation of the forum rules, the code is too difficult, and does too many things that a normal program would not do, for it to be useful for learning assembly.
eschew obfuscation

cekic

Quote from: raymond on September 18, 2007, 03:48:10 PM
At this stage, it would be useless to explain those numbers because you don't have any basic knowledge of assembly. You would not be able to understand any explanation anyway. You should first try to gather some of that basic knowledge. Search the internet for:
Art of Assembly Language Programming

Raymond


dear raymond ;
I have essential information about assembly but my stage is not on advanced:(
I want to write good codes about any thing..
you said that it is now useless for me ?
why ?
is there any time to learn anything or is there any limitation for anything?
so may you give a source about that things (these numbers or information  text)
I think that if I can't study for hard things how can I a programmer on advanced on assembly?
pleasee try to understand me

and dear MichaelW you say taht "for it to be useful for learning assembly"
thanx to prove me and I m sorry about the violation of the forum rules.I haven't been doing intended..I just want to learn perfect somethings and want to improve myself
again sorry so please look with favor on my questions and endeavor=effort
god bless you
regards



eek


Mark Jones

Quotedear raymond ;
I have essential information about assembly but my stage is not on advanced:(
I want to write good codes about any thing..
you said that it is now useless for me ?
why ?

Cekic, you are asking how to learn to fly an airplane (assembler)... by troubleshooting a turbine engine malfunction (virus.) This is the worst possible way to learn assembly language.

And discussing methods to blow up turbine engines is not allowed here. So throw that code away, it won't help you.

If you refuse to stop discussing this code, this thread will be locked. This forum will not allow any virus code, period.


Quote
so may you give a source about that things (these numbers or information text)
I think that if I can't study for hard things how can I a programmer on advanced on assembly?
pleasee try to understand me

We understand that you're still asking for us to explain virus code to you. We will not.

Learn complex code LAST, not first. Most people who try learning assembler too quickly, lose interest. Would anyone try to fly an airplane without first taking lessons? Start at the beginning. There are many legitimate ways to learn assembler language which do not involve viruses. And this will take time. Months. Years. Study \MASM32\help\asmintro.hlp and masm32.hlp, these will help greatly. Look at the \examples and \tutorial folders for some samples. Then once you've mastered those simple programs, visit    http://win32assembly.online.fr/tutorials.html    for more advanced tutorials.

If you need help understanding English words, try    http://dictionary.reference.com/

God Bless you.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

cekic

Quote from: Mark Jones on September 19, 2007, 02:06:37 PM
Quotedear raymond ;
I have essential information about assembly but my stage is not on advanced:(
I want to write good codes about any thing..
you said that it is now useless for me ?
why ?

Cekic, you are asking how to learn to fly an airplane (assembler)... by troubleshooting a turbine engine malfunction (virus.) This is the worst possible way to learn assembly language.

And discussing methods to blow up turbine engines is not allowed here. So throw that code away, it won't help you.

If you refuse to stop discussing this code, this thread will be locked. This forum will not allow any virus code, period.


Quote
so may you give a source about that things (these numbers or information text)
I think that if I can't study for hard things how can I a programmer on advanced on assembly?
pleasee try to understand me

We understand that you're still asking for us to explain virus code to you. We will not.

Learn complex code LAST, not first. Most people who try learning assembler too quickly, lose interest. Would anyone try to fly an airplane without first taking lessons? Start at the beginning. There are many legitimate ways to learn assembler language which do not involve viruses. And this will take time. Months. Years. Study \MASM32\help\asmintro.hlp and masm32.hlp, these will help greatly. Look at the \examples and \tutorial folders for some samples. Then once you've mastered those simple programs, visit    http://win32assembly.online.fr/tutorials.html    for more advanced tutorials.

If you need help understanding English words, try    http://dictionary.reference.com/

God Bless you.

Dear Mark Jones ;
thank you for your explanation :)
I have understood what you meant.So I will try to learn asm16 and asm32 all about. I will make what needs to learn them..
and since yesterday I have began to study THE ART OF ASSEMBLY SOURCE :)
you are right ...and now I want to ask something for  the other subject if you aren't angry with me :(
I couldn't understand the link above that in the chapter five for accesing multidimensial arrays..
please explain them for me if you have enough time and if you aren 't angry with me :(
I have understood but not very well..especially that examples in part 2
thanx for every thing
god bless you
regards

tenkey

I wrote a tutorial for array access on a different forum, that finally reappeared, and has disappeared again. Multidimensional array access was summarized in the following manner.

You have an array of data, where each data element has size d. It is specified with upper and lower bounds, in the form of A[lb1:ub1, lb2:ub2, lb3:ub3]. The lower bounds are the lb numbers, and the upper bounds are the ub numbers.

When using row-major order, the address calculation can be done in the following manner:

count3 = (ub3+1) - lb3
count2 = (ub2+1) - lb2
count1 = (ub1+1) - lb1

dimension-size3 = count3 * d
dimension-size2 = count2 * dimension-size3
dimension-size1 = count1 * dimension-size2

For A[i1, i2, i3]

position1 = i1 - lb1
position2 = i2 - lb2
position3 = i3 - lb3

address of A[i1, i2, i3] = (position1 * dimension-size2) + (position2 * dimension-size3) + (position3 * d)

dimension-size1 is not used - it is the size of the array. Also notice that the dimension sizes are constants and therefore need to be calculated only once - either at the beginning of the program or at assembly time.

AoA shows an incremental method for getting the same results as above. It works like this...

temp0 = 0
temp1 = (temp0 + position1) * count2
temp2 = (temp1 + position2) * count3
temp3 = (temp2 + position3) * d

address of A[i1, i2, i3] = temp3

Of course, temp0 is redundant, but it shows the pattern for extending beyond 3 dimensions.
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8