• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

[C++]反编译器

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

各种开源的decompiler都不太好用,眼下最好的反编译器是IDA pro。

尽管是收费的,只是破解版非常好找。

我试过5.5版本号的,还不错。


我把windows notepad进行了反编译,多少算有点可读性:

/* This file has been generated by the Hex-Rays decompiler.
   Copyright (c) 2009 Hex-Rays <[email protected]>

   Detected compiler: Visual C++
*/

#include <windows.h>
#include <defs.h>

#include <stdarg.h>


//-------------------------------------------------------------------------
// Data declarations

// extern void *acmdln; weak
extern const WCHAR szOtherStuff; // idb
extern wchar_t aW[3]; // weak
extern wchar_t aA[3]; // weak
extern const WCHAR TableName[]; // idb
extern const WCHAR aCommdlg_help[]; // idb
extern const WCHAR String[]; // idb
extern wchar_t a_setup[8]; // weak
extern wchar_t aP[3]; // weak
extern wchar_t aPt[4]; // weak
extern wchar_t aSC_txtCSC_C[]; // idb
extern wchar_t aSecuritySppGen[32]; // weak
extern int dword_1002B48[2]; // weak
extern const WCHAR aIpointsize[]; // idb
extern const WCHAR aLffacename[]; // idb
extern const WCHAR aLfpitchandfami[]; // idb
extern const WCHAR aLfquality[]; // idb
extern const WCHAR aLfclipprecisio[]; // idb
extern const WCHAR aLfoutprecision[]; // idb
extern const WCHAR aLfcharset[]; // idb
extern const WCHAR aLfstrikeout[]; // idb
extern const WCHAR aLfunderline[]; // idb
extern const WCHAR aLfitalic[]; // idb
extern const WCHAR aLfweight[]; // idb
extern const WCHAR aLforientation[]; // idb
extern const WCHAR ValueName[]; // idb
extern const WCHAR SubKey[]; // idb
extern const WCHAR aIwindowposdy[]; // idb
extern const WCHAR aIwindowposdx[]; // idb
extern const WCHAR aIwindowposy[]; // idb
extern const WCHAR aIwindowposx[]; // idb
extern const WCHAR aImarginright[]; // idb
extern const WCHAR aImarginleft[]; // idb
extern const WCHAR aImarginbottom[]; // idb
extern const WCHAR aImargintop[]; // idb
extern const WCHAR aSztrailer[]; // idb
extern const WCHAR aSzheader[]; // idb
extern const WCHAR aStatusbar[]; // idb
extern const WCHAR aFwrap[]; // idb
extern const WCHAR aEdit[]; // idb
extern const WCHAR aFmle_is_broken[]; // idb
extern const WCHAR aFsavewindowpos[]; // idb
extern const WCHAR aSoftwareMicr_0[]; // idb
extern wchar_t aLucidaConsole[15]; // weak
extern const WCHAR ClassName[]; // idb
extern int dword_1003AF0[2]; // weak
extern wchar_t aTxt[4]; // weak
extern int dword_1003C74[5]; // weak
extern wchar_t a_[4]; // weak
extern const WCHAR pszPath[]; // idb
extern IID riid; // idb
extern IID rclsid; // idb
extern IID stru_100400C; // idb
extern IID stru_100401C; // idb
extern IID stru_10043D0; // idb
extern IID stru_10043E0; // idb
extern wchar_t aNull[7]; // weak
extern OLECHAR psz[]; // idb
extern wchar_t aHelp_entry_id_[27]; // weak
extern int dword_1004748[4]; // weak
extern int dword_10049F4[4]; // weak
extern int dword_1004A04[2]; // weak
extern int dword_1004AF0[4]; // weak
extern const WCHAR aSlipupacc[]; // idb
extern wchar_t aStringfileinfo[]; // idb
extern const WCHAR SubBlock[]; // idb
extern wchar_t aSppsvc_exe[12]; // weak
extern wchar_t aSlui_exe[10]; // weak
extern wchar_t aSppuinotify_dl[17]; // weak
extern const WCHAR aSppsvc[]; // idb
extern const WCHAR ServiceName[]; // idb
extern int dword_1006D38[6]; // weak
extern wchar_t aD[]; // idb
extern wchar_t a_txt_0[5]; // weak
extern int dword_10098B8; // weak
extern wchar_t asc_10098BC[3]; // weak
extern int dword_1009EE0[2]; // weak
extern struct _EXCEPTION_POINTERS ExceptionInfo; // idb
extern __int16 word_100C000; // weak
extern BYTE Data; // idb
extern int dword_100C008; // weak
extern int dword_100C00C; // weak
extern int dword_100C010; // weak
extern int dword_100C014; // weak
extern int dword_100C018; // weak
extern int dword_100C01C; // weak
extern HWND hWnd; // idb
extern HWND dword_100C024; // idb
extern HWND dword_100C028; // idb
extern BYTE dword_100C02C; // idb
extern int dword_100C030; // weak
extern WPARAM wParam; // idb
extern int dword_100C038; // weak
extern int dword_100C03C; // weak
extern int dword_100C040; // weak
extern WPARAM dword_100C044; // idb
extern LPARAM lParam; // idb
extern int nHeight; // idb
extern int nWidth; // idb
extern int X; // idb
extern int Y; // idb
extern int dword_100C05C; // weak
extern int dword_100C060; // weak
extern int dword_100C064; // weak
extern int dword_100C070; // weak
extern HANDLE hFile; // idb
extern int dword_100C078; // weak
extern int dword_100C07C; // weak
extern HACCEL hAccTable; // idb
extern int dword_100C084; // weak
extern HGDIOBJ ho; // idb
extern HINSTANCE hInstance; // idb
extern HCURSOR hCursor; // idb
extern HCURSOR dword_100C094; // idb
extern HLOCAL hMem; // idb
extern int dword_100C0A4; // weak
extern struct tagFINDREPLACEW stru_100C0C0; // idb
extern WINDOWPLACEMENT wndpl; // idb
extern struct tagPSDW stru_100C140; // idb
extern struct tagOFNW stru_100C1A0; // idb
extern LOGFONTW lf; // idb
extern volatile LONG Destination; // idb
extern int (__stdcall *off_100C26C)(int, int, int); // weak
extern int (__stdcall *off_100C288)(int, int, int); // weak
extern LPCWSTR dword_100C2B0; // idb
extern LPCWSTR dword_100C2B4; // idb
extern LPCWSTR lpString2; // idb
extern LPCVOID lpSource; // idb
extern LPCWSTR dword_100C2C4; // idb
extern LPCWSTR lpText; // idb
extern LPCWSTR szApp; // idb
extern LPCWSTR dword_100C2DC; // idb
extern int dword_100C2E0; // weak
extern LPCWSTR dword_100C2EC; // idb
extern int dword_100C2F0; // weak
extern LPCWSTR lpszHelp; // idb
extern int dword_100C2F8; // weak
extern int dword_100C2FC; // weak
extern int dword_100C300; // weak
extern char Args[]; // idb
extern int dword_100C308; // weak
extern int dword_100C30C; // weak
extern int dword_100C310; // weak
extern LPCWSTR dword_100C314; // idb
extern LPCWSTR dword_100C318; // idb
extern LPCWSTR dword_100C31C; // idb
extern LPCWSTR dword_100C320; // idb
extern LPCWSTR dword_100C324; // idb
extern wchar_t *dword_100C328; // idb
extern LPCWSTR lpCaption; // idb
extern LPCWSTR dword_100C330; // idb
extern LPARAM dword_100C334; // idb
extern LPARAM dword_100C338; // idb
extern LPARAM dword_100C33C; // idb
extern LPARAM dword_100C340; // idb
extern wchar_t *dword_100C344; // idb
extern wchar_t *Format; // idb
extern int dword_100C368; // weak
extern int dword_100C370; // weak
extern int dword_100C374; // weak
extern int dword_100C37C; // weak
extern int dword_100C3C0; // weak
extern __int16 word_100C44C; // weak
extern __int16 word_100C450; // weak
extern __int16 word_100C454; // weak
extern __int16 word_100C458; // weak
extern int dword_100C45C; // weak
extern int dword_100C460; // weak
extern int dword_100C464; // weak
extern int dword_100C468; // weak
extern int dword_100C46C; // weak
extern int dword_100C470; // weak
extern int dword_100C474; // weak
extern int dword_100C478; // weak
extern __int16 word_100C47C; // weak
extern int dword_100C480; // weak
extern int dword_100C484; // weak
extern __int16 word_100C488; // weak
extern WCHAR word_100C6A0; // idb
extern _UNKNOWN unk_100C6F0; // weak
extern const WCHAR word_100C740; // idb
extern BYTE Dst; // idb
extern wchar_t word_100C7E0; // idb
extern wchar_t Dest; // idb
extern int off_100C920[2]; // weak
extern _UNKNOWN unk_100C9DC; // weak
extern const WCHAR word_100C9E0; // idb
extern const WCHAR FileName; // idb
extern HWND dword_100CCE8; // idb
extern int dword_100CCEC; // weak
extern int dword_100CCF0; // weak
extern int dword_100CCF4; // weak
extern int (__thiscall *dword_100CD0C)(_DWORD); // weak
extern int dword_100CD10; // weak
extern int *off_100CD14; // weak
extern _UNKNOWN unk_100CD50; // weak
extern _UNKNOWN unk_100CD54; // weak
extern _UNKNOWN unk_100CD58; // weak
extern const WCHAR word_100CD60; // idb
extern const WCHAR word_100CF68; // idb
extern const WCHAR String2; // idb
extern const WCHAR word_100D378; // idb
extern int dword_100D580; // weak
extern const WCHAR word_100D588; // idb
extern LPARAM dword_100D790; // idb
extern WPARAM dword_100D794; // idb
extern int dword_100D798; // weak
extern int dword_100D79C; // weak
extern HMENU dword_100D7A0; // idb
extern volatile LONG Target; // idb
extern int dword_100D7A8; // weak
extern char dword_100D7AC[]; // idb
extern int dword_100D7B0; // weak
extern int x; // idb
extern int dword_100D7B8; // weak
extern int dword_100D7BC; // weak
extern int dword_100D7C0; // weak
extern int dword_100D7C4; // weak
extern int y; // idb
extern int dword_100D7CC; // idb
extern int dword_100D7D0; // weak
extern int dword_100D7D4; // weak
extern int dword_100D7D8; // weak
extern struct _SYSTEMTIME SystemTime; // idb
extern const WCHAR word_100D800; // idb
extern const WCHAR word_100DA08; // idb
extern const WCHAR word_100DC10; // idb
extern struct tagPOINT pt; // idb
extern int dword_100DE28; // weak
extern int dword_100DE2C; // weak
extern int dword_100DE30; // weak
extern int dword_100DE34; // weak
extern HWND hDlg; // idb
extern int dword_100DE3C; // weak
extern WCHAR pPrinterName; // idb
extern int dword_100E040; // weak
extern HMENU hMenu; // idb
extern _UNKNOWN unk_100E060; // weak
extern int dword_100E160; // weak

//-------------------------------------------------------------------------
// Function declarations

#define __thiscall __cdecl // Test compile in C mode

// LSTATUS __stdcall RegSetValueExW(HKEY hKey, LPCWSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE *lpData, DWORD cbData);
// LSTATUS __stdcall RegQueryValueExW(HKEY hKey, LPCWSTR lpValueName, LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData);
// LSTATUS __stdcall RegCloseKey(HKEY hKey);
// LSTATUS __stdcall RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult);
// LSTATUS __stdcall RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult);
// BOOL __stdcall IsTextUnicode(const void *lpv, int iSize, LPINT lpiResult);
// BOOL __stdcall CloseServiceHandle(SC_HANDLE hSCObject);
// BOOL __stdcall QueryServiceConfigW(SC_HANDLE hService, LPQUERY_SERVICE_CONFIGW lpServiceConfig, DWORD cbBufSize, LPDWORD pcbBytesNeeded);
// SC_HANDLE __stdcall OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess);
// SC_HANDLE __stdcall OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess);
// int __stdcall FindNLSString(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); weak
// HGLOBAL __stdcall GlobalAlloc(UINT uFlags, SIZE_T dwBytes);
// BOOL __stdcall GlobalUnlock(HGLOBAL hMem);
// LPVOID __stdcall GlobalLock(HGLOBAL hMem);
// int __stdcall GetTimeFormatW(LCID Locale, DWORD dwFlags, const SYSTEMTIME *lpTime, LPCWSTR lpFormat, LPWSTR lpTimeStr, int cchTime);
// int __stdcall GetDateFormatW(LCID Locale, DWORD dwFlags, const SYSTEMTIME *lpDate, LPCWSTR lpFormat, LPWSTR lpDateStr, int cchDate);
// void __stdcall GetLocalTime(LPSYSTEMTIME lpSystemTime);
// LANGID __stdcall GetUserDefaultUILanguage();
// BOOL __stdcall HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);
// LPVOID __stdcall HeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);
// HANDLE __stdcall GetProcessHeap();
// BOOL __stdcall GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation);
// LONG __stdcall InterlockedExchange(volatile LONG *Target, LONG Value);
// void __stdcall FreeLibraryAndExitThread(HMODULE hLibModule, DWORD dwExitCode);
// DWORD __stdcall GetFileAttributesW(LPCWSTR lpFileName);
// BOOL __stdcall Wow64RevertWow64FsRedirection(PVOID OlValue);
// BOOL __stdcall Wow64DisableWow64FsRedirection(PVOID *OldValue);
// BOOL __stdcall IsWow64Process(HANDLE hProcess, PBOOL Wow64Process);
// HANDLE __stdcall GetCurrentProcess();
// HANDLE __stdcall CreateThread(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId);
// HMODULE __stdcall LoadLibraryW(LPCWSTR lpLibFileName);
// DWORD __stdcall GetModuleFileNameW(HMODULE hModule, LPWCH lpFilename, DWORD nSize);
// HANDLE __stdcall CreateFileMappingW(HANDLE hFile, LPSECURITY_ATTRIBUTES lpFileMappingAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCWSTR lpName);
// DWORD __stdcall FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, va_list *Arguments);
// LPVOID __stdcall MapViewOfFile(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap);
// BOOL __stdcall UnmapViewOfFile(LPCVOID lpBaseAddress);
// HLOCAL __stdcall LocalReAlloc(HLOCAL hMem, SIZE_T uBytes, UINT uFlags);
// UINT __stdcall GetACP();
// BOOL __stdcall DeleteFileW(LPCWSTR lpFileName);
// BOOL __stdcall SetEndOfFile(HANDLE hFile);
// int __stdcall WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar);
// void __stdcall SetLastError(DWORD dwErrCode);
// BOOL __stdcall WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped);
// DWORD __stdcall GetLastError();
// SIZE_T __stdcall LocalSize(HLOCAL hMem);
// DWORD __stdcall GetFullPathNameW(LPCWSTR lpFileName, DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR *lpFilePart);
// int __stdcall MulDiv(int nNumber, int nNumerator, int nDenominator);
// LPWSTR __stdcall GetCommandLineW();
// DWORD __stdcall GetCurrentProcessId();
// int __stdcall FoldStringW(DWORD dwMapFlags, LPCWSTR lpSrcStr, int cchSrc, LPWSTR lpDestStr, int cchDest);
// int __stdcall lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2);
// HANDLE __stdcall FindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData);
// BOOL __stdcall FindClose(HANDLE hFindFile);
// BOOL __stdcall HeapSetInformation(HANDLE HeapHandle, HEAP_INFORMATION_CLASS HeapInformationClass, PVOID HeapInformation, SIZE_T HeapInformationLength);
// BOOL __stdcall TerminateProcess(HANDLE hProcess, UINT uExitCode);
// void __stdcall GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime);
// DWORD __stdcall GetCurrentThreadId();
// DWORD __stdcall GetTickCount();
// BOOL __stdcall QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount);
// HMODULE __stdcall GetModuleHandleA(LPCSTR lpModuleName);
// LPTOP_LEVEL_EXCEPTION_FILTER __stdcall SetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
// void __stdcall GetStartupInfoA(LPSTARTUPINFOA lpStartupInfo);
// LONG __stdcall InterlockedCompareExchange(volatile LONG *Destination, LONG Exchange, LONG Comperand);
// void __stdcall Sleep(DWORD dwMilliseconds);
// LPVOID __stdcall LocalLock(HLOCAL hMem);
// BOOL __stdcall LocalUnlock(HLOCAL hMem);
// int __stdcall lstrlenW(LPCWSTR lpString);
// int __stdcall GetLocaleInfoW(LCID Locale, LCTYPE LCType, LPWSTR lpLCData, int cchData);
// HGLOBAL __stdcall GlobalFree(HGLOBAL hMem);
// int __stdcall lstrcmpiW(LPCWSTR lpString1, LPCWSTR lpString2);
// UINT __stdcall SetErrorMode(UINT uMode);
// HANDLE __stdcall CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
// BOOL __stdcall ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped);
// BOOL __stdcall CloseHandle(HANDLE hObject);
// HLOCAL __stdcall LocalAlloc(UINT uFlags, SIZE_T uBytes);
// LONG __stdcall InterlockedDecrement(volatile LONG *lpAddend);
// HLOCAL __stdcall LocalFree(HLOCAL hMem);
// LONG __stdcall InterlockedIncrement(volatile LONG *lpAddend);
// BOOL __stdcall GetVersionExW(LPOSVERSIONINFOW lpVersionInformation);
// LONG __stdcall UnhandledExceptionFilter(struct _EXCEPTION_POINTERS *ExceptionInfo);
// HFONT __stdcall CreateFontIndirectW(const LOGFONTW *lplf);
// int __stdcall SetMapMode(HDC hdc, int iMode);
// BOOL __stdcall SetViewportExtEx(HDC hdc, int x, int y, LPSIZE lpsz);
// BOOL __stdcall SetWindowExtEx(HDC hdc, int x, int y, LPSIZE lpsz);
// BOOL __stdcall LPtoDP(HDC hdc, LPPOINT lppt, int c);
// int __stdcall SetBkMode(HDC hdc, int mode);
// BOOL __stdcall GetTextMetricsW(HDC hdc, LPTEXTMETRICW lptm);
// int __stdcall SetAbortProc(HDC hdc, ABORTPROC proc);
// int __stdcall StartDocW(HDC hdc, const DOCINFOW *lpdi);
// int __stdcall StartPage(HDC hdc);
// int __stdcall EndPage(HDC hdc);
// int __stdcall AbortDoc(HDC hdc);
// int __stdcall EndDoc(HDC hdc);
// BOOL __stdcall DeleteDC(HDC hdc);
// BOOL __stdcall TextOutW(HDC hdc, int x, int y, LPCWSTR lpString, int c);
// BOOL __stdcall GetTextExtentPoint32W(HDC hdc, LPCWSTR lpString, int c, LPSIZE psizl);
// HDC __stdcall CreateDCW(LPCWSTR pwszDriver, LPCWSTR pwszDevice, LPCWSTR pszPort, const DEVMODEW *pdm);
// HGDIOBJ __stdcall SelectObject(HDC hdc, HGDIOBJ h);
// int __stdcall GetTextFaceW(HDC hdc, int c, LPWSTR lpName);
// int __stdcall EnumFontsW(HDC hdc, LPCWSTR lpLogfont, FONTENUMPROCW lpProc, LPARAM lParam);
// int __stdcall GetDeviceCaps(HDC hdc, int index);
// BOOL __stdcall DeleteObject(HGDIOBJ ho);
// HWND __stdcall SetActiveWindow(HWND hWnd);
// HKL __stdcall GetKeyboardLayout(DWORD idThread);
// void __stdcall PostQuitMessage(int nExitCode);
// LRESULT __stdcall DefWindowProcW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
// HWND __stdcall GetForegroundWindow();
// BOOL __stdcall IsIconic(HWND hWnd);
// BOOL __stdcall DestroyWindow(HWND hWnd);
// BOOL __stdcall MessageBeep(UINT uType);
// BOOL __stdcall GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT *lpwndpl);
// LPWSTR __stdcall CharUpperW(LPWSTR lpsz);
// ATOM __stdcall RegisterClassExW(const WNDCLASSEXW *);
// HANDLE __stdcall LoadImageW(HINSTANCE hInst, LPCWSTR name, UINT type, int cx, int cy, UINT fuLoad);
// HCURSOR __stdcall LoadCursorW(HINSTANCE hInstance, LPCWSTR lpCursorName);
// LONG __stdcall SetWindowLongW(HWND hWnd, int nIndex, LONG dwNewLong);
// HACCEL __stdcall LoadAcceleratorsW(HINSTANCE hInstance, LPCWSTR lpTableName);
// HMENU __stdcall GetSystemMenu(HWND hWnd, BOOL bRevert);
// BOOL __stdcall SetWindowPlacement(HWND hWnd, const WINDOWPLACEMENT *lpwndpl);
// HWND __stdcall CreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam);
// UINT __stdcall RegisterWindowMessageW(LPCWSTR lpString);
// BOOL __stdcall UpdateWindow(HWND hWnd);
// BOOL __stdcall InvalidateRect(HWND hWnd, const RECT *lpRect, BOOL bErase);
// int __stdcall SetScrollPos(HWND hWnd, int nBar, int nPos, BOOL bRedraw);
// int __stdcall GetWindowTextLengthW(HWND hWnd);
// LONG __stdcall GetWindowLongW(HWND hWnd, int nIndex);
// BOOL __stdcall PeekMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg);
// BOOL __stdcall EnableWindow(HWND hWnd, BOOL bEnable);
// INT_PTR __stdcall DialogBoxParamW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
// HWND __stdcall CreateDialogParamW(HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM dwInitParam);
// int __stdcall GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount);
// BOOL __stdcall SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);
// HCURSOR __stdcall SetCursor(HCURSOR hCursor);
// BOOL __stdcall SetForegroundWindow(HWND hWnd);
// HWND __stdcall FindWindowW(LPCWSTR lpClassName, LPCWSTR lpWindowName);
// int __stdcall GetSystemMetrics(int nIndex);
// BOOL __stdcall MoveWindow(HWND hWnd, int X, int Y, int nWidth, int nHeight, BOOL bRepaint);
// LRESULT __stdcall SendMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
// LPWSTR __stdcall CharNextW(LPCWSTR lpsz);
// DWORD __stdcall CheckMenuItem(HMENU hMenu, UINT uIDCheckItem, UINT uCheck);
// BOOL __stdcall CloseClipboard();
// BOOL __stdcall IsClipboardFormatAvailable(UINT format);
// BOOL __stdcall OpenClipboard(HWND hWndNewOwner);
// UINT __stdcall GetMenuState(HMENU hMenu, UINT uId, UINT uFlags);
// BOOL __stdcall EnableMenuItem(HMENU hMenu, UINT uIDEnableItem, UINT uEnable);
// HMENU __stdcall GetSubMenu(HMENU hMenu, int nPos);
// BOOL __stdcall GetClientRect(HWND hWnd, LPRECT lpRect);
// BOOL __stdcall UnhookWinEvent(HWINEVENTHOOK hWinEventHook);
// HMENU __stdcall GetMenu(HWND hWnd);
// int __stdcall MessageBoxW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType);
// BOOL __stdcall WinHelpW(HWND hWndMain, LPCWSTR lpszHelp, UINT uCommand, ULONG_PTR dwData);
// int __stdcall GetDlgCtrlID(HWND hWnd);
// HWND __stdcall ChildWindowFromPoint(HWND hWndParent, POINT Point);
// HDC __stdcall GetDC(HWND hWnd);
// BOOL __stdcall ShowWindow(HWND hWnd, int nCmdShow);
// int __stdcall DrawTextExW(HDC hdc, LPWSTR lpchText, int cchText, LPRECT lprc, UINT format, LPDRAWTEXTPARAMS lpdtp);
// int __stdcall ReleaseDC(HWND hWnd, HDC hDC);
// HICON __stdcall LoadIconW(HINSTANCE hInstance, LPCWSTR lpIconName);
// HWINEVENTHOOK __stdcall SetWinEventHook(DWORD eventMin, DWORD eventMax, HMODULE hmodWinEventProc, WINEVENTPROC pfnWinEventProc, DWORD idProcess, DWORD idThread, DWORD dwFlags);
// BOOL __stdcall GetMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax);
// BOOL __stdcall PostMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
// BOOL __stdcall IsDialogMessageW(HWND hDlg, LPMSG lpMsg);
// int __stdcall TranslateAcceleratorW(HWND hWnd, HACCEL hAccTable, LPMSG lpMsg);
// BOOL __stdcall EndDialog(HWND hDlg, INT_PTR nResult);
// UINT __stdcall GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int cchMax);
// BOOL __stdcall SetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPCWSTR lpString);
// HWND __stdcall SetFocus(HWND hWnd);
// BOOL __stdcall SetWindowTextW(HWND hWnd, LPCWSTR lpString);
// HWND __stdcall GetParent(HWND hWnd);
// int __stdcall LoadStringW(HINSTANCE hInstance, UINT uID, LPWSTR lpBuffer, int cchBufferMax);
// LRESULT __stdcall SendDlgItemMessageW(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam);
// BOOL __stdcall GetCursorPos(LPPOINT lpPoint);
// BOOL __stdcall ScreenToClient(HWND hWnd, LPPOINT lpPoint);
// BOOL __stdcall TranslateMessage(const MSG *lpMsg);
// HWND __stdcall GetAncestor(HWND hwnd, UINT gaFlags);
// LRESULT __stdcall DispatchMessageW(const MSG *lpMsg);
// unsigned int __cdecl controlfp(unsigned int NewValue, unsigned int Mask);
// int __cdecl vsnwprintf(wchar_t *Dest, size_t Count, const wchar_t *Format, va_list Args);
// __int32 __cdecl wtol(const wchar_t *Str);
// int __cdecl iswctype(wint_t C, wctype_t Type);
// int __cdecl wcsncmp(const wchar_t *Str1, const wchar_t *Str2, size_t MaxCount);
// wchar_t *__cdecl wcsrchr(const wchar_t *Str, wchar_t Ch);
// void __cdecl exit(int Code);
// int __cdecl ismbblead(_DWORD); weak
// int cexit(void); weak
// void __cdecl exit(int Code);
// void __cdecl terminate(); weak
// HWND __stdcall ReplaceTextW(LPFINDREPLACEW);
// BOOL __stdcall PageSetupDlgW(LPPAGESETUPDLGW);
// HRESULT __stdcall PrintDlgExW(LPPRINTDLGEXW);
// HWND __stdcall FindTextW(LPFINDREPLACEW);
// BOOL __stdcall ChooseFontW(LPCHOOSEFONTW);
// BOOL __stdcall GetSaveFileNameW(LPOPENFILENAMEW);
// DWORD __stdcall CommDlgExtendedError();
// BOOL __stdcall GetOpenFileNameW(LPOPENFILENAMEW);
// __int16 __stdcall GetFileTitleW(LPCWSTR, LPWSTR Buf, WORD cchSize);
// void __stdcall DragAcceptFiles(HWND hWnd, BOOL fAccept);
// void __stdcall SHAddToRecentDocs(UINT uFlags, LPCVOID pv);
// HRESULT __stdcall SHGetFolderPathW(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPWSTR pszPath);
// int __stdcall SHCreateItemFromParsingName(_DWORD, _DWORD, _DWORD, _DWORD); weak
// BOOL __stdcall ShellExecuteExW(LPSHELLEXECUTEINFOW lpExecInfo);
// UINT __stdcall DragQueryFileW(HDROP hDrop, UINT iFile, LPWSTR lpszFile, UINT cch);
// void __stdcall DragFinish(HDROP hDrop);
// HRESULT __stdcall CoInitializeEx(LPVOID pvReserved, DWORD dwCoInit);
// void __stdcall CoUninitialize();
// LPVOID __stdcall CoTaskMemAlloc(SIZE_T cb);
// HRESULT __stdcall CoCreateInstance(const IID *const rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, const IID *const riid, LPVOID *ppv);
// void __stdcall CoTaskMemFree(LPVOID pv);
// HRESULT __stdcall CoInitialize(LPVOID pvReserved);
// BOOL __stdcall PathIsFileSpecW(LPCWSTR pszPath);
// int __stdcall SHStrDupW(_DWORD, _DWORD); weak
// HPROPSHEETPAGE __stdcall CreatePropertySheetPageW(LPCPROPSHEETPAGEW constPropSheetPagePointer);
// INT_PTR __stdcall PropertySheetW(LPCPROPSHEETHEADERW);
// HWND __stdcall CreateStatusWindowW(LONG style, LPCWSTR lpszText, HWND hwndParent, UINT wID);
// int __stdcall COMCTL32_345(_DWORD, _DWORD, _DWORD, _DWORD); weak
// void __stdcall SysFreeString(BSTR bstrString);
// BSTR __stdcall SysAllocString(const OLECHAR *psz);
// int __stdcall RtlInitUnicodeString(_DWORD, _DWORD); weak
// int __stdcall NtQueryLicenseValue(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD); weak
WPARAM __cdecl sub_1001405(HINSTANCE hInstance);
// signed int __userpurge sub_10014DE<eax>(void *a1<ecx>, int a2<ebx>, HWND hWnd, signed int Msg, WPARAM hDrop, unsigned int lParam);
void __thiscall sub_1001564(void *this);
// void *__cdecl memset(void *Dst, int Val, size_t Size);
signed int sub_10015C3(wchar_t *Dest, unsigned int a2, const wchar_t *Format, ...);
// void __userpurge sub_1001620(int a1<ebp>, void (__stdcall *a2)(_DWORD, _DWORD, _DWORD, _DWORD)<esi>, int a3);
signed int __stdcall sub_1001664(int a1);
int __stdcall loc_100169F(int); // weak
LRESULT __stdcall sub_100170A(unsigned int a1);
int __stdcall loc_1001799(int); // weak
LRESULT __stdcall pfnWinEventProc(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
// signed int __userpurge sub_1001809<eax>(void *a1<ecx>, int a2<ebx>, HWND a3, unsigned __int16 a4, int a5);
__int32 __cdecl sub_1001963();
HGLOBAL __cdecl sub_1001A1C();
// void __userpurge sub_1001A4D(const WCHAR *a1<ebx>, int a2<ebp>, int (__stdcall *a3)(_DWORD, _DWORD, _DWORD, _DWORD)<esi>, int a4);
// int __usercall sub_1001A72<eax>(int a1<ebp>);
DWORD __stdcall sub_1001AA5(HWND hWndNewOwner);
int __stdcall loc_1001C23(HWND hWndNewOwner); // weak
int __stdcall loc_1001C66(HWND hWndNewOwner); // weak
int __stdcall sub_1001E66(HINSTANCE hInstance, int, int nCmdShow); // idb
// _DWORD __usercall sub_10023D0<eax>(_DWORD ebp0<ebp>); weak
int __stdcall sub_1002409(int nWidth, int); // idb
// void *__cdecl memcpy(void *Dst, const void *Src, size_t Size);
int __stdcall sub_1002456(LPCWSTR lpString1); // idb
signed int __stdcall sub_1002558(int a1, unsigned int a2, int a3);
int __stdcall sub_10025CB(int a1);
signed int __stdcall sub_10025EF(WCHAR **a1);
int __stdcall sub_1002631(WCHAR **a1, int nCmdShow);
int __stdcall loc_100266D(int, int nCmdShow); // weak
// signed int __userpurge sub_1002689<eax>(unsigned __int16 *a1<eax>, WCHAR **a2);
signed int __stdcall sub_10026D5(wchar_t *Dest, unsigned int a2);
int __thiscall sub_1002733(int this);
int loc_10027A2(); // weak
// int __usercall sub_10027F0<eax>(unsigned int a1<eax>, int a2<ecx>);
// int __userpurge sub_1002820<eax>(int a1<ebp>, int a2, int a3);
int __stdcall loc_1002B3F(int, int); // weak
char *__cdecl sub_1002B64(int a1, int a2);
LPCWSTR __stdcall sub_1002C0D(LPWSTR lpBuffer, LPCWSTR lpFileName, DWORD nBufferLength);
LONG __thiscall sub_1002F8B(void *this);
// int __cdecl initterm(_DWORD, _DWORD); weak
int __cdecl sub_100304B();
DWORD __cdecl sub_1003053();
LSTATUS __cdecl sub_10030E2();
int __stdcall sub_100355B(HKEY hKey, LPCWSTR lpValueName, int); // idb
__int32 __stdcall sub_10035B0(HKEY Type, LPCWSTR lpValueName, const void *Src, void *Dst, DWORD cbData);
const WCHAR *__cdecl sub_100360C(LPCWSTR lpsz);
int __cdecl sub_1003660(unsigned int a1, unsigned int a2);
// int __usercall start<eax>(int a1<ebp>);
int dword_1003784(); // weak
int dword_100378C(); // weak
int dword_1003790(); // weak
int dword_100379C(); // weak
int dword_10037A0(); // weak
// ATOM __usercall sub_10037EF<ax>(HINSTANCE a1<esi>);
HLOCAL __stdcall sub_1003881(HINSTANCE hInstance);
int __stdcall sub_100392D(HINSTANCE hInstance); // idb
unsigned int __cdecl sub_1003A48();
signed int __cdecl sub_1003A60(signed int a1);
// int __userpurge sub_1003A98<eax>(int a1<ebp>, int a2);
char *__cdecl sub_1003B0C(int a1, int a2);
int __stdcall sub_1003BCD(int a1, int a2, int a3, int a4);
int __stdcall sub_1003C46(int a1);
signed int __stdcall sub_1003C61(int a1, int a2);
// int __userpurge sub_1003C89<eax>(int a1<ebx>, int a2);
int __stdcall sub_1003D1B(int a1);
int __stdcall sub_1003D6D(int, LPCWSTR pszPath, int, int); // idb
int __stdcall sub_1003E75(int, LPCWSTR pszPath); // idb
LONG __stdcall sub_1003EA6(int a1);
// int __userpurge sub_1003F21<eax>(int a1<ebx>, int a2, int a3);
// double __userpurge sub_1004038<st0>(int a1<eax>, int a2<ebp>, int a3<esi>, double result<st0>, int a5, int a6, int a7);
signed int __stdcall sub_100405A(int a1, int a2);
signed int __stdcall sub_1004073(int a1, int a2);
signed int __stdcall sub_10040C4(int a1, int a2, int a3);
LONG __stdcall sub_10040FB(int a1);
int __stdcall sub_1004116(int a1);
signed int __stdcall sub_100414E(int a1);
int __cdecl sub_1004194();
int __stdcall sub_1004240(HWND hDlg, int, int, int); // idb
int __stdcall loc_1004280(HWND hDlg, int, int, int); // weak
DWORD __cdecl sub_100432B();
int __stdcall sub_10043F5(int a1, int a2);
HRESULT __thiscall sub_100449D(void *this);
int __stdcall sub_10045A7(int a1);
// int __stdcall WinSqmAddToStream(_DWORD, _DWORD, _DWORD, _DWORD); weak
int __stdcall sub_1004628(LPCWSTR lpString); // idb
LSTATUS __stdcall sub_100478B(HKEY hKey, LPCWSTR lpValueName, LPCWSTR lpData);
signed int __stdcall sub_10047BA(int a1, int a2, int a3, int a4);
LSTATUS __stdcall sub_100498E(HKEY hKey, LPCWSTR lpValueName, BYTE Data);
// void __usercall sub_10056E3(struct _SECURITY_ATTRIBUTES *a1<ebx>, int a2<ebp>, int a3<esi>);
void __stdcall sub_10058A7(int a1, int a2);
int __stdcall loc_10058B2(int, int); // weak
int __stdcall loc_10058BD(int, int); // weak
int __stdcall loc_10058D7(int, int); // weak
int __stdcall loc_10058EB(int, int); // weak
int __stdcall loc_100590F(int, int); // weak
int __stdcall loc_1005951(int, int); // weak
int __stdcall loc_1005976(int, int); // weak
int __stdcall loc_1005A43(int, int); // weak
int __stdcall loc_1005AC7(int, int); // weak
int __stdcall loc_1005AEB(int, int); // weak
int __stdcall loc_1005B5A(int, int); // weak
int __stdcall loc_1005B65(int, int); // weak
int __stdcall loc_1005B9C(int, int); // weak
int __stdcall loc_1005BE2(int, int); // weak
int __stdcall loc_1005C0C(int, int); // weak
// void __usercall sub_1005D2A(int a1<ebp>, HWND a2<edi>);
// int __usercall sub_1006C68<eax>(int a1<ebp>);
// void __usercall sub_1006C7C(int a1<ebp>);
int loc_1006C97(); // weak
signed int __cdecl sub_1006CB4();
LONG __stdcall sub_1006DC0(int a1);
LONG __stdcall sub_1006DDA(int a1);
int __stdcall sub_1006DF4(int a1, int a2, int a3, int a4);
signed int __stdcall sub_1006E12(int a1, int a2, int a3);
int __stdcall sub_1006E32(int, LPCWSTR lpFileName); // idb
int __stdcall sub_1006F5C(int a1, const WCHAR *lpFileName);
LRESULT __stdcall sub_1006FB9(int a1);
const WCHAR *__stdcall sub_1007008(LPCWSTR lpsz);
int __stdcall sub_1007051(HWND hWnd, LPCWSTR lpCaption, LPCWSTR lpText, LPCWSTR lpString, UINT uType); // idb
__int32 __stdcall sub_10070D3(int a1);
int __stdcall sub_10071C2(const void *lpv, int iSize);
int __stdcall sub_100722E(HWND hWndParent, int, HWND hWnd, int); // idb
signed int __stdcall sub_100739B(DWORD hDlg, int a2, HWND hWnd, int a4);
signed int __stdcall DialogFunc(HWND hWnd, int a2, unsigned __int16 a3, int a4);
signed int __stdcall sub_10077F3(int a1);
signed int __stdcall sub_1007823(int a1, int *a2);
signed int __stdcall sub_10078D3(int a1, int a2, LPWSTR *a3);
// signed int __usercall sub_1007985<eax>(int a1<ebp>);
void __stdcall sub_10079E3(HDROP hDrop, HWND hWnd);
int __stdcall Proc(int a1, int a2, int a3, int a4);
// int __userpurge sub_1007A58<eax>(int result<eax>, int a2, int a3, int a4);
int __stdcall sub_1007A90(HANDLE hFile, UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar); // idb
LRESULT __cdecl sub_1007B40();
LRESULT __cdecl sub_1007BA2();
int __stdcall sub_1007BF6(LPCWSTR lpString); // idb
// signed int __userpurge sub_1007C80<eax>(int a1<eax>, int a2<edx>, int a3<ecx>, int a4, int a5);
int __stdcall sub_1007CD7(HWND hWnd, LPCWSTR lpString1, LPCWSTR lpBuffer); // idb
signed int __stdcall sub_1007F99(int a1, unsigned int a2, int a3);
signed int __stdcall sub_100800F(int a1);
int __stdcall sub_10080E4(int lpString, unsigned int a2);
int __stdcall sub_1008143(int a1, int a2, int a3, int a4, int a5);
int __stdcall sub_100818F(int a1, int a2, int a3, int a4, int a5);
signed int __stdcall sub_10081DB(int a1);
int __stdcall sub_1008383(DWORD hWnd); // idb
int __stdcall sub_10085E5(int a1, int a2, int a3, int a4);
size_t __cdecl sub_1008639();
bool __stdcall proc(int a1, int a2);
int __stdcall sub_100882E(HDC hdc); // idb
BOOL __cdecl sub_100888F();
signed int __cdecl sub_10088B6();
signed int __cdecl sub_1008987();
signed int __stdcall sub_1008A63(HWND hWnd, int a2, int a3, int a4);
signed int __stdcall sub_1008AEF(int a1, int a2, int a3, int a4);
int *__stdcall sub_1008B3E(int a1);
int __stdcall sub_1008EF2(HDC hdc, int y); // idb
signed int __stdcall sub_100900D(HDC a1);
bool __stdcall sub_10096AE(LCID Locale);
bool __stdcall sub_10096F8(int a1);
bool __stdcall sub_100973A(bool a1);
LRESULT __stdcall sub_100978A(int a1);
signed int __stdcall sub_10098C7(int a1, int a2);
BOOL __stdcall sub_100991D(const void *lpv, int iSize);
// signed int __usercall sub_1009952<eax>(int a1<eax>, int a2<edx>, int a3<edi>);
int __stdcall sub_1009989(HWND hwnd, int, __int16, int); // idb
void __stdcall StartAddress(int a1);
signed int __stdcall sub_1009CDF(int a1, int a2, int a3);
signed int __stdcall sub_1009D19(int a1, int a2, int a3);
int __cdecl sub_1009D73(int a1, int a2, int a3, int a4);
int __stdcall sub_1009D9D(int a1);
// int __cdecl XcptFilter(_DWORD, _DWORD); weak
bool __cdecl sub_1009DF0(int a1);
int __cdecl sub_1009E2A(int a1, unsigned int a2);
// int __usercall sub_1009E73<eax>(int a1<ebp>);
// int __cdecl amsg_exit(_DWORD); weak
// BOOL __usercall sub_1009F07<eax>(char _CF<cf>, char _ZF<zf>, char _SF<sf>, char _OF<of>, int a5<eax>, int a6<edx>, int a7<ecx>, int a8<ebx>, int a9<edi>, int a10<esi>, char a11);
// int __cdecl except_handler4_common(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); weak
// BOOL __stdcall ClosePrinter(HANDLE hPrinter);
// BOOL __stdcall GetPrinterDriverW(HANDLE hPrinter, LPWSTR pEnvironment, DWORD Level, LPBYTE pDriverInfo, DWORD cbBuf, LPDWORD pcbNeeded);
// BOOL __stdcall OpenPrinterW(LPWSTR pPrinterName, LPHANDLE phPrinter, LPPRINTER_DEFAULTSW pDefault);
// int __stdcall WinSqmIncrementDWORD(_DWORD, _DWORD, _DWORD); weak
// BOOL __stdcall VerQueryValueW(LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen);
// BOOL __stdcall GetFileVersionInfoExW(DWORD dwFlags, LPCWSTR lpwstrFilename, DWORD dwHandle, DWORD dwLen, LPVOID lpData);
// DWORD __stdcall GetFileVersionInfoSizeExW(DWORD dwFlags, LPCWSTR lpwstrFilename, LPDWORD lpdwHandle);


//----- (01001405) --------------------------------------------------------
WPARAM __cdecl sub_1001405(HINSTANCE hInstance)
{
  const WCHAR *v1; // edi@1
  int v2; // eax@2
  int v3; // ST18_4@2
  HWINEVENTHOOK v4; // ebx@3
  DWORD v5; // eax@3
  struct tagMSG Msg; // [sp+8h] [bp-1Ch]@1

  Msg.hwnd = 0;
  memset(&Msg.message, 0, 0x18u);
  v1 = GetCommandLineW();
  HeapSetInformation(0, HeapEnableTerminationOnCorruption, 0, 0);
  if ( CoInitializeEx(0, 2u) >= 0 )
  {
    v2 = (int)sub_100360C(v1);
    if ( sub_1001E66(hInstance, v2, v3) )
    {
      v5 = GetCurrentProcessId();
      v4 = SetWinEventHook(0x800Bu, 0x800Bu, 0, (WINEVENTPROC)pfnWinEventProc, v5, 0, 0);
      while ( GetMessageW(&Msg, 0, 0, 0) )
      {
        if ( Msg.message == 80 )
          PostMessageW(hWnd, 0x8001u, 0, 0);
        if ( !dword_100CCE8 || !IsDialogMessageW(dword_100CCE8, &Msg) )
        {
          if ( !TranslateAcceleratorW(hWnd, hAccTable, &Msg) )
          {
            TranslateMessage(&Msg);
            DispatchMessageW(&Msg);
          }
        }
      }
      sub_1001A1C();
      if ( v4 )
        UnhookWinEvent(v4);
    }
    else
    {
      Msg.wParam = 0;
    }
    CoUninitialize();
  }
  return Msg.wParam;
}
// 1001405: could not find valid save-restore pair for ebx

//----- (010014DE) --------------------------------------------------------
signed int __userpurge sub_10014DE<eax>(void *a1<ecx>, int a2<ebx>, HWND hWnd, signed int Msg, WPARAM hDrop, unsigned int lParam)
{
  WPARAM v7; // eax@25
  LPARAM v8; // ecx@25
  WPARAM v9; // eax@29
  LRESULT (__stdcall *v10)(HWND, UINT, WPARAM, LPARAM); // edi@56
  unsigned int v11; // eax@66
  int v12; // ecx@66
  int v13; // edx@66
  HCURSOR (__stdcall *v14)(HCURSOR); // esi@67
  signed int v15; // esi@79
  unsigned int v16; // eax@87
  UINT v17; // [sp-Ch] [bp-14h]@11
  UINT v18; // [sp-Ch] [bp-14h]@33
  const WCHAR *v19; // [sp-Ch] [bp-14h]@59
  WPARAM v20; // [sp-8h] [bp-10h]@11
  WPARAM v21; // [sp-8h] [bp-10h]@33
  const WCHAR *v22; // [sp-8h] [bp-10h]@59
  LPARAM v23; // [sp-4h] [bp-Ch]@10
  LPARAM v24; // [sp-4h] [bp-Ch]@33
  HWND v25; // [sp-4h] [bp-Ch]@36
  UINT v26; // [sp-4h] [bp-Ch]@59

  if ( (unsigned int)Msg > 0x1C )
  {
    if ( Msg != 273 )
    {
      if ( Msg == 274 )
      {
        if ( !dword_100CCEC || (v16 = hDrop & 0xFFF0, v16 != 61472) && v16 != 61504 && v16 != 61520 )
          DefWindowProcW(hWnd, 0x112u, hDrop, lParam);
        return 0;
      }
      if ( Msg == 278 )
      {
        sub_1001AA5(hWnd);
        return 0;
      }
      if ( Msg == 279 )
      {
        if ( dword_100CCEC )
        {
          if ( lParam >> 16 )
            EnableMenuItem(hMenu, 0xF020u, 3u);
        }
        return 0;
      }
      if ( Msg == 563 )
      {
        sub_10079E3((HDROP)hDrop, hWnd);
        return 0;
      }
      if ( Msg != 793 )
      {
        if ( Msg != 32769 )
        {
LABEL_9:
          if ( Msg != dword_100C07C )
          {
            v23 = lParam;
LABEL_11:
            v20 = hDrop;
            v17 = Msg;
            return DefWindowProcW(hWnd, v17, v20, v23);
          }
          v12 = *(_DWORD *)(lParam + 12);
          v11 = ~(unsigned __int8)*(_DWORD *)(lParam + 12) & 1;
          v13 = (*(_DWORD *)(lParam + 12) >> 2) & 1;
          dword_100D79C = ~(unsigned __int8)*(_DWORD *)(lParam + 12) & 1;
          dword_100D798 = v13;
          if ( v12 & 8 )
          {
            v14 = SetCursor;
            SetCursor(hCursor);
          }
          else
          {
            if ( !(v12 & 0x10) )
            {
              if ( v12 & 0x20 )
              {
                if ( v11 )
                  dword_100D79C = 0;
                SetCursor(hCursor);
                SendMessageW(dword_100C028, 177u, 0, 0);
                if ( !sub_1008639() )
                {
                  do
                    sub_10070D3(0);
                  while ( sub_10081DB((int)&word_100C9E0) );
                }
                SetCursor(dword_100C094);
                SendMessageW(dword_100C028, 0xB1u, 0, 0);
                SendMessageW(dword_100C028, 0xB7u, 0, 0);
                sub_100170A(1u);
              }
              else
              {
                if ( v12 & 0x40 )
                  dword_100CCE8 = 0;
              }
              return 0;
            }
            v14 = SetCursor;
            SetCursor(hCursor);
            sub_10070D3(1);
          }
          sub_10081DB((int)&word_100C9E0);
          v14(dword_100C094);
          return 0;
        }
        v15 = 0;
        if ( ((unsigned int)GetKeyboardLayout(0) & 0x3FF) == 17 )
          v15 = 1;
        v24 = v15;
        v21 = 1;
        v18 = 216;
LABEL_34:
        SendMessageW(dword_100C028, v18, v21, v24);
        return 0;
      }
      if ( ((lParam >> 16) & 0xFFF) == 5 )
      {
        sub_1001809(a1, a2, hWnd, 0x15u, 0);
        return 0;
      }
    }
    if ( (HWND)lParam != dword_100C028
      || (v9 = hDrop >> 16, (unsigned __int16)(hDrop >> 16) != 1280) && (a1 = (void *)1281, (_WORD)v9 != 1281) )
    {
      if ( !sub_1001809(a1, a2, hWnd, hDrop, lParam) )
      {
        v23 = lParam;
        goto LABEL_11;
      }
      return 0;
    }
    if ( dword_100C030 == 1 )
    {
      dword_100C030 = 2;
      return 0;
    }
    v26 = 4112;
    v22 = szApp;
    v19 = lpText;
LABEL_60:
    MessageBoxW(::hWnd, v19, v22, v26);
    return 0;
  }
  if ( Msg == 28 )
  {
    if ( hDrop )
    {
      v7 = dword_100C044;
      v8 = ::lParam;
      if ( !dword_100C044 && !::lParam )
        return 0;
      v10 = SendMessageW;
    }
    else
    {
      v10 = SendMessageW;
      SendMessageW(dword_100C028, 176u, (WPARAM)&dword_100C044, (LPARAM)&::lParam);
      v7 = dword_100C044;
      v8 = ::lParam;
      if ( dword_100C044 == ::lParam )
      {
        dword_100C044 = 0;
        ::lParam = 0;
        return 0;
      }
    }
    v10(dword_100C028, 177u, v7, v8);
    v10(dword_100C028, 183u, 0, 0);
    return 0;
  }
  if ( Msg == 2 )
  {
    PostQuitMessage(0);
    return 0;
  }
  if ( Msg == 5 )
  {
    if ( !hDrop )
      goto LABEL_96;
    if ( hDrop == 1 )
    {
      v23 = lParam;
      v20 = 1;
      v17 = 5;
      return DefWindowProcW(hWnd, v17, v20, v23);
    }
    if ( hDrop == 2 )
LABEL_96:
      sub_1002409((signed __int16)lParam, SHIWORD(lParam));
    return 0;
  }
  if ( Msg == 6 )
  {
    if ( (_WORD)hDrop != 1 && (_WORD)hDrop != 2 || IsIconic(::hWnd) || GetForegroundWindow() != ::hWnd )
      return 0;
    v25 = GetForegroundWindow();
    goto LABEL_37;
  }
  if ( Msg == 7 )
  {
    if ( IsIconic(::hWnd) )
      return 0;
    v25 = dword_100C028;
LABEL_37:
    SetFocus(v25);
    return 0;
  }
  if ( Msg == 8 )
  {
    v24 = lParam;
    v21 = hDrop;
    v18 = 8;
    goto LABEL_34;
  }
  if ( Msg == 16 )
  {
    sub_1001963();
    if ( sub_1001664(0) )
    {
      DestroyWindow(dword_100C024);
      DestroyWindow(::hWnd);
      DeleteObject(ho);
    }
    return 0;
  }
  if ( Msg != 17 )
    goto LABEL_9;
  if ( dword_100C038 )
  {
    MessageBeep(0);
    MessageBeep(0);
    v26 = 4096;
    v22 = szApp;
    v19 = dword_100C314;
    goto LABEL_60;
  }
  return sub_1001664(1);
}
// 100C030: using guessed type int dword_100C030;
// 100C038: using guessed type int dword_100C038;
// 100C07C: using guessed type int dword_100C07C;
// 100CCEC: using guessed type int dword_100CCEC;
// 100D798: using guessed type int dword_100D798;
// 100D79C: using guessed type int dword_100D79C;

//----- (01001564) --------------------------------------------------------
void __thiscall sub_1001564(void *this)
{
  JUMPOUT((unsigned int)this, dword_100C010, *(unsigned int *)sub_1009F07);
}
// 100C010: using guessed type int dword_100C010;

//----- (010015C3) --------------------------------------------------------
signed int sub_10015C3(wchar_t *Dest, unsigned int a2, const wchar_t *Format, ...)
{
  signed int result; // eax@1
  int v4; // eax@4
  signed int v5; // ebx@4
  int v6; // esi@4
  va_list va; // [sp+14h] [bp+14h]@1

  va_start(va, Format);
  result = 0;
  if ( !a2 || a2 > 0x7FFFFFFF )
    result = -2147024809;
  if ( result >= 0 )
  {
    v6 = a2 - 1;
    v5 = 0;
    v4 = vsnwprintf(Dest, a2 - 1, Format, va);
    if ( v4 < 0 || v4 > (unsigned int)v6 )
    {
      v5 = -2147024774;
    }
    else
    {
      if ( v4 != v6 )
        return v5;
    }
    Dest[v6] = 0;
    return v5;
  }
  return result;
}

//----- (01001620) --------------------------------------------------------
void __userpurge sub_1001620(int a1<ebp>, void (__stdcall *a2)(_DWORD, _DWORD, _DWORD, _DWORD)<esi>, int a3)
{
  sub_10015C3((wchar_t *)(a1 - 260), 0x80u, Format);
  JUMPOUT((unsigned int)dword_100C024, 0, *(unsigned int *)loc_1001799);
  a2(dword_100C024, 1035, 1, a1 - 260);
  JUMPOUT(*(unsigned int *)loc_1001799);
}
// 1001799: using guessed type int __stdcall loc_1001799(int);

//----- (01001664) --------------------------------------------------------
signed int __stdcall sub_1001664(int a1)
{
  JUMPOUT(dword_100C008, 0, *(unsigned int *)sub_1001A4D);
  JUMPOUT(SendMessageW(dword_100C028, 0xEu, 0, 0), 0, *(unsigned int *)sub_1001A4D);
  return 1;
}
// 100C008: using guessed type int dword_100C008;

//----- (0100170A) --------------------------------------------------------
LRESULT __stdcall sub_100170A(unsigned int a1)
{
  LRESULT result; // eax@1
  WPARAM v2; // eax@1
  unsigned int v3; // edi@1
  LPARAM lParam; // [sp+Ch] [bp-10Ch]@1
  WPARAM wParam; // [sp+10h] [bp-108h]@1
  unsigned int v6; // [sp+114h] [bp-4h]@1
  int v7; // [sp+118h] [bp+0h]@1

  v6 = (unsigned int)&v7 ^ dword_100C010;
  SendMessageW(dword_100C028, 176u, (WPARAM)&wParam, (LPARAM)&lParam);
  v2 = SendMessageW(dword_100C028, 0xC9u, wParam, 0);
  v3 = v2 + 1;
  result = SendMessageW(dword_100C028, 0xBBu, v2, 0);
  JUMPOUT(a1, 0, *(unsigned int *)sub_1001620);
  JUMPOUT(wParam - result + 1, dword_100C01C, *(unsigned int *)sub_1001620);
  JUMPOUT(v3, dword_100C018, *(unsigned int *)sub_1001620);
  dword_100C018 = v3;
  dword_100C01C = wParam - result + 1;
  return result;
}
// 100C010: using guessed type int dword_100C010;
// 100C018: using guessed type int dword_100C018;
// 100C01C: using guessed type int dword_100C01C;

//----- (010017BB) --------------------------------------------------------
LRESULT __stdcall pfnWinEventProc(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
{
  return sub_100170A(0);
}

//----- (01001809) --------------------------------------------------------
signed int __userpurge sub_1001809<eax>(void *a1<ecx>, int a2<ebx>, HWND a3, unsigned __int16 a4, int a5)
{
  int ebp0; // ebp@0
  HMENU v7; // eax@15
  HMENU v8; // ebx@15
  LPARAM v9; // eax@15
  HDC v10; // ebx@20
  int v11; // eax@21
  HFONT v12; // esi@22
  const WCHAR *v13; // eax@30
  int v14; // esi@30
  signed int v15; // eax@31
  int v16; // eax@37
  signed int v17; // esi@37
  DWORD v18; // eax@42
  HANDLE v19; // ebx@68
  HWND v20; // eax@78
  HWND v21; // eax@80
  int v22; // eax@86
  HMENU v23; // eax@92
  HMENU v24; // ebx@92
  HMENU v25; // eax@92
  HMENU v26; // eax@93
  HMENU v27; // eax@93
  signed int v28; // esi@96
  HWND v29; // [sp-10h] [bp-78h]@74
  UINT v30; // [sp-Ch] [bp-74h]@74
  UINT v31; // [sp-8h] [bp-70h]@15
  WPARAM v32; // [sp-8h] [bp-70h]@74
  UINT v33; // [sp-4h] [bp-6Ch]@15
  int v34; // [sp-4h] [bp-6Ch]@34
  LPARAM v35; // [sp-4h] [bp-6Ch]@74
  CHOOSEFONTW v36; // [sp+Ch] [bp-5Ch]@20
  struct tagRECT Rect; // [sp+48h] [bp-20h]@95
  int v38; // [sp+58h] [bp-10h]@30
  HWND hWnd; // [sp+5Ch] [bp-Ch]@1
  LPVOID lpFileName; // [sp+60h] [bp-8h]@30
  unsigned int v41; // [sp+64h] [bp-4h]@1
  int v42; // [sp+68h] [bp+0h]@1

  v41 = (unsigned int)&v42 ^ dword_100C010;
  hWnd = a3;
  JUMPOUT(a4, 0x40u, *(unsigned int *)loc_1001C23);
  if ( a4 == 64 )
  {
    sub_100449D(a1);
    return 1;
  }
  if ( (signed int)a4 > 21 )
  {
    if ( (signed int)a4 > 26 )
    {
      if ( a4 == 27 )
      {
        GetClientRect(::hWnd, &Rect);
        if ( *(_DWORD *)&dword_100C02C )
        {
          *(_DWORD *)&dword_100C02C = 0;
          ShowWindow(dword_100C024, 0);
          sub_1002409(Rect.right - Rect.left, Rect.bottom - Rect.top);
          v28 = 1;
        }
        else
        {
          v28 = 1;
          *(_DWORD *)&dword_100C02C = 1;
          sub_1002409(Rect.right - Rect.left, Rect.bottom - Rect.top);
          sub_100170A(1u);
          ShowWindow(dword_100C024, 5);
        }
        dword_100CCF0 = v28;
        return 1;
      }
      if ( a4 != 32 )
      {
        if ( a4 == 33 )
        {
          v36.lStructSize = 0;
          memset(&v36.hwndOwner, 0, 0x38u);
          v10 = GetDC(0);
          if ( v10 )
          {
            v36.lStructSize = 60;
            v36.hwndOwner = hWnd;
            v36.lpLogFont = &lf;
            v11 = GetDeviceCaps(v10, 90);
            lf.lfHeight = -MulDiv(*(int *)&Data, v11, 720);
            v36.Flags = 16777281;
            v36.nFontType = 8192;
            ReleaseDC(0, v10);
            if ( ChooseFontW(&v36) )
            {
              SetCursor(hCursor);
              v12 = CreateFontIndirectW(&lf);
              if ( v12 )
              {
                DeleteObject(ho);
                ho = v12;
                SendMessageW(dword_100C028, 0x30u, (WPARAM)v12, 1);
                *(_DWORD *)&Data = v36.iPointSize;
              }
              SetCursor(dword_100C094);
              dword_100C03C = 1;
            }
          }
          return 1;
        }
        return 0;
      }
      v22 = -(wParam != 0);
      if ( sub_1008383((v22 & 0x100000) + 1344274692) )
      {
        dword_100CCF0 = 1;
        wParam = wParam == 0;
      }
      else
      {
        MessageBoxW(::hWnd, dword_100C2EC, szApp, 0x30u);
      }
      if ( !wParam )
      {
        v26 = GetMenu(::hWnd);
        v27 = GetSubMenu(v26, 3);
        EnableMenuItem(v27, 0x1Bu, 0);
        if ( !dword_100D580 )
          return 1;
        v35 = 0;
        v32 = 27;
        v30 = 273;
        v29 = hWnd;
        goto LABEL_75;
      }
      dword_100D580 = *(_DWORD *)&dword_100C02C;
      if ( *(_DWORD *)&dword_100C02C )
        SendMessageW(hWnd, 0x111u, 0x1Bu, 0);
      v23 = GetMenu(::hWnd);
      v24 = v23;
      v25 = GetSubMenu(v23, 3);
      CheckMenuItem(v25, 0x1Bu, 0);
      v33 = 1;
      v31 = 27;
      v7 = GetSubMenu(v24, 3);
    }
    else
    {
      if ( a4 == 26 )
      {
        sub_100978A(0);
        return 1;
      }
      if ( a4 == 22 )
      {
        if ( word_100C9E0 )
        {
          sub_10081DB((int)&word_100C9E0);
          return 1;
        }
LABEL_84:
        v20 = dword_100CCE8;
        if ( !dword_100CCE8 )
        {
          stru_100C0C0.wReplaceWithLen = 0;
          stru_100C0C0.Flags = 65537;
          stru_100C0C0.lpstrReplaceWith = 0;
          stru_100C0C0.lpstrFindWhat = (LPWSTR)&word_100C9E0;
          stru_100C0C0.wFindWhatLen = 128;
          v21 = FindTextW(&stru_100C0C0);
          goto LABEL_81;
        }
        goto LABEL_79;
      }
      if ( a4 == 23 )
      {
        v20 = dword_100CCE8;
        if ( !dword_100CCE8 )
        {
          stru_100C0C0.Flags = 65552;
          stru_100C0C0.lpstrReplaceWith = (LPWSTR)&unk_100E060;
          stru_100C0C0.wReplaceWithLen = 128;
          stru_100C0C0.lpstrFindWhat = (LPWSTR)&word_100C9E0;
          stru_100C0C0.wFindWhatLen = 128;
          v21 = ReplaceTextW(&stru_100C0C0);
LABEL_81:
          dword_100CCE8 = v21;
          return 1;
        }
LABEL_79:
        SetFocus(v20);
        return 1;
      }
      if ( a4 == 24 )
      {
        if ( !DialogBoxParamW(hInstance, (LPCWSTR)0xE, ::hWnd, (DLGPROC)DialogFunc, 0) )
          sub_1006FB9(dword_100E160);
        return 1;
      }
      if ( a4 != 25 )
        return 0;
      v8 = GetMenu(::hWnd);
      v9 = SendMessageW(dword_100C028, 14u, 0, 0);
      SendMessageW(dword_100C028, 0xB1u, 0, v9);
      SendMessageW(dword_100C028, 0xB7u, 0, 0);
      v33 = 1;
      v31 = 25;
      v7 = GetSubMenu(v8, 1);
    }
    EnableMenuItem(v7, v31, v33);
    return 1;
  }
  if ( a4 == 21 )
    goto LABEL_84;
  if ( (signed int)a4 <= 5 )
  {
    if ( a4 == 5 )
    {
      if ( PageSetupDlgW(&stru_100C140) )
      {
LABEL_72:
        sub_1002558((int)&word_100C740, 0x28u, (int)&word_100C6A0);
        sub_1002558((int)&Dst, 0x28u, (int)&unk_100C6F0);
        dword_100CCF4 = 1;
      }
      else
      {
        while ( 1 )
        {
          v18 = CommDlgExtendedError();
          if ( v18 != 4107 )
          {
            if ( v18 != 4105 && v18 != 4108 )
              break;
          }
          sub_1001A1C();
          stru_100C140.hDevNames = 0;
          stru_100C140.hDevMode = 0;
          if ( PageSetupDlgW(&stru_100C140) )
            goto LABEL_72;
        }
        sub_100432B();
      }
      return 1;
    }
    if ( a4 == 1 )
    {
      sub_100800F(1);
    }
    else
    {
      if ( a4 == 2 )
      {
        if ( !sub_1001664(0) )
          return 1;
        v38 = dword_100C00C;
        v16 = sub_1003F21(a2, (int)hWnd, (int)&lpFileName);
        v17 = v16;
        if ( v16 >= 0 )
          goto LABEL_101;
        if ( v16 != -2147023673 )
          v17 = sub_1007823((int)hWnd, (int *)&lpFileName);
        if ( v17 >= 0 )
        {
LABEL_101:
          v19 = hFile;
          hFile = CreateFileW((LPCWSTR)lpFileName, 0x80000000u, 3u, 0, 3u, 0x80u, 0);
          if ( !sub_1002820(ebp0, (int)lpFileName, dword_100C00C) )
          {
            hFile = v19;
            v17 = -2147467259;
          }
          CoTaskMemFree(lpFileName);
          if ( v17 >= 0 )
            return 1;
        }
        dword_100C00C = v38;
        v34 = v17;
      }
      else
      {
        if ( a4 == 3 )
        {
          dword_100E040 = dword_100C00C;
          if ( !dword_100C008 && sub_1007CD7(::hWnd, &FileName, 0) )
            return 1;
        }
        else
        {
          if ( a4 != 4 )
            return 0;
        }
        v14 = (int)L"*.txt";
        v38 = 0;
        lpFileName = 0;
        v13 = L"*.txt";
        if ( !dword_100C008 )
          v13 = &FileName;
        v15 = sub_1003D6D((int)hWnd, v13, (int)&lpFileName, (int)&v38);
        if ( v15 >= 0 )
          goto LABEL_102;
        if ( v15 != -2147023673 )
        {
          if ( !dword_100C008 )
            v14 = (int)&FileName;
          v15 = sub_10078D3((int)hWnd, v14, (LPWSTR *)&lpFileName);
        }
        if ( v15 >= 0 )
        {
LABEL_102:
          if ( sub_1007CD7(hWnd, (LPCWSTR)lpFileName, (LPCWSTR)1) )
            sub_1002558((int)&FileName, 0x104u, (int)lpFileName);
          if ( v38 )
            (*(void (__stdcall **)(int))(*(_DWORD *)v38 + 8))(v38);
          CoTaskMemFree(lpFileName);
          return 1;
        }
        v34 = v15;
      }
      sub_1003C46(v34);
    }
    return 1;
  }
  JUMPOUT(a4 - 6, 0, *(unsigned int *)loc_1004280);
  if ( a4 == 7 )
    JUMPOUT(*(unsigned int *)loc_1001C66);
  if ( a4 == 15 )
    return 1;
  if ( a4 == 16 )
  {
    v35 = 0;
    v32 = 0;
    v30 = 199;
    v29 = dword_100C028;
LABEL_75:
    SendMessageW(v29, v30, v32, v35);
    return 1;
  }
  return 0;
}
// 1001C23: using guessed type int __stdcall loc_1001C23(HWND hWndNewOwner);
// 1001C66: using guessed type int __stdcall loc_1001C66(HWND hWndNewOwner);
// 1004280: using guessed type int __stdcall loc_1004280(HWND hDlg, int, int, int);
// 100C008: using guessed type int dword_100C008;
// 100C00C: using guessed type int dword_100C00C;
// 100C010: using guessed type int dword_100C010;
// 100C03C: using guessed type int dword_100C03C;
// 100CCF0: using guessed type int dword_100CCF0;
// 100CCF4: using guessed type int dword_100CCF4;
// 100D580: using guessed type int dword_100D580;
// 100E040: using guessed type int dword_100E040;
// 100E160: using guessed type int dword_100E160;

//----- (01001963) --------------------------------------------------------
__int32 __cdecl sub_1001963()
{
  __int32 result; // eax@1
  char v1; // zf@2
  signed int v2; // ecx@2
  char *v3; // edi@2
  char *v4; // esi@2
  WINDOWPLACEMENT wndpl; // [sp+4h] [bp-34h]@1
  int v6; // [sp+30h] [bp-8h]@1
  HKEY hKey; // [sp+34h] [bp-4h]@11

  v6 = 0;
  wndpl.length = 44;
  result = GetWindowPlacement(hWnd, &wndpl);
  if ( result )
  {
    v2 = 4;
    v3 = (char *)&wndpl.rcNormalPosition;
    v4 = (char *)&::wndpl.rcNormalPosition;
    result = 0;
    v1 = 1;
    do
    {
      if ( !v2 )
        break;
      v1 = *(_DWORD *)v4 == *(_DWORD *)v3;
      v4 += 4;
      v3 += 4;
      --v2;
    }
    while ( v1 );
    if ( !v1 )
    {
      v6 = 1;
LABEL_11:
      result = RegCreateKeyW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Notepad", &hKey);
      if ( !result )
      {
        if ( dword_100C03C )
        {
          sub_100498E(hKey, L"lfEscapement", LOBYTE(lf.lfEscapement));
          sub_100498E(hKey, L"lfOrientation", LOBYTE(lf.lfOrientation));
          sub_100498E(hKey, L"lfWeight", LOBYTE(lf.lfWeight));
          sub_100498E(hKey, L"lfItalic", lf.lfItalic);
          sub_100498E(hKey, L"lfUnderline", lf.lfUnderline);
          sub_100498E(hKey, L"lfStrikeOut", lf.lfStrikeOut);
          sub_100498E(hKey, L"lfCharSet", lf.lfCharSet);
          sub_100498E(hKey, L"lfOutPrecision", lf.lfOutPrecision);
          sub_100498E(hKey, L"lfClipPrecision", lf.lfClipPrecision);
          sub_100498E(hKey, L"lfQuality", lf.lfQuality);
          sub_100498E(hKey, L"lfPitchAndFamily", lf.lfPitchAndFamily);
          sub_100478B(hKey, L"lfFaceName", lf.lfFaceName);
          sub_100498E(hKey, L"iPointSize", Data);
        }
        if ( dword_100CCF0 )
        {
          sub_100498E(hKey, L"fWrap", wParam);
          sub_100498E(hKey, L"StatusBar", dword_100C02C);
        }
        if ( dword_100CCF4 )
        {
          sub_100478B(hKey, L"szHeader", &word_100C740);
          sub_100478B(hKey, L"szTrailer", (LPCWSTR)&Dst);
          sub_100498E(hKey, L"iMarginTop", LOBYTE(stru_100C140.rtMargin.top));
          sub_100498E(hKey, L"iMarginBottom", LOBYTE(stru_100C140.rtMargin.bottom));
          sub_100498E(hKey, L"iMarginLeft", LOBYTE(stru_100C140.rtMargin.left));
          sub_100498E(hKey, L"iMarginRight", LOBYTE(stru_100C140.rtMargin.right));
        }
        if ( v6 )
        {
          sub_100498E(hKey, L"iWindowPosX", LOBYTE(wndpl.rcNormalPosition.left));
          sub_100498E(hKey, L"iWindowPosY", LOBYTE(wndpl.rcNormalPosition.top));
          sub_100498E(hKey, L"iWindowPosDX", LOBYTE(wndpl.rcNormalPosition.right) - LOBYTE(wndpl.rcNormalPosition.left));
          sub_100498E(hKey, L"iWindowPosDY", LOBYTE(wndpl.rcNormalPosition.bottom) - LOBYTE(wndpl.rcNormalPosition.top));
        }
        result = RegCloseKey(hKey);
      }
      return result;
    }
  }
  if ( dword_100CCF4 || dword_100CCF0 || dword_100C03C )
    goto LABEL_11;
  return result;
}
// 100C03C: using guessed type int dword_100C03C;
// 100CCF0: using guessed type int dword_100CCF0;
// 100CCF4: using guessed type int dword_100CCF4;

//----- (01001A1C) --------------------------------------------------------
HGLOBAL __cdecl sub_1001A1C()
{
  HGLOBAL result; // eax@2

  if ( stru_100C140.hDevMode )
    GlobalFree(stru_100C140.hDevMode);
  result = stru_100C140.hDevNames;
  if ( stru_100C140.hDevNames )
    result = GlobalFree(stru_100C140.hDevNames);
  stru_100C140.hDevMode = 0;
  stru_100C140.hDevNames = 0;
  return result;
}

//----- (01001A4D) --------------------------------------------------------
void __userpurge sub_1001A4D(const WCHAR *a1<ebx>, int a2<ebp>, int (__stdcall *a3)(_DWORD, _DWORD, _DWORD, _DWORD)<esi>, int a4)
{
  int v4; // ST10_4@1
  const WCHAR *v5; // eax@3
  const WCHAR *v6; // edi@3
  bool v7; // esi@4
  int v8; // eax@4
  int v9; // eax@8
  signed int v10; // edi@11
  int v11; // eax@13
  const WCHAR *v12; // ST08_4@13
  const WCHAR *v13; // eax@20

  if ( a3(dword_100C028, 184, a1, v4) )
  {
    v5 = lpString2;
    v6 = &FileName;
    if ( (const WCHAR *)dword_100C008 == a1 )
      v5 = &FileName;
    v7 = 1;
    dword_100C038 = 1;
    v8 = sub_1004628(v5);
    *(_DWORD *)(a2 - 12) = v8;
    dword_100C038 = (int)a1;
    if ( v8 == 6 )
    {
      if ( (const WCHAR *)dword_100C008 != a1 )
        goto LABEL_28;
      dword_100E040 = dword_100C00C;
      v9 = sub_1007CD7(hWnd, &FileName, a1);
      v7 = v9 == 0;
      if ( !(v9 == 0) )
        goto LABEL_2;
      if ( (const WCHAR *)dword_100C008 != a1 )
LABEL_28:
        v6 = L"*.txt";
      v10 = SHStrDupW(v6, a2 - 8);
      if ( v10 < (signed int)a1 )
        goto LABEL_24;
      while ( (const WCHAR *)v7 != a1 )
      {
        v12 = *(const WCHAR **)(a2 - 8);
        *(_DWORD *)(a2 - 16) = a1;
        v11 = sub_1003D6D((int)hWnd, v12, a2 - 4, a2 - 16);
        v10 = v11;
        if ( v11 < (signed int)a1 )
        {
          if ( v11 != -2147023673 )
            v10 = sub_10078D3((int)hWnd, *(_DWORD *)(a2 - 8), (LPWSTR *)(a2 - 4));
        }
        CoTaskMemFree(*(LPVOID *)(a2 - 8));
        if ( v10 < (signed int)a1 )
          goto LABEL_24;
        if ( sub_1007CD7(hWnd, *(LPCWSTR *)(a2 - 4), (LPCWSTR)1) )
        {
          sub_1002558((int)&FileName, 0x104u, *(_DWORD *)(a2 - 4));
          dword_100C00C = dword_100E040;
          v7 = 0;
        }
        else
        {
          v10 = SHStrDupW(*(_DWORD *)(a2 - 4), a2 - 8);
        }
        v13 = *(const WCHAR **)(a2 - 16);
        if ( v13 != a1 )
          (*(void (__cdecl **)(_DWORD))(*(_DWORD *)v13 + 8))(*(_DWORD *)(a2 - 16));
        CoTaskMemFree(*(LPVOID *)(a2 - 4));
        if ( v10 < (signed int)a1 )
          break;
      }
      if ( v10 < (signed int)a1 )
      {
LABEL_24:
        *(_DWORD *)(a2 - 12) = 2;
        if ( v10 == -2147024882 )
          MessageBoxW(hWnd, lpText, szApp, 0x1010u);
      }
    }
  }
LABEL_2:
  JUMPOUT(*(unsigned int *)loc_100169F);
}
// 10013B4: using guessed type int __stdcall SHStrDupW(_DWORD, _DWORD);
// 100169F: using guessed type int __stdcall loc_100169F(int);
// 100C008: using guessed type int dword_100C008;
// 100C00C: using guessed type int dword_100C00C;
// 100C038: using guessed type int dword_100C038;
// 100E040: using guessed type int dword_100E040;

//----- (01001A72) --------------------------------------------------------
int __usercall sub_1001A72<eax>(int a1<ebp>)
{
  sub_1001564((void *)(a1 ^ *(_DWORD *)(a1 - 28)));
  return sub_10023D0(a1);
}
// 10023D0: using guessed type _DWORD __usercall sub_10023D0<eax>(_DWORD ebp0<ebp>);

//----- (01001AA5) --------------------------------------------------------
DWORD __stdcall sub_1001AA5(HWND hWndNewOwner)
{
  int v1; // eax@1
  HMENU v2; // ebx@1
  bool v3; // ST0C_4@1
  HMENU v4; // eax@1
  UINT v5; // ST0C_4@1
  HMENU v6; // eax@1
  UINT v7; // ST0C_4@1
  HMENU v8; // eax@1
  HMENU v9; // eax@1
  bool v10; // ST0C_4@4
  HMENU v11; // eax@4
  UINT v13; // ST0C_4@6
  HMENU v14; // eax@6
  UINT v15; // ST0C_4@6
  HMENU v16; // eax@6
  bool v17; // ST0C_4@6
  HMENU v18; // eax@6
  bool v19; // ST0C_4@6
  HMENU v20; // eax@6
  UINT v21; // ST0C_4@6
  HMENU v22; // eax@6
  UINT v23; // ST0C_4@6
  HMENU v24; // eax@6
  HMENU v25; // eax@8
  LPARAM lParam; // [sp+Ch] [bp-10h]@1
  WPARAM wParam; // [sp+10h] [bp-Ch]@1
  int v28; // [sp+14h] [bp-8h]@1
  UINT uEnable; // [sp+18h] [bp-4h]@1

  v28 = 0;
  v2 = GetMenu(hWnd);
  SendMessageW(dword_100C028, 0xB0u, (WPARAM)&wParam, (LPARAM)&lParam);
  v3 = wParam == lParam;
  uEnable = wParam == lParam;
  v4 = GetSubMenu(v2, 1);
  EnableMenuItem(v4, 768u, v3);
  v5 = uEnable;
  v6 = GetSubMenu(v2, 1);
  EnableMenuItem(v6, 0x301u, v5);
  v7 = uEnable;
  v8 = GetSubMenu(v2, 1);
  EnableMenuItem(v8, 0x303u, v7);
  v9 = GetSubMenu(v2, 1);
  v1 = GetMenuState(v9, 0x19u, 0);
  if ( v1 == 1 )
  {
    if ( uEnable == 1 )
    {
      v25 = GetSubMenu(v2, v1);
      EnableMenuItem(v25, 0x19u, 0);
    }
  }
  if ( OpenClipboard(hWndNewOwner) )
  {
    v28 = IsClipboardFormatAvailable(1u);
    CloseClipboard();
  }
  v10 = v28 == 0;
  v11 = GetSubMenu(v2, 1);
  EnableMenuItem(v11, 0x302u, v10);
  uEnable = 1;
  if ( SendMessageW(dword_100C028, 0xEu, 0, 0) )
    uEnable = 0;
  v13 = uEnable;
  v14 = GetSubMenu(v2, 1);
  EnableMenuItem(v14, 0x15u, v13);
  v15 = uEnable;
  v16 = GetSubMenu(v2, 1);
  EnableMenuItem(v16, 0x16u, v15);
  v17 = ::wParam != 0;
  v18 = GetSubMenu(v2, 1);
  EnableMenuItem(v18, 0x18u, v17);
  v19 = SendMessageW(dword_100C028, 0xC6u, 0, 0) == 0;
  v20 = GetSubMenu(v2, 1);
  EnableMenuItem(v20, 0x10u, v19);
  v21 = ::wParam != 0 ? 8 : 0;
  v22 = GetSubMenu(v2, 2);
  CheckMenuItem(v22, 32u, v21);
  v23 = *(_DWORD *)&dword_100C02C != 0 ? 8 : 0;
  v24 = GetSubMenu(v2, 3);
  return CheckMenuItem(v24, 0x1Bu, v23);
}

//----- (01001E66) --------------------------------------------------------
signed int __stdcall sub_1001E66(HINSTANCE hInstance, int a2, int nCmdShow)
{
  int ebp0; // ebp@0
  HACCEL v4; // eax@5
  HWND v5; // esi@7
  void *v6; // ecx@7
  int v7; // eax@16
  int v8; // edi@17
  int v9; // eax@17
  signed int v10; // eax@20
  int v11; // ecx@23
  HMENU v13; // eax@32
  HMENU v14; // eax@32
  int v15; // eax@41
  int Dst; // [sp+Ch] [bp-A8h]@10
  int v17; // [sp+28h] 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
c++中system(&quot;pause&quot;)的作用和含义发布时间:2022-07-13
下一篇:
C#解析JSON字符串总结发布时间:2022-07-13
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap