I'm reversing an open-source windows application written in C++. I found in the disassembler the desired function that I'm trying to understand its behavior.
In the code this function is defined as follow:
void ProtocolGame::sendUseItem(const Position& position, int itemId, int stackpos, int index)
{
OutputMessagePtr msg(new OutputMessage);
msg->addU8(Proto::ClientUseItem);
addPosition(msg, position);
msg->addU16(itemId);
msg->addU8(stackpos);
msg->addU8(index);
send(msg);
}
As you can see, this function has 4 parameters, but in assembly code it only pushes 2 args. See picture below.
What is going on with this CALL procedure? Shouldn't it have 4 arguments?
__fastcall
. It will more likely be__thiscall
instead, soecx
does contain a parameter, but it will be the hiddenthis
pointer, and not one of the four named argument. I agree that more context is needed to be sure, though.