6 return ((x >> 24) & 0xff) | ((x >> 8) & 0xff00) | ((x << 8) & 0xff0000) | ((x << 24) & 0xff000000);
10 file input = popen(popen_direction.read, true, "objdump",
11 "objdump", "-j", ".text",
13 "--stop-address=0x20",
17 void add_in(int addr, int value) {
20 } else if (addr == 0x1c) {
21 printf ("-DCKSUM=0x%08x\n", -sum & 0xffffffff);
25 while (!File::end(input)) {
26 string line = File::fgets(input);
27 string[] words = String::wordsplit(line, " ");
31 if (words[0] == "0000" || words[0] == "0010") {
32 int addr = string_to_integer(words[0], 16);
33 for (int i = 0; i < 4; i++)
34 add_in(addr + i * 4, byteflip(string_to_integer(words[i+1], 16)));