From: notaz Date: Sat, 4 Jan 2014 02:52:05 +0000 (+0200) Subject: fixes X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94d447fbb6ab6c7c01b3734457920a648292ddc5;p=ia32rtools.git fixes --- diff --git a/stdc.hlist b/stdc.hlist index 6fd7ecd..4eab747 100644 --- a/stdc.hlist +++ b/stdc.hlist @@ -57,6 +57,20 @@ char* __cdecl _strset (char*, int); char* __cdecl _strupr (char*); void __cdecl _swab (const char*, char*, size_t); +wchar_t* __cdecl _wcsdup (const wchar_t*); +int __cdecl _wcsicmp (const wchar_t*, const wchar_t*); +int __cdecl _wcsicoll (const wchar_t*, const wchar_t*); +wchar_t* __cdecl _wcslwr (wchar_t*); +int __cdecl _wcsnicmp (const wchar_t*, const wchar_t*, size_t); +wchar_t* __cdecl _wcsnset (wchar_t*, wchar_t, size_t); +wchar_t* __cdecl _wcsrev (wchar_t*); +wchar_t* __cdecl _wcsset (wchar_t*, wchar_t); +wchar_t* __cdecl _wcsupr (wchar_t*); +int __cdecl _wcsncoll(const wchar_t*, const wchar_t*, size_t); +int __cdecl _wcsnicoll(const wchar_t*, const wchar_t*, size_t); +wchar_t* __cdecl _wcserror(int); +wchar_t* __cdecl __wcserror(const wchar_t*); + int __cdecl isalnum(int); int __cdecl isalpha(int); int __cdecl iscntrl(int); @@ -107,6 +121,29 @@ void __cdecl rewind (FILE*); int __cdecl _snprintf (char*, size_t, const char*, ...); int __cdecl _vsnprintf (char*, size_t, const char*, __VALIST); +int __cdecl _ismbcalnum (unsigned int); +int __cdecl _ismbcalpha (unsigned int); +int __cdecl _ismbcdigit (unsigned int); +int __cdecl _ismbcgraph (unsigned int); +int __cdecl _ismbcprint (unsigned int); +int __cdecl _ismbcpunct (unsigned int); +int __cdecl _ismbcspace (unsigned int); +int __cdecl _ismbclower (unsigned int); +int __cdecl _ismbcupper (unsigned int); +int __cdecl _ismbclegal (unsigned int); +int __cdecl _ismbcsymbol (unsigned int); +int __cdecl _ismbblead (unsigned int ); +int __cdecl _ismbbtrail (unsigned int ); +int __cdecl _ismbslead ( const unsigned char*, const unsigned char*); +int __cdecl _ismbstrail ( const unsigned char*, const unsigned char*); +unsigned int __cdecl _mbctolower (unsigned int); +unsigned int __cdecl _mbctoupper (unsigned int); +void __cdecl _mbccpy (unsigned char*, const unsigned char*); +size_t __cdecl _mbclen (const unsigned char*); +unsigned int __cdecl _mbbtombc (unsigned int); +unsigned int __cdecl _mbctombb (unsigned int); +int __cdecl _mbbtype (unsigned char, int); +int __cdecl _mbsbtype (const unsigned char*, size_t); unsigned char* __cdecl _mbscpy (unsigned char*, const unsigned char*); unsigned char* __cdecl _mbsncpy (unsigned char*, const unsigned char*, size_t); unsigned char* __cdecl _mbsnbcpy (unsigned char*, const unsigned char*, size_t); diff --git a/tools/protoparse.h b/tools/protoparse.h index c560d50..54add08 100644 --- a/tools/protoparse.h +++ b/tools/protoparse.h @@ -143,8 +143,9 @@ static const char *known_ptr_types[] = { "HKEY", "HMENU", "HWND", - "PLONG", "PDWORD", + "PHKEY", + "PLONG", "PVOID", "PCVOID", "DLGPROC", diff --git a/tools/translate.c b/tools/translate.c index efefc80..d34d490 100644 --- a/tools/translate.c +++ b/tools/translate.c @@ -1224,7 +1224,7 @@ static void stack_frame_access(struct parsed_op *po, if (!strncmp(name, "ebp", 3)) stack_ra = 4; - if (stack_ra <= offset && offset < stack_ra + 4) + if (ofs_reg[0] == 0 && stack_ra <= offset && offset < stack_ra + 4) ferr(po, "reference to ra? %d %d\n", offset, stack_ra); if (offset > stack_ra) @@ -2005,7 +2005,7 @@ static int scan_for_flag_set(int i, int magic, int *branched, } if (i > 0 && LAST_OP(i - 1)) { - i = g_label_refs[i].i; + i = lr->i; continue; } ret = scan_for_flag_set(lr->i, magic, @@ -3208,6 +3208,8 @@ tailcall: // avoid use of unitialized var fprintf(fout, " %s = -cond_c;", out_dst_opr(buf1, sizeof(buf1), po, &po->operand[0])); + // carry remains what it was + pfomask &= ~(1 << PFO_C); } else { fprintf(fout, " %s %s= %s + cond_c;", @@ -3871,8 +3873,8 @@ int main(int argc, char *argv[]) unsigned long addr = strtoul(p, NULL, 16); unsigned long f_addr = strtoul(g_func + 4, NULL, 16); if (addr > f_addr && !scanned_ahead) { - anote("scan_ahead caused by '%s', f_addr %lx\n", - g_func, f_addr); + anote("scan_ahead caused by '%s', addr %lx\n", + g_func, addr); scan_ahead(fasm); scanned_ahead = 1; func_chunks_sorted = 0; diff --git a/win32.hlist b/win32.hlist index 091ec93..4054f04 100644 --- a/win32.hlist +++ b/win32.hlist @@ -35,6 +35,9 @@ WINBASEAPI HANDLE WINAPI FindFirstFileA(LPCSTR,LPWIN32_FIND_DATAA); WINBASEAPI HANDLE WINAPI FindFirstFileW(LPCWSTR,LPWIN32_FIND_DATAW); WINBASEAPI HANDLE WINAPI FindFirstFileExA(LPCSTR,FINDEX_INFO_LEVELS,PVOID,FINDEX_SEARCH_OPS,PVOID,DWORD); WINBASEAPI HANDLE WINAPI FindFirstFileExW(LPCWSTR,FINDEX_INFO_LEVELS,PVOID,FINDEX_SEARCH_OPS,PVOID,DWORD); +WINBASEAPI BOOL WINAPI FindNextChangeNotification(HANDLE); +WINBASEAPI BOOL WINAPI FindNextFileA(HANDLE,LPWIN32_FIND_DATAA); +WINBASEAPI BOOL WINAPI FindNextFileW(HANDLE,LPWIN32_FIND_DATAW); WINBASEAPI HRSRC WINAPI FindResourceA(HMODULE,LPCSTR,LPCSTR); WINBASEAPI HRSRC WINAPI FindResourceW(HINSTANCE,LPCWSTR,LPCWSTR); WINBASEAPI HRSRC WINAPI FindResourceExA(HINSTANCE,LPCSTR,LPCSTR,WORD);