flat assembler
Message board for the users of flat assembler.

Index > Linux > load *.so from memory

Author
Thread Post new topic Reply to topic
charme



Joined: 08 Jan 2010
Posts: 22
charme 06 Dec 2013, 03:00
we know that, dlopen dlsym dlclose
but these API just for the file.

if i want load it from memory,how can i do?

i just read the dlopen src(in glibc),but i dont't know futher.
so anyone study this?


ths

just like this!

Code:
unsigned char socontent[] = {0x30,0x10 ...};
void* map = _mydlopen(socontent);
dlsym(map,"xxx");
...
    

_________________
do it,do our best!
----------------------------------------------------------
http://chx4.net
Post 06 Dec 2013, 03:00
View user's profile Send private message ICQ Number Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1178
Location: Unknown
HaHaAnonymous 08 Dec 2013, 17:49
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 19:08; edited 1 time in total
Post 08 Dec 2013, 17:49
View user's profile Send private message Reply with quote
charme



Joined: 08 Jan 2010
Posts: 22
charme 09 Dec 2013, 04:32
HaHaAnonymous wrote:
Quote:

if i want load it from memory,how can i do?

Are you coding a malicious software?

If not, I can't see a valid reason why you want to do that so much. An external ".so" won't kill anyone (not to mention it is very common).

Possibilities:
1.If you still want to load it from memory, then recreating the functions you need in your own application will work.

> Don't be lazy! Let's work!

2.Keep the ".so" in your "executable" and then extracting and loading it during runtime.

> The easier way, but not very attractive.

3.Literally loading it from memory without accessing the disk or other device.

Sorry, I never tried option 3. Try asking some Linux experts or read some books to understand how it works and create by yourself the method to achieve the desired result (the best way).

Thank you for posting!


thank you anyway.
first,i dosn't coding a malicious software,just want protect my so file(because some core function in it)

idea1:i just researching about this.
idea2:this can be ok,but not effective.i had test it.

_________________
do it,do our best!
----------------------------------------------------------
http://chx4.net
Post 09 Dec 2013, 04:32
View user's profile Send private message ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.