X-Git-Url: http://git.joshuawise.com/netwatch.git/blobdiff_plain/5d41c77c6fd2433c8c52d3f611716d6920017215..0cd80c5181dfee5d7853de038f08303c6a33c01b:/tools/poke-rls.c?ds=sidebyside diff --git a/tools/poke-rls.c b/tools/poke-rls.c index c6db7bc..6946fb7 100644 --- a/tools/poke-rls.c +++ b/tools/poke-rls.c @@ -2,6 +2,7 @@ #include #include #include +#include static uint16_t _get_PMBASE() { @@ -13,19 +14,28 @@ static uint16_t _get_PMBASE() return pmbase; } +typedef struct { + uint32_t signature; + uint32_t type; + uint8_t data[]; +} packet_t; -extern unsigned int poke(short 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 = 0xF00FC7C8; if (iopl(3) < 0) { perror("iopl"); return 1; } - - res = poke(_get_PMBASE() + 0x04); - printf("found %p\n", res); + + res = poke(_get_PMBASE() + 0x04, (void *)packet); + printf("returned %p\n", res); }