| The Following User Says Thank You to rm_you For This Useful Post: | ||
|
|
2008-01-11
, 09:02
|
|
Posts: 2,152 |
Thanked: 1,490 times |
Joined on Jan 2006
@ Czech Republic
|
#42
|
an strace is here: http://pastebin.ca/850430
I'm not sure how to interpret that... I have done some strace interpretation for an Operating Systems class once, but nothing this complex.
Nokia-770-36:/# strace /usr/sbin/dsmetest -l 1
execve("/usr/sbin/dsmetest", ["/usr/sbin/dsmetest", "-l", "1"], [/* 47 vars */]) = 0
..
..
..
brk(0) = 0x12000
brk(0x13000) = 0x13000
socket(PF_FILE, SOCK_STREAM, 0) = 3
connect(3, {sa_family=AF_FILE, path="/tmp/dsmesock"}, 112) = 0
fcntl(3, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
write(3, "\f\0\0\0\206\2\0\0\1\0\0\0", 12) = 12
write(1, "brightness reqyest sent!\n", 25brightness reqyest sent!
) = 25
close(3) = 0
_exit(0) = ?
write(3, "\f\0\0\0\206\2\0\0\1\0\0\0", 12) = 12
write(3, "\f\0\0\0\206\2\0\0\2\0\0\0", 12) = 12
write(3, "\x0c\x00\x00\x00\x86\x02\x00\x00\x02\x00\x00\x00", 12) = 12
| The Following User Says Thank You to fanoush For This Useful Post: | ||
|
|
2008-01-11
, 10:04
|
|
|
Posts: 98 |
Thanked: 189 times |
Joined on Jul 2007
@ San Antonio, TX
|
#43
|
\x0c\x00\x00\x00\x86\x02\x00\x00\x[hexvalue]\x00\x00\x00
strace -f chroot /mnt/initfs/ dsmetest -l 100
|
|
2008-01-11
, 10:15
|
|
Posts: 2,152 |
Thanked: 1,490 times |
Joined on Jan 2006
@ Czech Republic
|
#44
|
Ok, so all I have to do is write out to "/tmp/dsmesock" something like this?Possibly?Code:\x0c\x00\x00\x00\x86\x02\x00\x00\x[hexvalue]\x00\x00\x00
|
|
2008-01-11
, 10:33
|
|
|
Posts: 98 |
Thanked: 189 times |
Joined on Jul 2007
@ San Antonio, TX
|
#45
|
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/un.h>
void main()
{
int mysock = socket(PF_FILE, SOCK_STREAM, 0);
struct sockaddr_un name;
size_t size;
int nbytes;
name.sun_family = AF_FILE;
strcpy (name.sun_path, "/mnt/initfs/tmp/dsmesock");
size = (offsetof (struct sockaddr_un, sun_path) + strlen (name.sun_path) + 1);
if (connect (mysock, (struct sockaddr *) &name, size) < 0) {
printf("Error opening socket.\n");
}
else {
nbytes = write (mysock, "\f\0\0\0\211\2\0\0d\0\0\0", 12);
if (nbytes < 0)
{
printf("Write error.\n");
exit(1);
}
shutdown(mysock,2);
}
}

Nezumi:~# strace -f ./testdsme
execve("./testdsme", ["./testdsme"], [/* 59 vars */]) = 0
brk(0) = 0x11000
uname({sys="Linux", node="Nezumi", ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40000000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=31704, ...}) = 0
mmap2(NULL, 31704, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40004000
close(3) = 0
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\324\302"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1086428, ...}) = 0
mmap2(0x41028000, 1118708, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x41028000
mprotect(0x4112c000, 32768, PROT_NONE) = 0
mmap2(0x41134000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x104) = 0x41134000
mmap2(0x41137000, 8692, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x41137000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4000c000
syscall_983045(0x4000c4a0, 0x4000c4a0, 0x41023048, 0x4000cb78, 0x40, 0, 0x48, 0xf0005, 0, 0, 0x41023000, 0xbee853d4, 0, 0xbee85050, 0xfffffff8, 0x41000ad0, 0x20000010, 0x4000c4a0, 0xd02c, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) = 0
mprotect(0x41134000, 4096, PROT_READ) = 0
munmap(0x40004000, 31704) = 0
mq_notify(1, ptrace: umoven: Input/output error
{...}) = 3
SYS_283(0x3, 0xbee854d8, 0x1b, 0xbee854d8, 0x41022db8) = 0
write(3, "\f\0\0\0\211\2\0\2\0\0\0\0", 12) = 12
SYS_293(0x3, 0x2, 0xc, 0xc, 0x41022db8) = 0
io_submit(0, 0, 0 <unfinished ... exit status 0>
Process 3339 detached
|
|
2008-01-11
, 12:49
|
|
Posts: 2,152 |
Thanked: 1,490 times |
Joined on Jan 2006
@ Czech Republic
|
#46
|
| The Following User Says Thank You to fanoush For This Useful Post: | ||
|
|
2008-01-11
, 22:30
|
|
|
Posts: 98 |
Thanked: 189 times |
Joined on Jul 2007
@ San Antonio, TX
|
#47
|
|
|
2008-01-12
, 13:43
|
|
|
Posts: 98 |
Thanked: 189 times |
Joined on Jul 2007
@ San Antonio, TX
|
#48
|
| The Following 2 Users Say Thank You to rm_you For This Useful Post: | ||
|
|
2008-01-12
, 19:17
|
|
|
Posts: 5,478 |
Thanked: 5,222 times |
Joined on Jan 2006
@ St. Petersburg, FL
|
#49
|
|
|
2008-01-26
, 13:49
|
|
Posts: 6 |
Thanked: 0 times |
Joined on Nov 2007
|
#50
|
Thanks for explaining what the kernel is doing! The values I was seeing make a bit more sense now. I thought I was going insane, writing one value to the file and seeing another! >_>
I will look into reverse-engineering that, as it would be much better if the applet worked without the special kernel...
Oh, new version: http://cs.trinity.edu/~acm/debs/adva...ght-0.3.tar.gz
And source: http://cs.trinity.edu/~acm/debs/adva...0.3-src.tar.gz
The only real changes are a bit of code cleanup (doubt it has a performance impact) and it now checks to see which device it is on, to prevent blanking the screen on an n800 (since it lacks a transflective screen) and confusing the user.
Edit: an strace is here: http://pastebin.ca/850430
I'm not sure how to interpret that... I have done some strace interpretation for an Operating Systems class once, but nothing this complex.
Last edited by rm_you; 2008-01-11 at 05:37.