Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #4837

Re: code and data

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail
From Melzzzzz <mel@zzzzz.com>
Newsgroups comp.programming
Subject Re: code and data
Date Tue, 21 Oct 2014 00:11:37 +0200
Organization albasani.net
Lines 54
Message-ID <20141021001137.6b93d8c5@maxa-pc> (permalink)
References <m23paq$4ht$1@speranza.aioe.org> <20141020222517.4d3ceaf8@maxa-pc> <m23v5n$jib$1@speranza.aioe.org>
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Trace news.albasani.net iSkxSOlfduKyfAj/tEdaFbRkDYAu5EDLNgho/GbG8ouNcgz15iQ7/XxHDw9uCfNx07EbpWAEc1h5MaVVU0nam+RYxaPJ8yICMgaKQweKKqi5FogupyAGeX5Jh2dYiCmv
NNTP-Posting-Date Mon, 20 Oct 2014 22:11:37 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="Qm/xSDRV3jtbBvJbmZ4MueTuA4Bdcwl/gNQVDOLATAFvIEvZv/RGIJWcVcJgSUvMsICDLRJhxH+bp+EkVXuw4LDli4h4ijkJbg6iEC0OMMOUoUH7Ph/ce2kBGPU24Xgv"; mail-complaints-to="abuse@albasani.net"
X-Newsreader Claws Mail 3.10.1 (GTK+ 2.24.24; x86_64-unknown-linux-gnu)
Cancel-Lock sha1:RtcwCoOc3n9lwRPDgsEIb3T4gME=
Xref csiph.com comp.programming:4837

Show key headers only | View raw


On Mon, 20 Oct 2014 17:34:56 -0400
"Bill Cunningham" <nospam@nspam.invalid> wrote:

> 
> "Melzzzzz" <mel@zzzzz.com> wrote in message 
> news:20141020222517.4d3ceaf8@maxa-pc...
> > On Mon, 20 Oct 2014 15:55:15 -0400
> > "Bill Cunningham" <nospam@nspam.invalid> wrote:
> >
> >>     Now is a flat binary only data or does it contain any code? I
> >> know the sections are stripped away.
> >>
> >> Bill
> >>
> >>
> >
> > What you mean by that? You can load binary into RAM and execute
> > it no problem on Linux and Windows.
> 
>     Only if there is relaocatable data mapped by the linker or loader
> for execution.

Well, you can write relocatable code in assembler or compile with PIC...
I did it. Loaded file in memory, mprotect it and just casted to
pointer to function and ...;)

 And the binary happens to have executable code. If you
> remove section (or segment) headers which would be meaningful code,
> You'll have something that linux's file command would call data
> because it's unidentifiable. Not all binaries are executable on their
> own. JPEGs have a header and are binaries but not executable.

You can execute anything in memory. Question is if you would get
meaningful result ;)

> 
>     What exactly is left when something has been reduced to a "flat
> binary"? That is what I'm meaning. Linux certainly can't identify it
> I know that.

Flat binary can be loaded into memory and run no problem. It just need
to have position independent code.

> 
> Bill
> 
> 



-- 
Manjaro all the way!
http://manjaro.org/

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

code and data "Bill Cunningham" <nospam@nspam.invalid> - 2014-10-20 15:55 -0400
  Re: code and data Melzzzzz <mel@zzzzz.com> - 2014-10-20 22:25 +0200
    Re: code and data "Bill Cunningham" <nospam@nspam.invalid> - 2014-10-20 17:34 -0400
      Re: code and data Melzzzzz <mel@zzzzz.com> - 2014-10-21 00:11 +0200
        Re: code and data "Bill Cunningham" <nospam@nspam.invalid> - 2014-10-20 20:01 -0400
  Re: code and data Richard Heathfield <invalid@see.sig.invalid> - 2014-10-20 21:29 +0100
    Re: code and data "Bill Cunningham" <nospam@nspam.invalid> - 2014-10-20 17:38 -0400
      Re: code and data Richard Heathfield <invalid@see.sig.invalid> - 2014-10-20 23:09 +0100

csiph-web