Hi
You will have to create a Custom Workflow Activity (CWA) that takes case as Input parameter and checks if there are any attachments to the case and returns a boolean (HasDocument/HasAttachment) as output. You can then use this custom workflow activity as shown below in your workflow

Your workflow should have a parallel wait condition on case status so that if the case resolved before 2 days, there is no point in waiting so the workflow can end.
The second wait is based on time, 2 days from created on and when it times out, your CWA will be called to check if the Case has any attachments.
If the case does not have any, you can resolve the case as shown in the screenshot.
To check if a case has any attachment, the query could be defined as shown below

Since we cant execute this query in Workflow step, we need the CWA to execute this and please see the section below for c# version of the above advance find query.
Your custom workflow activity could execute the following code to check if the case has any attachment
// Define Condition Values
var QEincident_incidentid = "b69e62a8-90df-e311-9565-a45d36fc5fe8"; - Case ID Goes here
var QEincident_annotation_isdocument = true;
var QEincident = new QueryExpression("incident");
QEincident.Distinct = true;
QEincident.ColumnSet.AddColumns("title");
QEincident.Criteria.AddCondition("incidentid", ConditionOperator.Equal, QEincident_incidentid);
var QEincident_annotation = QEincident.AddLink("annotation", "incidentid", "objectid");
QEincident_annotation.EntityAlias = "aa";
QEincident_annotation.LinkCriteria.AddCondition("isdocument", ConditionOperator.Equal, QEincident_annotation_isdocument);
QEincident_annotation.LinkCriteria.AddCondition("filename", ConditionOperator.NotNull);
var results = crmService.RetrieveMultiple(QEincident);
if (results.Entities.Any())
{
// Case has attachments - return true
}
else
{
//Case has no attachment - return false
}
Hope this helps