On 07/19 06:57, Jorge Almeida wrote:
> On Wed, Jul 19, 2017 at 6:40 PM,  <[email protected]> wrote:
> 
> >
> > the tool is statically linked and only the command "file"
> > reveals its 32bit nature.
> >
> If the tool is a static binary, you shouldn't need anything besides a
> kernel with support for 32 bit executables (Executable file formats /
> Emulations  --->  x32 ABI for 64-bit mode)
> 
> (I hope I'm not saying something utterly silly...)
> 
> Jorge Almeida
> 

Hi,

the linux32-trick is neat...but it seems a little more to be done
here.

I straced the whole thing:
sudo strace linux32 ./pirate-loader_lnx


execve("/usr/bin/linux32", ["linux32", "./pirate-loader_lnx"], 0x7fff34dfea18 
/* 18 vars */) = 0
brk(NULL)                               = 0x12ae000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7ff1148e8000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=313119, ...}) = 0
mmap(NULL, 313119, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff11489b000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\3\2\0\0\0\0\0"..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1652184, ...}) = 0
mmap(NULL, 3758296, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7ff114332000
mprotect(0x7ff1144bf000, 2093056, PROT_NONE) = 0
mmap(0x7ff1146be000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18c000) = 0x7ff1146be000
mmap(0x7ff1146c4000, 14552, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff1146c4000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7ff114899000
arch_prctl(ARCH_SET_FS, 0x7ff114899700) = 0
mprotect(0x7ff1146be000, 16384, PROT_READ) = 0
mprotect(0x602000, 4096, PROT_READ)     = 0
mprotect(0x7ff1148ea000, 4096, PROT_READ) = 0
munmap(0x7ff11489b000, 313119)          = 0
brk(NULL)                               = 0x12ae000
brk(0x12cf000)                          = 0x12cf000
open("/usr/lib64/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=4127728, ...}) = 0
mmap(NULL, 4127728, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff113f42000
close(3)                                = 0
uname({sysname="Linux", nodename="solfire", ...}) = 0
personality(PER_LINUX32)                = 0 (PER_LINUX)
uname({sysname="Linux", nodename="solfire", ...}) = 0
execve("./pirate-loader_lnx", ["./pirate-loader_lnx"], 0x7fff1840a250 /* 18 
vars */) = -1 ENOENT (No such file or directory)
write(2, "linux32: ", 9linux32: )                = 9
write(2, "./pirate-loader_lnx", 19./pirate-loader_lnx)     = 19
write(2, ": ", 2: )                       = 2
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2997, ...}) = 0
read(3, "# Locale name alias data base.\n#"..., 4096) = 2997
read(3, "", 4096)                       = 0
close(3)                                = 0
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT 
(No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT 
(No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No 
such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT 
(No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No 
such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1474, ...}) = 0
mmap(NULL, 1474, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff1148e7000
close(3)                                = 0
write(2, "No such file or directory\n", 26No such file or directory
) = 26
close(1)                                = 0
close(2)                                = 0
exit_group(1)                           = ?
+++ exited with 1 +++

Same happens, if I feed the whole glory of necessary commandline
switches and the hex-file into this little beast.

"No such file or directory."

Unfortunately I have no clue, what is missing here...
(and it is definetly no script, which #!<something> couldn't
be found.

Why does the task of flashing firmware walk hand in hand with mental illness so
near at the abyss of bricked hardware that often ?
Why can't it that easy as scripting plain TeX?
;)

Cheers
Meino



Reply via email to