English 中文(简体)
我怎么能够把玩具——unlink划入网上集会?
原标题:How can I embed inline assembly to call sys_unlink?

我试图呼吁利用在线集会进行玩具-unlink。

 int sys_unlink(const char *filename) {

    int ret;

    __asm__("int $0x80" : "=a"(ret) : "a"(10), "b"(filename));

    return ret;

}

但它并不奏效,它总是回到14岁。

我愿知道,这部法典是否正确,因为我不知道有多少组装。

问题回答

该法典仅适用于X86(32轨)程序,它没有使用正确的机号进行X86-64程序。 使用<代码>NR_unlink,asm/unistd.h 而不是硬编码<代码>10:

#include <asm/unistd.h>

int sys_unlink(const char *filename)
{
    int ret;

    asm("int $0x80" : "=a"(ret) : "a"(__NR_unlink), "b"(filename));
    return ret;
}

如果您are <>/em>汇编了32个轨道过程,则-14EFAULT,表明在你通过档案名称方面存在问题。 你们怎么说?

我认为,你甚至可以把这项工作局限于一个排在含水层以下的平台: 采用现代方式进行生物勘探,是用油轮提供的 st,通过DVDSO进行连接。 即便是你与不知道(谁知道)系统称之为公约——它只是从DVDSO中引来。 它通过在<条码>environ<> 代码/代码>后隐藏的磁性参数查阅DVDSO,然后将其与其他任何动态图书馆处理。 核心小组根据万国邮联的能力选择系统称为公约。

我知道(因为我试图这样做!) 它难以接触这些DVDSO符号。 glibc不向您出口(或向它们出口任何有用的产品)。 我所看到的唯一可行方式是检查你自己的<代码>/proc/ Self/maps,以便找到DVDSO,然后使用<代码>dl的功能(重复一些校准工作)。





相关问题
Fastest method for running a binary search on a file in C?

For example, let s say I want to find a particular word or number in a file. The contents are in sorted order (obviously). Since I want to run a binary search on the file, it seems like a real waste ...

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

Tips for debugging a made-for-linux application on windows?

I m trying to find the source of a bug I have found in an open-source application. I have managed to get a build up and running on my Windows machine, but I m having trouble finding the spot in the ...

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

Encoding, decoding an integer to a char array

Please note that this is not homework and i did search before starting this new thread. I got Store an int in a char array? I was looking for an answer but didn t get any satisfactory answer in the ...