Libqqwry is a project mainly written in C, it's free.
$ make $ ./qqwry_query 114.80.230.198 | iconv -f gbk
@see https://github.com/liwei/libQQWry