retdec
Namespaces | Variables
x86.cpp File Reference

Implement x86 syscall identification and fixing pass SyscallFixer. More...

#include <llvm/IR/Constants.h>
#include "retdec/bin2llvmir/optimizations/syscalls/syscalls.h"
#include "retdec/bin2llvmir/providers/asm_instruction.h"

Namespaces

 retdec
 
 retdec::bin2llvmir
 

Variables

std::map< uint64_t, std::string > syscalls_x86_linux_32
 
std::map< uint64_t, std::string > x86SocketSyscalls
 

Detailed Description

Implement x86 syscall identification and fixing pass SyscallFixer.

Variable Documentation

◆ syscalls_x86_linux_32

std::map<uint64_t, std::string> syscalls_x86_linux_32

From /usr/include/asm/unistd_32.h Note: x86 and x86_64 have different ABIs, therefore different syscall tables. For x86_64 see /usr/include/asm/unistd_64.h.

TODO: windows, 64-bit, Itanium, etc.: https://w3challs.com/syscalls

◆ x86SocketSyscalls

std::map<uint64_t, std::string> x86SocketSyscalls
Initial value:
=
{
{1, "socket"},
{2, "bind"},
{3, "connect"},
{4, "listen"},
{5, "accept"},
{6, "getsockname"},
{7, "getpeername"},
{8, "socketpair"},
{9, "send"},
{10, "recv"},
{11, "sendto"},
{12, "recvfrom"},
{13, "shutdown"},
{14, "setsockopt"},
{15, "getsockopt"},
{16, "sendmsg"},
{17, "recvmsg"},
{18, "accept4"},
{19, "recvmmsg"},
{20, "sendmmsg"}
}

From: /usr/include/linux/net.h