1

I want IDApro show functions name and variables, like: _readwrite, _dolisten but it only shows sub_40xxxx in function window.

How can I edit the compile option to achieve it?

The original Makefile is:

CC=gcc

CFLAGS=-DNDEBUG -DWIN32 -D_CONSOLE -DTELNET -DGAPING_SECURITY_HOLE
LDFLAGS=-s -lkernel32 -luser32 -lwsock32 -lwinmm

all: nc.exe

nc.exe: getopt.c doexec.c netcat.c
    $(CC) $(CFLAGS) getopt.c doexec.c netcat.c $(LDFLAGS) -o nc.exe
3
  • Euh, it should be able to do so by default. If it can't, then the reason probably is that you stripped the executable.
    – user529758
    Jul 22, 2013 at 8:36
  • stripped the executable?what is it? Jul 22, 2013 at 8:42
  • I found nc that can show function name is 2.5 times larger in filesize than mine, maybe it had added addtional debugger info? Jul 22, 2013 at 8:45

1 Answer 1

1

You are probably using mingw on Windows. So, the -s option in the LDFLAGS means that the final binary will be stripped. Just remove this option.

Moreover, you can try to add more debug information in order to help IDAPro to recover as much as possible from the program by adding -g3 to the CFLAGS and by replacing -DNDEBUG by -DDEBUG (it will also probably add more insightful messages from the software).

At the end you should have something like this:

CFLAGS=-g3 -DDEBUG -DWIN32 -D_CONSOLE -DTELNET -DGAPING_SECURITY_HOLE
LDFLAGS=-lkernel32 -luser32 -lwsock32 -lwinmm

Just as a side note, you may be answered much more efficiently about question on IDAPro on RE.

5
  • thanks, I tried -g and remove -DNDEBUG, but not solve the problem. Jul 22, 2013 at 10:00
  • What if you replace -DNDEBUG by -DDEBUG ?
    – perror
    Jul 22, 2013 at 10:09
  • I know ! In fact, you are using mingw, then just remove the -s from the LDFLAGS. Adding -g3 and replacing -DNDEBUG by -DDEBUG will just give you more precise information (it could be quite useful anyway to IDAPro).
    – perror
    Jul 22, 2013 at 10:43
  • It works!! But -g3 makes the executable super big, I use -g; -s:Omit all symbol information from the output file. Jul 22, 2013 at 11:10
  • In fact, the -g option can come with a number to indicate the level of information you want to embed in the binary. Default is -g2, and -g3 add everything you might want to trace inside the binary. If you want a lightweight debug binary, just use -g1.
    – perror
    Jul 22, 2013 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.