DBG: fixed many warnings on x64 (size_t conversions)
This commit is contained in:
parent
47c0518f59
commit
250271ed03
|
@ -20,7 +20,7 @@ BRIDGE_IMPEXP const char* BridgeInit()
|
|||
///Settings load
|
||||
if(!GetModuleFileNameA(0, szIniFile, 1024))
|
||||
return "Error getting module path!";
|
||||
int len=strlen(szIniFile);
|
||||
int len=(int)strlen(szIniFile);
|
||||
while(szIniFile[len]!='.' && szIniFile[len]!='\\')
|
||||
len--;
|
||||
if(szIniFile[len]=='\\')
|
||||
|
@ -500,7 +500,7 @@ BRIDGE_IMPEXP void DbgScriptSetIp(int line)
|
|||
|
||||
BRIDGE_IMPEXP bool DbgScriptGetBranchInfo(int line, SCRIPTBRANCH* info)
|
||||
{
|
||||
return (bool)(duint)_dbg_sendmessage(DBG_SCRIPT_GETBRANCHINFO, (void*)(duint)line, info);
|
||||
return !!_dbg_sendmessage(DBG_SCRIPT_GETBRANCHINFO, (void*)(duint)line, info);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP void DbgSymbolEnum(duint base, CBSYMBOLENUM cbSymbolEnum, void* user)
|
||||
|
@ -531,7 +531,7 @@ BRIDGE_IMPEXP void DbgDisasmAt(duint addr, DISASM_INSTR* instr)
|
|||
|
||||
BRIDGE_IMPEXP bool DbgStackCommentGet(duint addr, STACK_COMMENT* comment)
|
||||
{
|
||||
return (bool)(duint)_dbg_sendmessage(DBG_STACK_COMMENT_GET, (void*)addr, comment);
|
||||
return !!_dbg_sendmessage(DBG_STACK_COMMENT_GET, (void*)addr, comment);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP void DbgGetThreadList(THREADLIST* list)
|
||||
|
@ -922,7 +922,7 @@ BRIDGE_IMPEXP void GuiSetLastException(unsigned int exception)
|
|||
|
||||
BRIDGE_IMPEXP bool GuiGetDisassembly(duint addr, char* text)
|
||||
{
|
||||
return (bool)(duint)_gui_sendmessage(GUI_GET_DISASSEMBLY, (void*)addr, text);
|
||||
return !!_gui_sendmessage(GUI_GET_DISASSEMBLY, (void*)addr, text);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP int GuiMenuAdd(int hMenu, const char* title)
|
||||
|
@ -947,17 +947,17 @@ BRIDGE_IMPEXP void GuiMenuClear(int hMenu)
|
|||
|
||||
BRIDGE_IMPEXP bool GuiSelectionGet(int hWindow, SELECTIONDATA* selection)
|
||||
{
|
||||
return (bool)(duint)_gui_sendmessage(GUI_SELECTION_GET, (void*)(duint)hWindow, selection);
|
||||
return !!_gui_sendmessage(GUI_SELECTION_GET, (void*)(duint)hWindow, selection);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP bool GuiSelectionSet(int hWindow, const SELECTIONDATA* selection)
|
||||
{
|
||||
return (bool)(duint)_gui_sendmessage(GUI_SELECTION_SET, (void*)(duint)hWindow, (void*)selection);
|
||||
return !!_gui_sendmessage(GUI_SELECTION_SET, (void*)(duint)hWindow, (void*)selection);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP bool GuiGetLineWindow(const char* title, char* text)
|
||||
{
|
||||
return (bool)(duint)_gui_sendmessage(GUI_GETLINE_WINDOW, (void*)title, text);
|
||||
return !!_gui_sendmessage(GUI_GETLINE_WINDOW, (void*)title, text);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP void GuiAutoCompleteAddCmd(const char* cmd)
|
||||
|
|
|
@ -73,7 +73,7 @@ extern "C" DLL_EXPORT bool _dbg_memmap(MEMMAP* memmap)
|
|||
//filter executable sections
|
||||
if(bListAllPages)
|
||||
{
|
||||
pagecount=pageVector.size();
|
||||
pagecount=(int)pageVector.size();
|
||||
char curMod[MAX_MODULE_SIZE]="";
|
||||
for(int i=pagecount-1,curIdx=0; i>-1; i--)
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ extern "C" DLL_EXPORT bool _dbg_memmap(MEMMAP* memmap)
|
|||
}
|
||||
|
||||
//process file sections
|
||||
pagecount=pageVector.size();
|
||||
pagecount=(int)pageVector.size();
|
||||
char curMod[MAX_MODULE_SIZE]="";
|
||||
for(int i=pagecount-1; i>-1; i--)
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ extern "C" DLL_EXPORT bool _dbg_memmap(MEMMAP* memmap)
|
|||
char curModPath[MAX_PATH]="";
|
||||
if(!GetModuleFileNameExA(fdProcessInfo->hProcess, hMod, curModPath, MAX_PATH))
|
||||
continue;
|
||||
int SectionNumber=GetPE32Data(curModPath, 0, UE_SECTIONNUMBER);
|
||||
ULONG_PTR SectionNumber=GetPE32Data(curModPath, 0, UE_SECTIONNUMBER);
|
||||
MEMPAGE newPage;
|
||||
pageVector.erase(pageVector.begin()+i); //remove the SizeOfImage page
|
||||
for(int j=SectionNumber-1; j>-1; j--)
|
||||
|
@ -125,7 +125,7 @@ extern "C" DLL_EXPORT bool _dbg_memmap(MEMMAP* memmap)
|
|||
const char* SectionName=(const char*)GetPE32Data(curModPath, j, UE_SECTIONNAME);
|
||||
if(!SectionName)
|
||||
SectionName="";
|
||||
int len=strlen(SectionName);
|
||||
int len=(int)strlen(SectionName);
|
||||
int escape_count=0;
|
||||
for(int k=0; k<len; k++)
|
||||
if(SectionName[k]=='\\' or SectionName[k]=='\"' or !isprint(SectionName[k]))
|
||||
|
@ -178,7 +178,7 @@ extern "C" DLL_EXPORT bool _dbg_memmap(MEMMAP* memmap)
|
|||
}
|
||||
|
||||
//process vector
|
||||
memmap->count=pagecount=pageVector.size();
|
||||
memmap->count=pagecount=(int)pageVector.size();
|
||||
memmap->page=(MEMPAGE*)BridgeAlloc(sizeof(MEMPAGE)*pagecount);
|
||||
memset(memmap->page, 0, sizeof(MEMPAGE)*pagecount);
|
||||
for(int i=0; i<pagecount; i++)
|
||||
|
@ -298,7 +298,7 @@ extern "C" DLL_EXPORT bool _dbg_addrinfoget(duint addr, SEGMENTREG segment, ADDR
|
|||
{
|
||||
char filename[deflen]="";
|
||||
strcpy(filename, line.FileName);
|
||||
int len=strlen(filename);
|
||||
int len=(int)strlen(filename);
|
||||
while(filename[len]!='\\' and len!=0)
|
||||
len--;
|
||||
if(len)
|
||||
|
@ -539,7 +539,7 @@ extern "C" DLL_EXPORT bool _dbg_getregdump(REGDUMP* regdump)
|
|||
#endif // _WIN64
|
||||
r.csp=(duint)GetContextData(UE_CSP);
|
||||
r.cip=(duint)GetContextData(UE_CIP);
|
||||
r.eflags=(duint)GetContextData(UE_EFLAGS);
|
||||
r.eflags=(unsigned int)GetContextData(UE_EFLAGS);
|
||||
r.gs=(unsigned short)(GetContextData(UE_SEG_GS)&0xFFFF);
|
||||
r.fs=(unsigned short)(GetContextData(UE_SEG_FS)&0xFFFF);
|
||||
r.es=(unsigned short)(GetContextData(UE_SEG_ES)&0xFFFF);
|
||||
|
|
|
@ -65,7 +65,7 @@ bool arraycontains(const char* cmd_list, const char* cmd)
|
|||
return false;
|
||||
char temp[deflen]="";
|
||||
strcpy(temp, cmd_list);
|
||||
int len=strlen(cmd_list);
|
||||
int len=(int)strlen(cmd_list);
|
||||
if(len>=deflen)
|
||||
return false;
|
||||
for(int i=0; i<len; i++)
|
||||
|
@ -73,13 +73,13 @@ bool arraycontains(const char* cmd_list, const char* cmd)
|
|||
temp[i]=0;
|
||||
if(!_stricmp(temp, cmd))
|
||||
return true;
|
||||
for(int i=strlen(temp); i<len; i++)
|
||||
for(int i=(int)strlen(temp); i<len; i++)
|
||||
{
|
||||
if(!temp[i])
|
||||
{
|
||||
if(!_stricmp(temp+i+1, cmd))
|
||||
return true;
|
||||
i+=strlen(temp+i+1);
|
||||
i+=(int)strlen(temp+i+1);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
@ -94,7 +94,7 @@ bool scmp(const char* a, const char* b)
|
|||
|
||||
void formathex(char* string)
|
||||
{
|
||||
int len=strlen(string);
|
||||
int len=(int)strlen(string);
|
||||
_strupr(string);
|
||||
char* new_string=(char*)emalloc(len+1, "formathex:new_string");
|
||||
memset(new_string, 0, len+1);
|
||||
|
@ -107,7 +107,7 @@ void formathex(char* string)
|
|||
|
||||
void formatdec(char* string)
|
||||
{
|
||||
int len=strlen(string);
|
||||
int len=(int)strlen(string);
|
||||
_strupr(string);
|
||||
char* new_string=(char*)emalloc(len+1, "formatdec:new_string");
|
||||
memset(new_string, 0, len+1);
|
||||
|
|
|
@ -85,14 +85,14 @@ bool modload(uint base, uint size, const char* fullpath)
|
|||
if(!base or !size or !fullpath)
|
||||
return false;
|
||||
char name[deflen]="";
|
||||
int len=strlen(fullpath);
|
||||
int len=(int)strlen(fullpath);
|
||||
while(fullpath[len]!='\\' and len)
|
||||
len--;
|
||||
if(len)
|
||||
len++;
|
||||
strcpy(name, fullpath+len);
|
||||
_strlwr(name);
|
||||
len=strlen(name);
|
||||
len=(int)strlen(name);
|
||||
name[MAX_MODULE_SIZE-1]=0; //ignore later characters
|
||||
while(name[len]!='.' and len)
|
||||
len--;
|
||||
|
@ -162,7 +162,7 @@ uint modhashfromname(const char* mod) //return MODINFO.hash
|
|||
{
|
||||
if(!mod or !*mod)
|
||||
return 0;
|
||||
int len=strlen(mod);
|
||||
int len=(int)strlen(mod);
|
||||
return murmurhash(mod, len);
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,7 @@ bool apienumexports(uint base, EXPORTENUMCALLBACK cbEnum)
|
|||
char forwarded_api[deflen]="";
|
||||
memset(forwarded_api, 0, deflen);
|
||||
memread(fdProcessInfo->hProcess, (void*)(curFunctionRva+base), forwarded_api, deflen, 0);
|
||||
int len=strlen(forwarded_api);
|
||||
int len=(int)strlen(forwarded_api);
|
||||
int j=0;
|
||||
while(forwarded_api[j]!='.' and j<len)
|
||||
j++;
|
||||
|
@ -550,7 +550,7 @@ void labelcacheload(JSON root)
|
|||
strcpy(curLabel.text, text);
|
||||
else
|
||||
continue; //skip
|
||||
int len=strlen(curLabel.text);
|
||||
int len=(int)strlen(curLabel.text);
|
||||
for(int i=0; i<len; i++)
|
||||
if(curLabel.text[i]=='&')
|
||||
curLabel.text[i]=' ';
|
||||
|
|
|
@ -31,7 +31,7 @@ void argformat(char* cmd)
|
|||
strcpy(command, cmd);
|
||||
while(*command==' ')
|
||||
command++;
|
||||
int len=strlen(command);
|
||||
int len=(int)strlen(command);
|
||||
int start=0;
|
||||
for(int i=0; i<len; i++)
|
||||
if(command[i]==' ')
|
||||
|
@ -46,7 +46,7 @@ void argformat(char* cmd)
|
|||
char* arguments=arguments_;
|
||||
strcpy(arguments, command+start);
|
||||
char temp[deflen]="";
|
||||
len=strlen(arguments);
|
||||
len=(int)strlen(arguments);
|
||||
for(int i=0,j=0; i<len; i++)
|
||||
{
|
||||
if(arguments[i]=='"' and arguments[i+1]=='"')
|
||||
|
@ -54,7 +54,7 @@ void argformat(char* cmd)
|
|||
j+=sprintf(temp+j, "%c", arguments[i]);
|
||||
}
|
||||
strcpy(arguments, temp);
|
||||
len=strlen(arguments);
|
||||
len=(int)strlen(arguments);
|
||||
for(int i=0; i<len; i++)
|
||||
if(arguments[i]=='\\' and arguments[i+1]=='\\')
|
||||
{
|
||||
|
@ -63,11 +63,11 @@ void argformat(char* cmd)
|
|||
}
|
||||
while((*arguments==',' or *arguments==' ') and *(arguments-1)!='\\')
|
||||
arguments++;
|
||||
len=strlen(arguments);
|
||||
len=(int)strlen(arguments);
|
||||
while((arguments[len-1]==' ' or arguments[len-1]==',') and arguments[len-2]!='\\')
|
||||
len--;
|
||||
arguments[len]=0;
|
||||
len=strlen(arguments);
|
||||
len=(int)strlen(arguments);
|
||||
int quote_count=0;
|
||||
for(int i=0; i<len; i++)
|
||||
if(arguments[i]=='"')
|
||||
|
@ -90,7 +90,7 @@ void argformat(char* cmd)
|
|||
if(!arguments[i])
|
||||
{
|
||||
i++;
|
||||
int len2=strlen(arguments+i);
|
||||
int len2=(int)strlen(arguments+i);
|
||||
for(int k=0; k<len2; k++)
|
||||
{
|
||||
if(arguments[i+k]==',' or arguments[i+k]==' ' or arguments[i+k]=='\\')
|
||||
|
@ -106,14 +106,14 @@ void argformat(char* cmd)
|
|||
arguments=arguments_;
|
||||
strcpy(arguments, temp);
|
||||
}
|
||||
len=strlen(arguments);
|
||||
len=(int)strlen(arguments);
|
||||
for(int i=0; i<len; i++)
|
||||
if(arguments[i]=='\\' and arguments[i+1]=='\\')
|
||||
{
|
||||
arguments[i]=1;
|
||||
arguments[i+1]=1;
|
||||
}
|
||||
len=strlen(arguments);
|
||||
len=(int)strlen(arguments);
|
||||
for(int i=0,j=0; i<len; i++)
|
||||
{
|
||||
if(arguments[i]==',' and arguments[i+1]==',')
|
||||
|
@ -121,7 +121,7 @@ void argformat(char* cmd)
|
|||
j+=sprintf(temp+j, "%c", arguments[i]);
|
||||
}
|
||||
strcpy(arguments, temp);
|
||||
len=strlen(arguments);
|
||||
len=(int)strlen(arguments);
|
||||
for(int i=0,j=0; i<len; i++)
|
||||
{
|
||||
while(arguments[i]==' ' and arguments[i-1]!='\\')
|
||||
|
@ -129,7 +129,7 @@ void argformat(char* cmd)
|
|||
j+=sprintf(temp+j, "%c", arguments[i]);
|
||||
}
|
||||
strcpy(arguments, temp);
|
||||
len=strlen(arguments);
|
||||
len=(int)strlen(arguments);
|
||||
for(int i=0; i<len; i++)
|
||||
if(arguments[i]==1 and arguments[i+1]==1)
|
||||
{
|
||||
|
@ -148,7 +148,7 @@ void argformat(char* cmd)
|
|||
*/
|
||||
int arggetcount(const char* cmd)
|
||||
{
|
||||
int len=strlen(cmd);
|
||||
int len=(int)strlen(cmd);
|
||||
if(!len or len>=deflen)
|
||||
return -1;
|
||||
|
||||
|
@ -202,7 +202,7 @@ bool argget(const char* cmd, char* arg, int arg_num, bool optional)
|
|||
char temp_[deflen]="";
|
||||
char* temp=temp_+1;
|
||||
strcpy(temp, cmd+start);
|
||||
int len=strlen(temp);
|
||||
int len=(int)strlen(temp);
|
||||
for(int i=0; i<len; i++)
|
||||
if(temp[i]=='\\' and temp[i+1]=='\\')
|
||||
{
|
||||
|
|
|
@ -76,7 +76,7 @@ COMMAND* cmdget(COMMAND* command_list, const char* cmd)
|
|||
{
|
||||
char new_cmd[deflen]="";
|
||||
strcpy(new_cmd, cmd);
|
||||
int len=strlen(new_cmd);
|
||||
int len=(int)strlen(new_cmd);
|
||||
int start=0;
|
||||
while(new_cmd[start]!=' ' and start<len)
|
||||
start++;
|
||||
|
@ -205,7 +205,7 @@ static bool isvalidexpression(const char* expression)
|
|||
|
||||
static void specialformat(char* string)
|
||||
{
|
||||
int len=strlen(string);
|
||||
int len=(int)strlen(string);
|
||||
char* found=strstr(string, "=");
|
||||
char* str=(char*)emalloc(len*2, "specialformat:str");
|
||||
char* backup=(char*)emalloc(len+1, "specialformat:backup");
|
||||
|
@ -223,7 +223,7 @@ static void specialformat(char* string)
|
|||
efree(backup, "specialformat:backup");
|
||||
return;
|
||||
}
|
||||
int flen=strlen(found); //n(+)=n++
|
||||
int flen=(int)strlen(found); //n(+)=n++
|
||||
if((found[flen-1]=='+' and found[flen-2]=='+') or (found[flen-1]=='-' and found[flen-2]=='-')) //eax++/eax--
|
||||
{
|
||||
found[flen-2]=0;
|
||||
|
|
|
@ -399,7 +399,7 @@ static BOOL CALLBACK SymRegisterCallbackProc64(HANDLE hProcess, ULONG ActionCode
|
|||
{
|
||||
evt=(PIMAGEHLP_CBA_EVENT)CallbackData;
|
||||
const char* text=(const char*)evt->desc;
|
||||
int len=strlen(text);
|
||||
int len=(int)strlen(text);
|
||||
bool suspress=false;
|
||||
for(int i=0; i<len; i++)
|
||||
if(text[i]==0x08)
|
||||
|
@ -569,7 +569,7 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo)
|
|||
dprintf("Process Started: "fhex" %s\n", base, DebugFileName);
|
||||
|
||||
//init program database
|
||||
int len=strlen(szFileName);
|
||||
int len=(int)strlen(szFileName);
|
||||
while(szFileName[len]!='\\' && len!=0)
|
||||
len--;
|
||||
if(len)
|
||||
|
@ -857,7 +857,7 @@ static void cbOutputDebugString(OUTPUT_DEBUG_STRING_INFO* DebugString)
|
|||
memset(DebugText, 0, DebugString->nDebugStringLength+1);
|
||||
if(memread(fdProcessInfo->hProcess, DebugString->lpDebugStringData, DebugText, DebugString->nDebugStringLength, 0))
|
||||
{
|
||||
int len=strlen(DebugText);
|
||||
int len=(int)strlen(DebugText);
|
||||
int escape_count=0;
|
||||
for(int i=0; i<len; i++)
|
||||
if(DebugText[i]=='\\' or DebugText[i]=='\"' or !isprint(DebugText[i]))
|
||||
|
@ -973,7 +973,7 @@ static void cbException(EXCEPTION_DEBUG_INFO* ExceptionData)
|
|||
memset(ThreadName, 0, MAX_THREAD_NAME_SIZE);
|
||||
if(memread(fdProcessInfo->hProcess, nameInfo.szName, ThreadName, MAX_THREAD_NAME_SIZE-1, 0))
|
||||
{
|
||||
int len=strlen(ThreadName);
|
||||
int len=(int)strlen(ThreadName);
|
||||
int escape_count=0;
|
||||
for(int i=0; i<len; i++)
|
||||
if(ThreadName[i]=='\\' or ThreadName[i]=='\"' or !isprint(ThreadName[i]))
|
||||
|
@ -1123,7 +1123,7 @@ static DWORD WINAPI threadDebugLoop(void* lpParameter)
|
|||
GuiSetDebugState(initialized);
|
||||
//set GUI title
|
||||
strcpy(szBaseFileName, szFileName);
|
||||
int len=strlen(szBaseFileName);
|
||||
int len=(int)strlen(szBaseFileName);
|
||||
while(szBaseFileName[len]!='\\' and len)
|
||||
len--;
|
||||
if(len)
|
||||
|
@ -1190,7 +1190,7 @@ CMDRESULT cbDebugInit(int argc, char* argv[])
|
|||
|
||||
static char currentfolder[deflen]="";
|
||||
strcpy(currentfolder, arg1);
|
||||
int len=strlen(currentfolder);
|
||||
int len=(int)strlen(currentfolder);
|
||||
while(currentfolder[len]!='\\' and len!=0)
|
||||
len--;
|
||||
currentfolder[len]=0;
|
||||
|
@ -1243,7 +1243,7 @@ CMDRESULT cbDebugErun(int argc, char* argv[])
|
|||
CMDRESULT cbDebugSetBPXOptions(int argc, char* argv[])
|
||||
{
|
||||
char argtype[deflen]="";
|
||||
uint type=0;
|
||||
DWORD type=0;
|
||||
if(!argget(*argv, argtype, 0, false))
|
||||
return STATUS_ERROR;
|
||||
const char* a=0;
|
||||
|
@ -1629,7 +1629,7 @@ CMDRESULT cbDebugSetMemoryBpx(int argc, char* argv[])
|
|||
else
|
||||
strcpy(arg3, arg2);
|
||||
}
|
||||
uint type=UE_MEMORY;
|
||||
DWORD type=UE_MEMORY;
|
||||
if(*arg3)
|
||||
{
|
||||
switch(*arg3)
|
||||
|
@ -1749,7 +1749,7 @@ CMDRESULT cbDebugSetHardwareBreakpoint(int argc, char* argv[])
|
|||
uint addr;
|
||||
if(!valfromstring(arg1, &addr))
|
||||
return STATUS_ERROR;
|
||||
uint type=UE_HARDWARE_EXECUTE;
|
||||
DWORD type=UE_HARDWARE_EXECUTE;
|
||||
char arg2[deflen]=""; //type
|
||||
if(argget(*argv, arg2, 1, true))
|
||||
{
|
||||
|
@ -1803,14 +1803,14 @@ CMDRESULT cbDebugSetHardwareBreakpoint(int argc, char* argv[])
|
|||
dputs("no free debug register");
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
int titantype=(drx<<8)|(type<<4)|size;
|
||||
int titantype=(drx<<8)|(type<<4)|(DWORD)size;
|
||||
//TODO: hwbp in multiple threads TEST
|
||||
if(bpget(addr, BPHARDWARE, 0, 0))
|
||||
{
|
||||
dputs("hardware breakpoint already set!");
|
||||
return STATUS_CONTINUE;
|
||||
}
|
||||
if(!bpnew(addr, true, false, 0, BPHARDWARE, titantype, 0) or !SetHardwareBreakPoint(addr, drx, type, size, (void*)cbHardwareBreakpoint))
|
||||
if(!bpnew(addr, true, false, 0, BPHARDWARE, titantype, 0) or !SetHardwareBreakPoint(addr, drx, type, (DWORD)size, (void*)cbHardwareBreakpoint))
|
||||
{
|
||||
dputs("error setting hardware breakpoint!");
|
||||
return STATUS_ERROR;
|
||||
|
@ -2049,7 +2049,7 @@ static DWORD WINAPI threadAttachLoop(void* lpParameter)
|
|||
lock(WAITID_STOP);
|
||||
bIsAttached=true;
|
||||
bSkipExceptions=false;
|
||||
uint pid=(uint)lpParameter;
|
||||
DWORD pid=(DWORD)lpParameter;
|
||||
static PROCESS_INFORMATION pi_attached;
|
||||
fdProcessInfo=&pi_attached;
|
||||
//do some init stuff
|
||||
|
@ -2070,7 +2070,7 @@ static DWORD WINAPI threadAttachLoop(void* lpParameter)
|
|||
GuiSetDebugState(initialized);
|
||||
//set GUI title
|
||||
strcpy(szBaseFileName, szFileName);
|
||||
int len=strlen(szBaseFileName);
|
||||
int len=(int)strlen(szBaseFileName);
|
||||
while(szBaseFileName[len]!='\\' and len)
|
||||
len--;
|
||||
if(len)
|
||||
|
@ -2082,7 +2082,7 @@ static DWORD WINAPI threadAttachLoop(void* lpParameter)
|
|||
plugincbcall(CB_INITDEBUG, &initInfo);
|
||||
//call plugin callback (attach)
|
||||
PLUG_CB_ATTACH attachInfo;
|
||||
attachInfo.dwProcessId=pid;
|
||||
attachInfo.dwProcessId=(DWORD)pid;
|
||||
plugincbcall(CB_ATTACH, &attachInfo);
|
||||
//run debug loop (returns when process debugging is stopped)
|
||||
AttachDebugger(pid, true, fdProcessInfo, (void*)cbAttachDebugger);
|
||||
|
@ -2123,7 +2123,7 @@ CMDRESULT cbDebugAttach(int argc, char* argv[])
|
|||
dputs("terminate the current session!");
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
HANDLE hProcess=TitanOpenProcess(PROCESS_ALL_ACCESS, false, pid);
|
||||
HANDLE hProcess=TitanOpenProcess(PROCESS_ALL_ACCESS, false, (DWORD)pid);
|
||||
if(!hProcess)
|
||||
{
|
||||
dprintf("could not open process %X!\n", pid);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include <cwctype>
|
||||
#include <cwchar>
|
||||
|
||||
unsigned int disasmback(unsigned char* data, uint base, uint size, uint ip, int n)
|
||||
uint disasmback(unsigned char* data, uint base, uint size, uint ip, int n)
|
||||
{
|
||||
int i;
|
||||
uint abuf[131], addr, back, cmdsize;
|
||||
|
@ -71,7 +71,7 @@ unsigned int disasmback(unsigned char* data, uint base, uint size, uint ip, int
|
|||
return abuf[(i - n + 128) % 128];
|
||||
}
|
||||
|
||||
unsigned int disasmnext(unsigned char* data, uint base, uint size, uint ip, int n)
|
||||
uint disasmnext(unsigned char* data, uint base, uint size, uint ip, int n)
|
||||
{
|
||||
int i;
|
||||
uint cmdsize;
|
||||
|
@ -101,7 +101,7 @@ unsigned int disasmnext(unsigned char* data, uint base, uint size, uint ip, int
|
|||
for(i = 0; i < n && size > 0; i++)
|
||||
{
|
||||
disasm.EIP = (UIntPtr)pdata;
|
||||
disasm.SecurityBlock = (UIntPtr)size;
|
||||
disasm.SecurityBlock = (UInt32)size;
|
||||
len = Disasm(&disasm);
|
||||
cmdsize = (len < 1) ? 1 : len;
|
||||
|
||||
|
@ -281,7 +281,7 @@ void disasmprint(uint addr)
|
|||
|
||||
static bool isasciistring(const unsigned char* data, int maxlen)
|
||||
{
|
||||
int len=strlen((const char*)data);
|
||||
int len=(int)strlen((const char*)data);
|
||||
if(len<2 or len+1>=maxlen)
|
||||
return false;
|
||||
for(int i=0; i<len; i++)
|
||||
|
@ -292,7 +292,7 @@ static bool isasciistring(const unsigned char* data, int maxlen)
|
|||
|
||||
static bool isunicodestring(const unsigned char* data, int maxlen)
|
||||
{
|
||||
int len=wcslen((const wchar_t*)data);
|
||||
int len=(int)wcslen((const wchar_t*)data);
|
||||
if(len<2 or len+1>=maxlen)
|
||||
return false;
|
||||
for(int i=0; i<len*2; i+=2)
|
||||
|
@ -344,7 +344,7 @@ bool disasmgetstringat(uint addr, STRING_TYPE* type, char* ascii, char* unicode,
|
|||
{
|
||||
if(type)
|
||||
*type=str_ascii;
|
||||
int len=strlen((const char*)data);
|
||||
int len=(int)strlen((const char*)data);
|
||||
for(int i=0,j=0; i<len; i++)
|
||||
{
|
||||
switch(data[i])
|
||||
|
@ -382,7 +382,7 @@ bool disasmgetstringat(uint addr, STRING_TYPE* type, char* ascii, char* unicode,
|
|||
{
|
||||
if(type)
|
||||
*type=str_unicode;
|
||||
int len=wcslen((const wchar_t*)data);
|
||||
int len=(int)wcslen((const wchar_t*)data);
|
||||
for(int i=0,j=0; i<len*2; i+=2)
|
||||
{
|
||||
switch(data[i])
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#include "_global.h"
|
||||
|
||||
//functions
|
||||
unsigned int disasmback(unsigned char* data, uint base, uint size, uint ip, int n);
|
||||
unsigned int disasmnext(unsigned char* data, uint base, uint size, uint ip, int n);
|
||||
uint disasmback(unsigned char* data, uint base, uint size, uint ip, int n);
|
||||
uint disasmnext(unsigned char* data, uint base, uint size, uint ip, int n);
|
||||
const char* disasmtext(uint addr);
|
||||
void disasmprint(uint addr);
|
||||
void disasmget(unsigned char* buffer, uint addr, DISASM_INSTR* instr);
|
||||
|
|
|
@ -177,7 +177,7 @@ CMDRESULT cbInstrVarList(int argc, char* argv[])
|
|||
{
|
||||
char name[deflen]="";
|
||||
strcpy(name, cur->name);
|
||||
int len=strlen(name);
|
||||
int len=(int)strlen(name);
|
||||
for(int i=0; i<len; i++)
|
||||
if(name[i]==1)
|
||||
name[i]='/';
|
||||
|
@ -1000,7 +1000,7 @@ CMDRESULT cbInstrFind(int argc, char* argv[])
|
|||
strcpy(pattern, argv[2]+1);
|
||||
else
|
||||
strcpy(pattern, argv[2]);
|
||||
int len=strlen(pattern);
|
||||
int len=(int)strlen(pattern);
|
||||
if(pattern[len-1]=='#')
|
||||
pattern[len-1]='\0';
|
||||
uint size=0;
|
||||
|
@ -1054,7 +1054,7 @@ CMDRESULT cbInstrFindAll(int argc, char* argv[])
|
|||
strcpy(pattern, argv[2]+1);
|
||||
else
|
||||
strcpy(pattern, argv[2]);
|
||||
int len=strlen(pattern);
|
||||
int len=(int)strlen(pattern);
|
||||
if(pattern[len-1]=='#')
|
||||
pattern[len-1]='\0';
|
||||
uint size=0;
|
||||
|
@ -1203,7 +1203,7 @@ CMDRESULT cbInstrCommentList(int argc, char* argv[])
|
|||
GuiReferenceAddColumn(64, "Disassembly");
|
||||
GuiReferenceAddColumn(0, "Comment");
|
||||
GuiReferenceReloadData();
|
||||
int count=cbsize/sizeof(COMMENTSINFO);
|
||||
int count=(int)(cbsize/sizeof(COMMENTSINFO));
|
||||
for(int i=0; i<count; i++)
|
||||
{
|
||||
GuiReferenceSetRowCount(i+1);
|
||||
|
@ -1239,7 +1239,7 @@ CMDRESULT cbInstrLabelList(int argc, char* argv[])
|
|||
GuiReferenceAddColumn(64, "Disassembly");
|
||||
GuiReferenceAddColumn(0, "Label");
|
||||
GuiReferenceReloadData();
|
||||
int count=cbsize/sizeof(LABELSINFO);
|
||||
int count=(int)(cbsize/sizeof(LABELSINFO));
|
||||
for(int i=0; i<count; i++)
|
||||
{
|
||||
GuiReferenceSetRowCount(i+1);
|
||||
|
@ -1274,7 +1274,7 @@ CMDRESULT cbInstrBookmarkList(int argc, char* argv[])
|
|||
GuiReferenceAddColumn(2*sizeof(uint), "Address");
|
||||
GuiReferenceAddColumn(0, "Disassembly");
|
||||
GuiReferenceReloadData();
|
||||
int count=cbsize/sizeof(BOOKMARKSINFO);
|
||||
int count=(int)(cbsize/sizeof(BOOKMARKSINFO));
|
||||
for(int i=0; i<count; i++)
|
||||
{
|
||||
GuiReferenceSetRowCount(i+1);
|
||||
|
@ -1310,7 +1310,7 @@ CMDRESULT cbInstrFunctionList(int argc, char* argv[])
|
|||
GuiReferenceAddColumn(64, "Disassembly (Start)");
|
||||
GuiReferenceAddColumn(0, "Label/Comment");
|
||||
GuiReferenceReloadData();
|
||||
int count=cbsize/sizeof(FUNCTIONSINFO);
|
||||
int count=(int)(cbsize/sizeof(FUNCTIONSINFO));
|
||||
for(int i=0; i<count; i++)
|
||||
{
|
||||
GuiReferenceSetRowCount(i+1);
|
||||
|
@ -1357,7 +1357,7 @@ CMDRESULT cbInstrLoopList(int argc, char* argv[])
|
|||
GuiReferenceAddColumn(64, "Disassembly (Start)");
|
||||
GuiReferenceAddColumn(0, "Label/Comment");
|
||||
GuiReferenceReloadData();
|
||||
int count=cbsize/sizeof(LOOPSINFO);
|
||||
int count=(int)(cbsize/sizeof(LOOPSINFO));
|
||||
for(int i=0; i<count; i++)
|
||||
{
|
||||
GuiReferenceSetRowCount(i+1);
|
||||
|
|
|
@ -55,7 +55,7 @@ mathformat:
|
|||
*/
|
||||
void mathformat(char* text)
|
||||
{
|
||||
int len=strlen(text);
|
||||
int len=(int)strlen(text);
|
||||
char* temp=(char*)emalloc(len+1, "mathformat:temp");
|
||||
memset(temp, 0, len+1);
|
||||
for(int i=0,j=0; i<len; i++)
|
||||
|
@ -70,7 +70,7 @@ void mathformat(char* text)
|
|||
*/
|
||||
bool mathcontains(const char* text)
|
||||
{
|
||||
int len=strlen(text);
|
||||
int len=(int)strlen(text);
|
||||
for(int i=0; i<len; i++)
|
||||
if(mathisoperator(text[i]))
|
||||
return true;
|
||||
|
@ -236,13 +236,13 @@ static void fillpair(EXPRESSION* expstruct, int pos, int layer)
|
|||
static int matchpairs(EXPRESSION* expstruct, char* expression, int endlayer)
|
||||
{
|
||||
int layer=endlayer;
|
||||
int len=strlen(expression);
|
||||
int len=(int)strlen(expression);
|
||||
for(int i=0; i<len; i++)
|
||||
{
|
||||
if(expression[i]=='(')
|
||||
{
|
||||
layer++;
|
||||
int pos=expression+i-expstruct->expression;
|
||||
int pos=(int)(expression+i-expstruct->expression);
|
||||
fillpair(expstruct, pos, layer);
|
||||
i+=matchpairs(expstruct, expression+i+1, layer);
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ static int matchpairs(EXPRESSION* expstruct, char* expression, int endlayer)
|
|||
{
|
||||
if(layer==endlayer)
|
||||
{
|
||||
int pos=expression+i-expstruct->expression;
|
||||
int pos=(int)(expression+i-expstruct->expression);
|
||||
fillpair(expstruct, pos, layer);
|
||||
return i;
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ static int matchpairs(EXPRESSION* expstruct, char* expression, int endlayer)
|
|||
|
||||
static int expressionformat(char* exp)
|
||||
{
|
||||
int len=strlen(exp);
|
||||
int len=(int)strlen(exp);
|
||||
int open=0;
|
||||
int close=0;
|
||||
for(int i=0; i<len; i++)
|
||||
|
@ -362,7 +362,7 @@ bool mathfromstring(const char* string, uint* value, bool silent, bool baseonly,
|
|||
{
|
||||
int highestop=0;
|
||||
int highestop_pos=0;
|
||||
int len=strlen(string);
|
||||
int len=(int)strlen(string);
|
||||
for(int i=0; i<len; i++)
|
||||
{
|
||||
int curop=mathisoperator(string[i]);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
uint memfindbaseaddr(HANDLE hProcess, uint addr, uint* size)
|
||||
{
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
DWORD numBytes;
|
||||
SIZE_T numBytes;
|
||||
uint MyAddress=0, newAddress=0;
|
||||
do
|
||||
{
|
||||
|
@ -107,7 +107,7 @@ bool memisvalidreadptr(HANDLE hProcess, uint addr)
|
|||
return memread(hProcess, (void*)addr, &a, 1, 0);
|
||||
}
|
||||
|
||||
void* memalloc(HANDLE hProcess, uint addr, DWORD size, DWORD fdProtect)
|
||||
void* memalloc(HANDLE hProcess, uint addr, SIZE_T size, DWORD fdProtect)
|
||||
{
|
||||
return VirtualAllocEx(hProcess, (void*)addr, size, MEM_RESERVE|MEM_COMMIT, fdProtect);
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ void memfree(HANDLE hProcess, uint addr)
|
|||
|
||||
static int formathexpattern(char* string)
|
||||
{
|
||||
int len=strlen(string);
|
||||
int len=(int)strlen(string);
|
||||
_strupr(string);
|
||||
char* new_string=(char*)emalloc(len+1, "formathexpattern:new_string");
|
||||
memset(new_string, 0, len+1);
|
||||
|
@ -128,7 +128,7 @@ static int formathexpattern(char* string)
|
|||
j+=sprintf(new_string+j, "%c", string[i]);
|
||||
strcpy(string, new_string);
|
||||
efree(new_string, "formathexpattern:new_string");
|
||||
return strlen(string);
|
||||
return (int)strlen(string);
|
||||
}
|
||||
|
||||
static bool patterntransform(const char* text, std::vector<PATTERNBYTE>* pattern)
|
||||
|
@ -136,7 +136,7 @@ static bool patterntransform(const char* text, std::vector<PATTERNBYTE>* pattern
|
|||
if(!text or !pattern)
|
||||
return false;
|
||||
pattern->clear();
|
||||
int len=strlen(text);
|
||||
int len=(int)strlen(text);
|
||||
if(!len)
|
||||
return false;
|
||||
char* newtext=(char*)emalloc(len+2, "transformpattern:newtext");
|
||||
|
@ -199,7 +199,7 @@ uint memfindpattern(unsigned char* data, uint size, const char* pattern, int* pa
|
|||
std::vector<PATTERNBYTE> searchpattern;
|
||||
if(!patterntransform(pattern, &searchpattern))
|
||||
return -1;
|
||||
int searchpatternsize=searchpattern.size();
|
||||
int searchpatternsize=(int)searchpattern.size();
|
||||
if(patternsize)
|
||||
*patternsize=searchpatternsize;
|
||||
for(uint i=0,pos=0; i<size; i++) //search for the pattern
|
||||
|
|
|
@ -21,7 +21,7 @@ bool memread(HANDLE hProcess, const void* lpBaseAddress, void* lpBuffer, SIZE_T
|
|||
bool memwrite(HANDLE hProcess, void* lpBaseAddress, const void* lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesWritten);
|
||||
bool mempatch(HANDLE hProcess, void* lpBaseAddress, const void* lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesWritten);
|
||||
bool memisvalidreadptr(HANDLE hProcess, uint addr);
|
||||
void* memalloc(HANDLE hProcess, uint addr, DWORD size, DWORD fdProtect);
|
||||
void* memalloc(HANDLE hProcess, uint addr, SIZE_T size, DWORD fdProtect);
|
||||
void memfree(HANDLE hProcess, uint addr);
|
||||
uint memfindpattern(unsigned char* data, uint size, const char* pattern, int* patternsize = 0);
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ void pluginload(const char* pluginDir)
|
|||
|
||||
static void plugincmdunregisterall(int pluginHandle)
|
||||
{
|
||||
int listsize=pluginCommandList.size();
|
||||
int listsize=(int)pluginCommandList.size();
|
||||
for(int i=listsize-1; i>=0; i--)
|
||||
{
|
||||
if(pluginCommandList.at(i).pluginHandle==pluginHandle)
|
||||
|
@ -113,7 +113,7 @@ static void plugincmdunregisterall(int pluginHandle)
|
|||
|
||||
void pluginunload()
|
||||
{
|
||||
int pluginCount=pluginList.size();
|
||||
int pluginCount=(int)pluginList.size();
|
||||
for(int i=0; i<pluginCount; i++)
|
||||
{
|
||||
PLUGSTOP stop=pluginList.at(i).plugstop;
|
||||
|
@ -140,7 +140,7 @@ void pluginregistercallback(int pluginHandle, CBTYPE cbType, CBPLUGIN cbPlugin)
|
|||
|
||||
bool pluginunregistercallback(int pluginHandle, CBTYPE cbType)
|
||||
{
|
||||
int pluginCallbackCount=pluginCallbackList.size();
|
||||
int pluginCallbackCount=(int)pluginCallbackList.size();
|
||||
for(int i=0; i<pluginCallbackCount; i++)
|
||||
{
|
||||
if(pluginCallbackList.at(i).pluginHandle==pluginHandle and pluginCallbackList.at(i).cbType==cbType)
|
||||
|
@ -154,7 +154,7 @@ bool pluginunregistercallback(int pluginHandle, CBTYPE cbType)
|
|||
|
||||
void plugincbcall(CBTYPE cbType, void* callbackInfo)
|
||||
{
|
||||
int pluginCallbackCount=pluginCallbackList.size();
|
||||
int pluginCallbackCount=(int)pluginCallbackList.size();
|
||||
for(int i=0; i<pluginCallbackCount; i++)
|
||||
{
|
||||
if(pluginCallbackList.at(i).cbType==cbType)
|
||||
|
@ -183,7 +183,7 @@ bool plugincmdunregister(int pluginHandle, const char* command)
|
|||
{
|
||||
if(!command or strlen(command)>=deflen or strstr(command, "\1"))
|
||||
return false;
|
||||
int listsize=pluginCommandList.size();
|
||||
int listsize=(int)pluginCommandList.size();
|
||||
for(int i=0; i<listsize; i++)
|
||||
{
|
||||
if(pluginCommandList.at(i).pluginHandle==pluginHandle and !strcmp(pluginCommandList.at(i).command, command))
|
||||
|
@ -297,7 +297,7 @@ void pluginmenucall(int hEntry)
|
|||
{
|
||||
PLUG_CB_MENUENTRY menuEntryInfo;
|
||||
menuEntryInfo.hEntry=pluginMenuList.at(i).hEntryPlugin;
|
||||
int pluginCallbackCount=pluginCallbackList.size();
|
||||
int pluginCallbackCount=(int)pluginCallbackList.size();
|
||||
int pluginHandle=pluginMenuList.at(i).pluginHandle;
|
||||
for(int j=0; j<pluginCallbackCount; j++)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,7 @@ static SCRIPTBRANCHTYPE scriptgetbranchtype(const char* text)
|
|||
|
||||
static int scriptlabelfind(const char* labelname)
|
||||
{
|
||||
int linecount=linemap.size();
|
||||
int linecount=(int)linemap.size();
|
||||
for(int i=0; i<linecount; i++)
|
||||
if(linemap.at(i).type==linelabel && !strcmp(linemap.at(i).u.label, labelname))
|
||||
return i+1;
|
||||
|
@ -51,7 +51,7 @@ static int scriptlabelfind(const char* labelname)
|
|||
|
||||
static int scriptinternalstep(int fromIp) //internal step routine
|
||||
{
|
||||
int maxIp=linemap.size(); //maximum ip
|
||||
int maxIp=(int)linemap.size(); //maximum ip
|
||||
if(fromIp>=maxIp) //script end
|
||||
return fromIp;
|
||||
while((linemap.at(fromIp).type==lineempty or linemap.at(fromIp).type==linecomment or linemap.at(fromIp).type==linelabel) and fromIp<maxIp) //skip empty lines
|
||||
|
@ -86,7 +86,7 @@ static bool scriptcreatelinemap(const char* filename)
|
|||
return false;
|
||||
}
|
||||
CloseHandle(hFile);
|
||||
int len=strlen(filedata);
|
||||
int len=(int)strlen(filedata);
|
||||
char temp[256]="";
|
||||
LINEMAPENTRY entry;
|
||||
memset(&entry, 0, sizeof(entry));
|
||||
|
@ -137,7 +137,7 @@ static bool scriptcreatelinemap(const char* filename)
|
|||
linemap.push_back(entry);
|
||||
}
|
||||
efree(filedata, "createlinemap:filedata");
|
||||
unsigned int linemapsize=linemap.size();
|
||||
unsigned int linemapsize=(unsigned int)linemap.size();
|
||||
while(!*linemap.at(linemapsize-1).raw) //remove empty lines from the end
|
||||
{
|
||||
linemapsize--;
|
||||
|
@ -164,7 +164,7 @@ static bool scriptcreatelinemap(const char* filename)
|
|||
}
|
||||
}
|
||||
|
||||
int rawlen=strlen(cur.raw);
|
||||
int rawlen=(int)strlen(cur.raw);
|
||||
if(!strlen(cur.raw)) //empty
|
||||
{
|
||||
cur.type=lineempty;
|
||||
|
@ -205,7 +205,7 @@ static bool scriptcreatelinemap(const char* filename)
|
|||
char newraw[MAX_SCRIPT_LINE_SIZE]="";
|
||||
strcpy(newraw, cur.raw);
|
||||
argformat(newraw);
|
||||
int len=strlen(newraw);
|
||||
int len=(int)strlen(newraw);
|
||||
for(int i=0; i<len; i++)
|
||||
if(newraw[i]==' ')
|
||||
{
|
||||
|
@ -224,7 +224,7 @@ static bool scriptcreatelinemap(const char* filename)
|
|||
sprintf(cur.raw+rawlen, " %s", line_comment);
|
||||
linemap.at(i)=cur;
|
||||
}
|
||||
linemapsize=linemap.size();
|
||||
linemapsize=(int)linemap.size();
|
||||
for(unsigned int i=0; i<linemapsize; i++)
|
||||
{
|
||||
if(linemap.at(i).type==linebranch) //invalid branch label
|
||||
|
@ -255,7 +255,7 @@ static bool scriptcreatelinemap(const char* filename)
|
|||
|
||||
static bool scriptinternalbpget(int line) //internal bpget routine
|
||||
{
|
||||
int bpcount=scriptbplist.size();
|
||||
int bpcount=(int)scriptbplist.size();
|
||||
for(int i=0; i<bpcount; i++)
|
||||
if(scriptbplist.at(i).line==line)
|
||||
return true;
|
||||
|
@ -269,7 +269,7 @@ static bool scriptinternalbptoggle(int line) //internal breakpoint
|
|||
line=scriptinternalstep(line-1); //no breakpoints on non-executable locations
|
||||
if(scriptinternalbpget(line)) //remove breakpoint
|
||||
{
|
||||
int bpcount=scriptbplist.size();
|
||||
int bpcount=(int)scriptbplist.size();
|
||||
for(int i=0; i<bpcount; i++)
|
||||
if(scriptbplist.at(i).line==line)
|
||||
{
|
||||
|
@ -312,8 +312,8 @@ static bool scriptisruncommand(const char* cmdlist)
|
|||
|
||||
static bool scriptisinternalcommand(const char* text, const char* cmd)
|
||||
{
|
||||
int len=strlen(text);
|
||||
int cmdlen=strlen(cmd);
|
||||
int len=(int)strlen(text);
|
||||
int cmdlen=(int)strlen(cmd);
|
||||
if(cmdlen>len)
|
||||
return false;
|
||||
else if(cmdlen==len)
|
||||
|
@ -487,7 +487,7 @@ static DWORD WINAPI scriptLoadThread(void* filename)
|
|||
bAbort=false;
|
||||
if(!scriptcreatelinemap((const char*)filename))
|
||||
return 0;
|
||||
int lines=linemap.size();
|
||||
int lines=(int)linemap.size();
|
||||
const char** script=(const char**)BridgeAlloc(lines*sizeof(const char*));
|
||||
for(int i=0; i<lines; i++) //add script lines
|
||||
script[i]=linemap.at(i).raw;
|
||||
|
@ -551,7 +551,7 @@ bool scriptbptoggle(int line)
|
|||
line=scriptinternalstep(line-1); //no breakpoints on non-executable locations
|
||||
if(scriptbpget(line)) //remove breakpoint
|
||||
{
|
||||
int bpcount=scriptbplist.size();
|
||||
int bpcount=(int)scriptbplist.size();
|
||||
for(int i=0; i<bpcount; i++)
|
||||
if(scriptbplist.at(i).line==line && !scriptbplist.at(i).silent)
|
||||
{
|
||||
|
@ -571,7 +571,7 @@ bool scriptbptoggle(int line)
|
|||
|
||||
bool scriptbpget(int line)
|
||||
{
|
||||
int bpcount=scriptbplist.size();
|
||||
int bpcount=(int)scriptbplist.size();
|
||||
for(int i=0; i<bpcount; i++)
|
||||
if(scriptbplist.at(i).line==line && !scriptbplist.at(i).silent)
|
||||
return true;
|
||||
|
|
|
@ -10,7 +10,7 @@ struct SYMBOLCBDATA
|
|||
|
||||
static BOOL CALLBACK EnumSymbols(PSYMBOL_INFO pSymInfo, ULONG SymbolSize, PVOID UserContext)
|
||||
{
|
||||
int len=strlen(pSymInfo->Name);
|
||||
int len=(int)strlen(pSymInfo->Name);
|
||||
SYMBOLINFO curSymbol;
|
||||
memset(&curSymbol, 0, sizeof(SYMBOLINFO));
|
||||
curSymbol.addr=(duint)pSymInfo->Address;
|
||||
|
@ -66,7 +66,7 @@ void symupdatemodulelist()
|
|||
std::vector<SYMBOLMODULEINFO> modList;
|
||||
modList.clear();
|
||||
SymEnumerateModules(fdProcessInfo->hProcess, EnumModules, &modList);
|
||||
int modcount=modList.size();
|
||||
int modcount=(int)modList.size();
|
||||
SYMBOLMODULEINFO* modListBridge=(SYMBOLMODULEINFO*)BridgeAlloc(sizeof(SYMBOLMODULEINFO)*modcount);
|
||||
for(int i=0; i<modcount; i++)
|
||||
memcpy(&modListBridge[i], &modList.at(i), sizeof(SYMBOLMODULEINFO));
|
||||
|
|
|
@ -57,7 +57,7 @@ static DWORD GetThreadLastError(uint tebAddress)
|
|||
|
||||
void threadgetlist(THREADLIST* list)
|
||||
{
|
||||
int count=threadList.size();
|
||||
int count=(int)threadList.size();
|
||||
list->count=count;
|
||||
if(!count)
|
||||
return;
|
||||
|
|
|
@ -1000,7 +1000,7 @@ bool valapifromstring(const char* name, uint* value, int* value_size, bool print
|
|||
else
|
||||
{
|
||||
char szBaseName[256]="";
|
||||
int len=strlen(szModName);
|
||||
int len=(int)strlen(szModName);
|
||||
while(szModName[len]!='\\')
|
||||
len--;
|
||||
strcpy(szBaseName, szModName+len+1);
|
||||
|
@ -1132,7 +1132,7 @@ static bool isdecnumber(const char* string)
|
|||
return false;
|
||||
decAdd++;
|
||||
}
|
||||
int len=strlen(string+decAdd);
|
||||
int len=(int)strlen(string+decAdd);
|
||||
for(int i=0; i<len; i++)
|
||||
if(!isdigit(string[i+decAdd]))
|
||||
return false;
|
||||
|
@ -1145,13 +1145,13 @@ check whether a string is a valid hex number
|
|||
static bool ishexnumber(const char* string)
|
||||
{
|
||||
int add=0;
|
||||
if(*string=='0' and string[1]=='x')
|
||||
if(*string=='0' and string[1]=='x') //0x prefix
|
||||
add=2;
|
||||
else if(*string=='x') //hex indicator
|
||||
add=1;
|
||||
if(!string[add]) //only an indicator, no number
|
||||
return false;
|
||||
int len=strlen(string+add);
|
||||
int len=(int)strlen(string+add);
|
||||
for(int i=0; i<len; i++)
|
||||
if(!isxdigit(string[i+add])) //all must be hex digits
|
||||
return false;
|
||||
|
@ -1179,7 +1179,7 @@ bool valfromstring(const char* string, uint* value, bool silent, bool baseonly,
|
|||
}
|
||||
else if(mathcontains(string)) //handle math
|
||||
{
|
||||
int len=strlen(string);
|
||||
int len=(int)strlen(string);
|
||||
char* newstring=(char*)emalloc(len*2, "valfromstring:newstring");
|
||||
if(strstr(string, "[")) //memory brackets: []
|
||||
{
|
||||
|
@ -1228,7 +1228,7 @@ bool valfromstring(const char* string, uint* value, bool silent, bool baseonly,
|
|||
*isvar=true;
|
||||
return true;
|
||||
}
|
||||
int len=strlen(string);
|
||||
int len=(int)strlen(string);
|
||||
char* newstring=(char*)emalloc(len*2, "valfromstring:newstring");
|
||||
if(strstr(string, "["))
|
||||
{
|
||||
|
@ -1389,7 +1389,7 @@ bool valtostring(const char* string, uint* value, bool silent)
|
|||
dputs("not debugging");
|
||||
return false;
|
||||
}
|
||||
int len=strlen(string);
|
||||
int len=(int)strlen(string);
|
||||
char* newstring=(char*)emalloc(len*2, "valfromstring:newstring");
|
||||
if(strstr(string, "[")) //memory brackets: []
|
||||
{
|
||||
|
|
|
@ -202,7 +202,7 @@ bool varset(const char* name, uint value, bool setreadonly)
|
|||
bool varset(const char* name, const char* string, bool setreadonly)
|
||||
{
|
||||
VAR_VALUE varvalue;
|
||||
int size=strlen(string);
|
||||
int size=(int)strlen(string);
|
||||
varvalue.size=size;
|
||||
varvalue.type=VAR_STRING;
|
||||
varvalue.u.data=new std::vector<unsigned char>;
|
||||
|
|
|
@ -206,7 +206,7 @@ static bool cbCommandProvider(char* cmd, int maxlen)
|
|||
|
||||
extern "C" DLL_EXPORT bool _dbg_dbgcmdexec(const char* cmd)
|
||||
{
|
||||
int len=strlen(cmd);
|
||||
int len=(int)strlen(cmd);
|
||||
char* newcmd=(char*)emalloc((len+1)*sizeof(char), "_dbg_dbgcmdexec:newcmd");
|
||||
strcpy(newcmd, cmd);
|
||||
return msgsend(gMsgStack, 0, (uint)newcmd, 0);
|
||||
|
@ -236,7 +236,7 @@ extern "C" DLL_EXPORT const char* _dbg_dbginit()
|
|||
char dir[deflen]="";
|
||||
if(!GetModuleFileNameA(hInst, dir, deflen))
|
||||
return "GetModuleFileNameA failed!";
|
||||
int len=strlen(dir);
|
||||
int len=(int)strlen(dir);
|
||||
while(dir[len]!='\\')
|
||||
len--;
|
||||
dir[len]=0;
|
||||
|
|
Loading…
Reference in New Issue