It is not possible with few modifications.
2.2 Position-Independent Code
Many compilers can be instructed to emit code that does not rely on
being bound to any particular position in the program’s address space.
These code sequences are often referred to as position-independent
Answering my own question for anyone in the future that comes across this post searching for answers to games that use the same middleware (SCE-RT/Medius SDK), the packet above is a standard x509 certificate. You can binwalk your game's executable and extract the unformatted certificate.
There doesn't seem to be a straightforward way to achieve this. But you can take a look at this page of the IDA SDK documentation.
According to the description of the previous page, we can write a little helper function:
tbyte = 8
dt_ldbl = 8
n_bytes = [ 1, 2, 4, 4, 8,
tbyte, -1, 8, 16, -1,
There are several things in your example that makes it hard to decompile.
s is the first, and only, local (so on the stack) variable in main(). main() is troublesome, as it's more or less a vararg-function if you read the C++ standard, and as you can see atleast IDA guesses that you have three arguments on the stack.
You use both int and long in your ...
how does the Unix loader know what is the module,
shared object where to search for this symbol
Short answer: it does not. It just searches the whole list of loaded modules until the symbol is found (or not). A small degree of control over more exact symbol matching can be achieved via versioned symbols but otherwise it's pretty much a free-for-all.
The default compilation options do not embed full debugging information, and a small structure passed by value is indistinguishable from a bunch of individual arguments passed in registers (see the ABI spec). You will get a slightly better output if you enable DWARF debug info generation (-gdwarf). At least IDA can make use of DWARF info to import types, ...
Android uses a Bionic libc implementation as opposed to the more common glibc in most Linux distros.
This means that most android files are not compatible and won’t run on Linux even if the processor architecture is the same.
In theory it should be possible to compile Bionic for standard Linux and I think there was a project for that but I can’t find it ...