Code:
[09:37] kung foo man: #if COD_VERSION == COD4_1_7
//08048000-0817d000 rwxp 00000000 00:8e 8716292 /root/helper/game_cod4/cod4_1_7-bin
//0817d000-0826a000 r-xp 00135000 00:8e 8716292 /root/helper/game_cod4/cod4_1_7-bin
//0826a000-08274000 rw-p 00221000 00:8e 8716292 /root/helper/game_cod4/cod4_1_7-bin
mprotect((void *)0x08048000, 0x135000, PROT_READ | PROT_WRITE | PROT_EXEC);
mprotect((void *)0x0817d000, 0xED000, PROT_READ | PROT_WRITE | PROT_EXEC);
mprotect((void *)0x0826a000, 0xA000, PROT_READ | PROT_WRITE | PROT_EXEC);
#else
// allow to write in executable memory
mprotect((void *)0x08048000, 0x135000, PROT_READ | PROT_WRITE | PROT_EXEC);
#endif
[09:37] kung foo man: in https://github.com/kungfooman/libcod/blob/master/libcod.cpp
[09:37] kung foo man: maybe those addresses changed
[09:37] kung foo man: cat /proc/$cod2pid/maps
[mitch@Gazpacho cod2]$ cat /proc/1739/maps
08048000-0817d000 r-xp 00000000 fe:00 110100910 /mnt/cobra/Spellen/cod2/cod2_lnxded
0817d000-08189000 rw-p 00134000 fe:00 110100910 /mnt/cobra/Spellen/cod2/cod2_lnxded
08189000-08a70000 rw-p 00000000 00:00 0
0a8c7000-0ad53000 rw-p 00000000 00:00 0 [heap]
e5560000-e5631000 r-xp 00000000 fe:00 111019504 /mnt/cobra/Spellen/cod2/pb/pbcls.so
e5631000-e5640000 rw-p 000d0000 fe:00 111019504 /mnt/cobra/Spellen/cod2/pb/pbcls.so
e5640000-e57ad000 rw-p 00000000 00:00 0
e57ad000-e58f5000 r-xp 00000000 fe:00 111019510 /mnt/cobra/Spellen/cod2/pb/pbsv.so
e58f5000-e5902000 rw-p 00147000 fe:00 111019510 /mnt/cobra/Spellen/cod2/pb/pbsv.so
e5902000-ed124000 rw-p 00000000 00:00 0
ed124000-ed137000 r-xp 00000000 00:0f 147677 /usr/lib32/libresolv-2.18.so
ed137000-ed138000 ---p 00013000 00:0f 147677 /usr/lib32/libresolv-2.18.so
ed138000-ed139000 r--p 00013000 00:0f 147677 /usr/lib32/libresolv-2.18.so
ed139000-ed13a000 rw-p 00014000 00:0f 147677 /usr/lib32/libresolv-2.18.so
ed13a000-ed13c000 rw-p 00000000 00:00 0
ed13c000-ed141000 r-xp 00000000 00:0f 147669 /usr/lib32/libnss_dns-2.18.so
ed141000-ed142000 r--p 00004000 00:0f 147669 /usr/lib32/libnss_dns-2.18.so
ed142000-ed143000 rw-p 00005000 00:0f 147669 /usr/lib32/libnss_dns-2.18.so
ed143000-ed14e000 r-xp 00000000 00:0f 147670 /usr/lib32/libnss_files-2.18.so
ed14e000-ed14f000 r--p 0000a000 00:0f 147670 /usr/lib32/libnss_files-2.18.so
ed14f000-ed150000 rw-p 0000b000 00:0f 147670 /usr/lib32/libnss_files-2.18.so
ed15f000-ed165000 r-xp 00000000 fe:00 111019498 /mnt/cobra/Spellen/cod2/pb/pbags.so
ed165000-ed168000 rw-p 00005000 fe:00 111019498 /mnt/cobra/Spellen/cod2/pb/pbags.so
ed168000-f716d000 rw-p 00000000 00:00 0
f716f000-f7408000 rw-p 00000000 00:00 0
f7408000-f75b1000 r-xp 00000000 00:0f 147622 /usr/lib32/libc-2.18.so
f75b1000-f75b3000 r--p 001a9000 00:0f 147622 /usr/lib32/libc-2.18.so
f75b3000-f75b4000 rw-p 001ab000 00:0f 147622 /usr/lib32/libc-2.18.so
f75b4000-f75b7000 rw-p 00000000 00:00 0
f75b7000-f75d0000 r-xp 00000000 00:0f 147970 /usr/lib32/libgcc_s.so.1
f75d0000-f75d1000 rw-p 00018000 00:0f 147970 /usr/lib32/libgcc_s.so.1
f75d1000-f75d2000 rw-p 00000000 00:00 0
f75d2000-f7616000 r-xp 00000000 00:0f 147675 /usr/lib32/libm-2.18.so
f7616000-f7617000 r--p 00043000 00:0f 147675 /usr/lib32/libm-2.18.so
f7617000-f7618000 rw-p 00044000 00:0f 147675 /usr/lib32/libm-2.18.so
f7618000-f76c8000 r-xp 00000000 00:0f 135561 /usr/lib32/libstdc++.so.5.0.7
f76c8000-f76cd000 rw-p 000b0000 00:0f 135561 /usr/lib32/libstdc++.so.5.0.7
f76cd000-f76d2000 rw-p 00000000 00:00 0
f76d2000-f76ea000 r-xp 00000000 00:0f 147604 /usr/lib32/libpthread-2.18.so
f76ea000-f76eb000 r--p 00017000 00:0f 147604 /usr/lib32/libpthread-2.18.so
f76eb000-f76ec000 rw-p 00018000 00:0f 147604 /usr/lib32/libpthread-2.18.so
f76ec000-f76ee000 rw-p 00000000 00:00 0
f76ee000-f76f1000 r-xp 00000000 00:0f 147674 /usr/lib32/libdl-2.18.so
f76f1000-f76f2000 r--p 00002000 00:0f 147674 /usr/lib32/libdl-2.18.so
f76f2000-f76f3000 rw-p 00003000 00:0f 147674 /usr/lib32/libdl-2.18.so
f76f3000-f7710000 rw-p 00000000 00:00 0
f7710000-f7711000 r-xp 00000000 00:00 0 [vdso]
f7711000-f7731000 r-xp 00000000 00:0f 147621 /usr/lib32/ld-2.18.so
f7731000-f7732000 r--p 0001f000 00:0f 147621 /usr/lib32/ld-2.18.so
f7732000-f7733000 rw-p 00020000 00:0f 147621 /usr/lib32/ld-2.18.so
ffb8d000-ffbad000 rwxp 00000000 00:00 0 [stack]
ffbad000-ffbae000 rw-p 00000000 00:00 0