Thread: x64dbg
View Single Post
  #79  
Old 04-17-2014, 07:42
ahmadmansoor's Avatar
ahmadmansoor ahmadmansoor is offline
Coder
 
Join Date: Feb 2006
Location: Syria
Posts: 1,045
Rept. Given: 509
Rept. Rcvd 373 Times in 142 Posts
Thanks Given: 336
Thanks Rcvd at 407 Times in 119 Posts
ahmadmansoor Reputation: 300-399 ahmadmansoor Reputation: 300-399 ahmadmansoor Reputation: 300-399 ahmadmansoor Reputation: 300-399
Lightbulb "invalid pe" Bug Fix

Hi mr.exodia
no my friend the problem came form here ((DevicePathToPath))
specially from this command
Quote:
if(!_strnicmp(devicepath, curDevice, x)) //we match the device
I think u useing it wrong

this is how I modify the code to make it work
Quote:
bool DevicePathToPath(const char* devicepath, char* path, size_t path_size)
{
if(!devicepath or !path)
return false;
char curDrive[3]=" :";
char curDevice[MAX_PATH]="";
for(char drive='C'; drive<='Z'; drive++)
{
*curDrive=drive;
if(!QueryDosDeviceA(curDrive, curDevice, MAX_PATH))
continue;

std::string str(curDevice);
std::string str1(devicepath);
std::string temp,temp1;
int x=0;
for (int i=0;i<=str1.size();i++)
{
temp1=str1.substr(i,1);
if (temp1.compare("\\")==0){x=x+1;};
if (x==3){x=i;break;};
}
str1=str1.substr(0,x);
if(str1.compare(str)==0 )
{
//if(strlen(devicepath)-curDevice_len>=path_size)
if(strlen(devicepath)-x>=path_size)
return false;
//sprintf(path, "%s%s", curDrive, devicepath+curDevice_len);
sprintf(path, "%s%s", curDrive, devicepath+x);
return true;
}
}
return false;
}
note : I just like to work with string than other lab lab ( char -const char ...)

please try the attached files .
bs : thanks for the hint for Refreshing GUI
Attached Files
File Type: rar x64_fix.rar (116.7 KB, 8 views)
File Type: rar bridge.rar (14.0 KB, 6 views)
__________________
Ur Best Friend Ahmadmansoor
Always My Best Friend: Aaron & JMI & ZeNiX
Reply With Quote