mirror of
https://github.com/lief-project/LIEF.git
synced 2026-10-11 22:09:53 +00:00
lint: use the alternate form without prefix
This commit is contained in:
@@ -94,10 +94,10 @@ std::string Memory::Chunk::to_string() const {
|
||||
}
|
||||
|
||||
if (size() == 0) {
|
||||
return fmt::format("[0x{:016x}, ...]", addr());
|
||||
return fmt::format("[{:#018x}, ...]", addr());
|
||||
}
|
||||
|
||||
return fmt::format("[0x{:016x}, 0x{:016x}]", addr(), addr() + size());
|
||||
return fmt::format("[{:#018x}, {:#018x}]", addr(), addr() + size());
|
||||
}
|
||||
|
||||
std::optional<Memory::Chunk> Memory::mmap(size_t size, uint32_t flags,
|
||||
@@ -174,7 +174,7 @@ ok_error_t Memory::mprotect(Memory::Chunk& C, uint32_t flags) {
|
||||
|
||||
int ret = ::mprotect((void*)pstart, len, posix_flags);
|
||||
if (ret != 0) {
|
||||
LIEF_ERR("mprotect [0x{:016x}, 0x{:016x}] -> {} ({:04b}) failed: {} ({})",
|
||||
LIEF_ERR("mprotect [{:#018x}, {:#018x}] -> {} ({:04b}) failed: {} ({})",
|
||||
pstart, pend, perm_str(flags), posix_flags, ret, strerror(errno));
|
||||
return make_error_code(lief_errors::runtime_error);
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ size_t Module::size() const {
|
||||
}
|
||||
|
||||
std::string Module::to_string() const {
|
||||
return fmt::format("0x{:08x}: {}", imagebase(), name());
|
||||
return fmt::format("{:#010x}: {}", imagebase(), name());
|
||||
}
|
||||
|
||||
modules_t modules() {
|
||||
|
||||
@@ -94,10 +94,10 @@ std::string Memory::Chunk::to_string() const {
|
||||
}
|
||||
|
||||
if (size() == 0) {
|
||||
return fmt::format("[0x{:016x}, ...]", addr());
|
||||
return fmt::format("[{:#018x}, ...]", addr());
|
||||
}
|
||||
|
||||
return fmt::format("[0x{:016x}, 0x{:016x}]", addr(), addr() + size());
|
||||
return fmt::format("[{:#018x}, {:#018x}]", addr(), addr() + size());
|
||||
}
|
||||
|
||||
std::optional<Memory::Chunk> Memory::mmap(size_t size, uint32_t flags,
|
||||
@@ -174,7 +174,7 @@ ok_error_t Memory::mprotect(Memory::Chunk& C, uint32_t flags) {
|
||||
|
||||
int ret = ::mprotect(reinterpret_cast<void*>(pstart), len, posix_flags);
|
||||
if (ret != 0) {
|
||||
LIEF_ERR("mprotect [0x{:016x}, 0x{:016x}] -> {} ({:04b}) failed: {} ({})",
|
||||
LIEF_ERR("mprotect [{:#018x}, {:#018x}] -> {} ({:04b}) failed: {} ({})",
|
||||
pstart, pend, perm_str(flags), posix_flags, ret, strerror(errno));
|
||||
return make_error_code(lief_errors::runtime_error);
|
||||
}
|
||||
|
||||
@@ -98,10 +98,10 @@ std::string Memory::Chunk::to_string() const {
|
||||
}
|
||||
|
||||
if (size() == 0) {
|
||||
return fmt::format("[0x{:016x}, ...]", addr());
|
||||
return fmt::format("[{:#018x}, ...]", addr());
|
||||
}
|
||||
|
||||
return fmt::format("[0x{:016x}, 0x{:016x}]", addr(), addr() + size());
|
||||
return fmt::format("[{:#018x}, {:#018x}]", addr(), addr() + size());
|
||||
}
|
||||
|
||||
std::optional<Memory::Chunk> Memory::mmap(size_t size, uint32_t flags,
|
||||
@@ -180,7 +180,7 @@ ok_error_t Memory::mprotect(Memory::Chunk& C, uint32_t flags) {
|
||||
|
||||
int ret = ::mprotect((void*)pstart, len, posix_flags);
|
||||
if (ret != 0) {
|
||||
LIEF_ERR("mprotect [0x{:016x}, 0x{:016x}] -> {} ({:04b}) failed: {} ({})",
|
||||
LIEF_ERR("mprotect [{:#018x}, {:#018x}] -> {} ({:04b}) failed: {} ({})",
|
||||
pstart, pend, perm_str(flags), posix_flags, ret, strerror(errno));
|
||||
return make_error_code(lief_errors::runtime_error);
|
||||
}
|
||||
|
||||
@@ -75,10 +75,10 @@ std::string Memory::Chunk::to_string() const {
|
||||
}
|
||||
|
||||
if (size() == 0) {
|
||||
return fmt::format("[0x{:016x}, ...]", addr());
|
||||
return fmt::format("[{:#018x}, ...]", addr());
|
||||
}
|
||||
|
||||
return fmt::format("[0x{:016x}, 0x{:016x}]", addr(), addr() + size());
|
||||
return fmt::format("[{:#018x}, {:#018x}]", addr(), addr() + size());
|
||||
}
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ ok_error_t Memory::mprotect(Memory::Chunk& C, uint32_t flags) {
|
||||
DWORD old_perms = 0;
|
||||
int ret = VirtualProtect((void*)pstart, len, win_perms, &old_perms);
|
||||
if (ret == 0) {
|
||||
LIEF_ERR("mprotect [0x{:016x}, 0x{:016x}] -> {} ({}) failed: {}", pstart, pend,
|
||||
LIEF_ERR("mprotect [{:#018x}, {:#018x}] -> {} ({}) failed: {}", pstart, pend,
|
||||
perm_str(flags), win_perms, GetLastError());
|
||||
return make_error_code(lief_errors::runtime_error);
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ void* Module::dlsym(const std::string& name) const {
|
||||
}
|
||||
|
||||
std::string Module::to_string() const {
|
||||
return fmt::format("0x{:08x}: {}", imagebase(), name());
|
||||
return fmt::format("{:#010x}: {}", imagebase(), name());
|
||||
}
|
||||
|
||||
modules_t modules() {
|
||||
|
||||
Reference in New Issue
Block a user