Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling compiled code without source code?

I'm working with an application that has a SDK for it and a bunch of dev tools, I also did a lot of code analysis using IDA Pro on it so I'm quite comfortable with it. It's basically, to put it short, a gameserver application, so you can see the kind of stuff I'm dealing with : supports mods, so there is to be some documented internals of it, which makes it easier to deal with its assembly.

However the source code not being released it is difficult for me to put my finger on a source of, I would say, "CPU overhead" I'd like to identify in order to maybe rewrite that part using DLL injection for example to "replace" the offending code, or even suppress it, depending on how its needed.

I wonder, is it possible to profile a binary executable that you can't get the source code of? Something that could analyse the code at the opcode/assembly level?

Thanks!

like image 422
Yannick Avatar asked Nov 27 '25 16:11

Yannick


1 Answers

You are correct that traditional profiles such as gprof work by inserting additional code at compile time and will not be helpful in your current situation.

Perhaps a tool like Valgrind can help.

like image 133
user4495048 Avatar answered Nov 29 '25 18:11

user4495048