X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/ea6c242bffbda5298b4def632a98b00bb6ac775d..d5cffad757d05610d796476603aaff266e6c8f50:/tools/poke-rls.c?ds=sidebyside diff --git a/tools/poke-rls.c b/tools/poke-rls.c index 01de181..03c4fb1 100644 --- a/tools/poke-rls.c +++ b/tools/poke-rls.c @@ -14,12 +14,22 @@ static uint16_t _get_PMBASE() return pmbase; } +typedef struct { + uint32_t signature; + uint32_t type; + uint8_t data[]; +} packet_t; -extern unsigned int poke(unsigned long addr); +extern unsigned int poke(unsigned long addr, unsigned long * value); int main(int argc, char **argv) { unsigned int res; + packet_t * packet = (packet_t *)memalign(4096, sizeof(packet_t)); + + packet->signature = 0x1BADD00D; + packet->type = 42; + strcpy(packet->data, "hello, world!"); if (iopl(3) < 0) { @@ -27,6 +37,13 @@ int main(int argc, char **argv) return 1; } - res = poke(_get_PMBASE() + 0x04); - printf("found %p\n", res); + res = poke(_get_PMBASE() + 0x04, (void *)packet); + printf("returned %p\n", res); + + if (res == 42) { + printf("%s\n", packet->data); + printf("%s\n", packet->data+41); + printf("%s\n", packet->data+82); + printf("%s\n", packet->data+123); + } }