mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
sync rosapps to r44454
svn path=/branches/ros-amd64-bringup/; revision=44455
This commit is contained in:
commit
17b396a6d2
914 changed files with 86363 additions and 95999 deletions
|
@ -13,27 +13,12 @@
|
|||
<xi:include href="devutils/directory.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="downloader">
|
||||
<xi:include href="downloader/downloader.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="fontview">
|
||||
<xi:include href="fontview/fontview.rbuild" />
|
||||
</directory>
|
||||
<!--
|
||||
<directory name="fraginator">
|
||||
<xi:include href="fraginator/fraginator.rbuild" />
|
||||
</directory>
|
||||
-->
|
||||
|
||||
<directory name="imagesoft">
|
||||
<xi:include href="imagesoft/imagesoft.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="magnify">
|
||||
<xi:include href="magnify/magnify.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="net">
|
||||
<xi:include href="net/directory.rbuild" />
|
||||
</directory>
|
||||
|
@ -42,10 +27,6 @@
|
|||
<xi:include href="notevil/notevil.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="packmgr">
|
||||
<xi:include href="packmgr/directory.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="sysutils">
|
||||
<xi:include href="sysutils/sysutils.rbuild" />
|
||||
</directory>
|
||||
|
@ -53,12 +34,4 @@
|
|||
<directory name="winfile">
|
||||
<xi:include href="winfile/winfile.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="winver">
|
||||
<xi:include href="winver/winver.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="write">
|
||||
<xi:include href="write/write.rbuild" />
|
||||
</directory>
|
||||
</group>
|
||||
|
|
261
rosapps/applications/cmdutils/appwiz/appwiz.c
Normal file
261
rosapps/applications/cmdutils/appwiz/appwiz.c
Normal file
|
@ -0,0 +1,261 @@
|
|||
/*
|
||||
*
|
||||
* PROJECT: Add or Remove Programs (Console Version)
|
||||
* FILE: rosapps/applications/cmdutils/appwiz/appwiz.c
|
||||
* PURPOSE: ReactOS Software Control Panel
|
||||
* PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org)
|
||||
* UPDATE HISTORY:
|
||||
* 07-28-2008 Created
|
||||
*/
|
||||
|
||||
#define SHOW_ALL 1
|
||||
#define APP_ONLY 2
|
||||
#define UPD_ONLY 3
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <tchar.h>
|
||||
|
||||
|
||||
void PrintHelp()
|
||||
{
|
||||
printf(_T("Add or Remove Programs\n\
|
||||
APPWIZ [/? /l] [/all /app /upd]\n\
|
||||
/?\t Help\n\
|
||||
/l\t Show list\n\
|
||||
/all\t Show programs and updates\n\
|
||||
/app\t Show programs only\n\
|
||||
/upd\t Show updates only\n"));
|
||||
_getch();
|
||||
}
|
||||
|
||||
|
||||
void RunGUIAppWiz()
|
||||
{
|
||||
SHELLEXECUTEINFO shInputDll;
|
||||
|
||||
memset(&shInputDll, 0x0, sizeof(SHELLEXECUTEINFO));
|
||||
shInputDll.cbSize = sizeof(shInputDll);
|
||||
shInputDll.hwnd = NULL;
|
||||
shInputDll.lpVerb = _T("open");
|
||||
shInputDll.lpFile = _T("RunDll32.exe");
|
||||
shInputDll.lpParameters = _T("shell32.dll,Control_RunDLL appwiz.cpl");
|
||||
|
||||
if (ShellExecuteEx(&shInputDll) == 0)
|
||||
{
|
||||
MessageBox(NULL, _T("Can not start appwiz.cpl"), NULL, MB_OK | MB_ICONERROR);
|
||||
}
|
||||
}
|
||||
|
||||
void CallUninstall(LPTSTR szUninstallString)
|
||||
{
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
DWORD dwRet;
|
||||
MSG msg;
|
||||
|
||||
ZeroMemory(&si, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
si.wShowWindow = SW_SHOW;
|
||||
|
||||
if (CreateProcess(NULL, szUninstallString, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
|
||||
{
|
||||
CloseHandle(pi.hThread);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
dwRet = MsgWaitForMultipleObjects(1, &pi.hProcess, FALSE, INFINITE, QS_ALLEVENTS);
|
||||
if (dwRet == WAIT_OBJECT_0 + 1)
|
||||
{
|
||||
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
else if (dwRet == WAIT_OBJECT_0 || dwRet == WAIT_FAILED)
|
||||
break;
|
||||
}
|
||||
CloseHandle(pi.hProcess);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
dwMode:
|
||||
SHOW_ALL - Applications & Updates
|
||||
APP_ONLY - Applications only
|
||||
UPD_ONLY - Updates only
|
||||
*/
|
||||
int ShowAppList(DWORD dwMode, INT iItem)
|
||||
{
|
||||
HKEY hKey, hSubKey;
|
||||
DWORD dwSize, dwType, dwValue;
|
||||
TCHAR szName[MAX_PATH];
|
||||
TCHAR szParentKeyName[MAX_PATH];
|
||||
TCHAR szDisplayName[MAX_PATH];
|
||||
TCHAR szOutBuf[MAX_PATH];
|
||||
FILETIME FileTime;
|
||||
BOOL bIsUpdate = FALSE;
|
||||
BOOL bIsSystemComponent = FALSE;
|
||||
INT iIndex = 0, iColor = 0, iCount = 1;
|
||||
HANDLE hOutput;
|
||||
|
||||
if (RegOpenKey(HKEY_LOCAL_MACHINE,
|
||||
_T("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"),
|
||||
&hKey) != ERROR_SUCCESS)
|
||||
{
|
||||
printf(_T("ERROR: Can not open Uninstall key. Press any key for continue...\n"));
|
||||
_getch();
|
||||
return 0;
|
||||
}
|
||||
|
||||
hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
SetConsoleTextAttribute(hOutput, FOREGROUND_GREEN | FOREGROUND_INTENSITY);
|
||||
|
||||
dwSize = MAX_PATH;
|
||||
while (RegEnumKeyEx(hKey, iIndex, szName, &dwSize, NULL, NULL, NULL, &FileTime) == ERROR_SUCCESS)
|
||||
{
|
||||
if (RegOpenKey(hKey, szName, &hSubKey) == ERROR_SUCCESS)
|
||||
{
|
||||
dwType = REG_DWORD;
|
||||
dwSize = sizeof(DWORD);
|
||||
|
||||
if (RegQueryValueEx(hSubKey, _T("SystemComponent"),
|
||||
NULL, &dwType,
|
||||
(LPBYTE)&dwValue, &dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
bIsSystemComponent = (dwValue == 0x1);
|
||||
}
|
||||
else
|
||||
{
|
||||
bIsSystemComponent = FALSE;
|
||||
}
|
||||
|
||||
dwType = REG_SZ;
|
||||
dwSize = MAX_PATH;
|
||||
|
||||
bIsUpdate = (RegQueryValueEx(hSubKey, _T("ParentKeyName"),
|
||||
NULL, &dwType,
|
||||
(LPBYTE) szParentKeyName,
|
||||
&dwSize) == ERROR_SUCCESS);
|
||||
dwSize = MAX_PATH;
|
||||
if (RegQueryValueEx(hSubKey, _T("DisplayName"),
|
||||
NULL, &dwType,
|
||||
(LPBYTE) szDisplayName,
|
||||
&dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
if (!bIsSystemComponent)
|
||||
{
|
||||
if ((dwMode == SHOW_ALL) || ((dwMode == APP_ONLY) && (!bIsUpdate)) || ((dwMode == UPD_ONLY) && (bIsUpdate)))
|
||||
{
|
||||
if (iItem == -1)
|
||||
{
|
||||
wsprintf(szOutBuf, _T(" %d \t %s\n"), iCount, szDisplayName);
|
||||
CharToOem(szOutBuf, szOutBuf);
|
||||
printf("%s", szOutBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
dwType = REG_SZ;
|
||||
dwSize = MAX_PATH;
|
||||
|
||||
if ((RegQueryValueEx(hSubKey, _T("UninstallString"), NULL, &dwType,
|
||||
(LPBYTE) szOutBuf, &dwSize) == ERROR_SUCCESS) && (iItem == iCount))
|
||||
{
|
||||
CallUninstall(szOutBuf);
|
||||
}
|
||||
}
|
||||
iCount++;
|
||||
iColor++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (iColor <= 5)
|
||||
{
|
||||
SetConsoleTextAttribute(hOutput, FOREGROUND_GREEN | FOREGROUND_INTENSITY);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetConsoleTextAttribute(hOutput, FOREGROUND_GREEN | FOREGROUND_INTENSITY | FOREGROUND_RED);
|
||||
if (iColor >= 10) iColor = 0;
|
||||
}
|
||||
|
||||
dwSize = MAX_PATH;
|
||||
iIndex++;
|
||||
}
|
||||
|
||||
RegCloseKey(hSubKey);
|
||||
RegCloseKey(hKey);
|
||||
|
||||
SetConsoleTextAttribute(hOutput, FOREGROUND_GREEN | FOREGROUND_INTENSITY);
|
||||
printf("\n\nPlease enter application/update number and press ENTER for uninstall\nor press any key for Exit...\n");
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
INT iNumber;
|
||||
TCHAR Char[4 + 1];
|
||||
|
||||
SetConsoleTitle(_T("Application Wizard"));
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
RunGUIAppWiz();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (_tcsncmp(argv[1], _T("/?"), 2) == 0)
|
||||
{
|
||||
PrintHelp();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (_tcsncmp(argv[1], _T("/l"), 2) == 0)
|
||||
{
|
||||
if (argc < 3) goto ShowAll;
|
||||
if (_tcsncmp(argv[2], _T("/all"), 4) == 0)
|
||||
{
|
||||
ShowAll:
|
||||
if (ShowAppList(SHOW_ALL, -1) == 0) return 0;
|
||||
scanf(_T("%s"), Char);
|
||||
|
||||
iNumber = atoi(Char);
|
||||
|
||||
if (iNumber == 0) return 0;
|
||||
ShowAppList(SHOW_ALL, iNumber);
|
||||
}
|
||||
else if (_tcsncmp(argv[2], _T("/app"), 4) == 0)
|
||||
{
|
||||
if (ShowAppList(APP_ONLY, -1) == 0) return 0;
|
||||
|
||||
scanf(_T("%s"), Char);
|
||||
|
||||
iNumber = atoi(Char);
|
||||
|
||||
if (iNumber == 0) return 0;
|
||||
ShowAppList(APP_ONLY, iNumber);
|
||||
}
|
||||
else if (_tcsncmp(argv[2], _T("/upd"), 4) == 0)
|
||||
{
|
||||
if (ShowAppList(UPD_ONLY, -1) == 0) return 0;
|
||||
|
||||
scanf(_T("%s"), Char);
|
||||
|
||||
iNumber = atoi(Char);
|
||||
|
||||
if (iNumber == 0) return 0;
|
||||
ShowAppList(UPD_ONLY, iNumber);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
7
rosapps/applications/cmdutils/appwiz/appwiz.rbuild
Normal file
7
rosapps/applications/cmdutils/appwiz/appwiz.rbuild
Normal file
|
@ -0,0 +1,7 @@
|
|||
<module name="appwiz.exe" type="win32cui" installbase="system32" installname="appwiz.exe">
|
||||
<library>advapi32</library>
|
||||
<library>user32</library>
|
||||
<library>shell32</library>
|
||||
<file>appwiz.c</file>
|
||||
<file>appwiz.rc</file>
|
||||
</module>
|
4
rosapps/applications/cmdutils/appwiz/appwiz.rc
Normal file
4
rosapps/applications/cmdutils/appwiz/appwiz.rc
Normal file
|
@ -0,0 +1,4 @@
|
|||
#define REACTOS_STR_FILE_DESCRIPTION "Add or Remove Programs (Console Version)\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "appwiz\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "appwiz.exe\0"
|
||||
#include <reactos/version.rc>
|
|
@ -1,5 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<group xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<directory name="appwiz">
|
||||
<xi:include href="appwiz/appwiz.rbuild" />
|
||||
</directory>
|
||||
<directory name="comp">
|
||||
<xi:include href="comp/comp.rbuild" />
|
||||
</directory>
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
<module name="comp" type="win32cui" installbase="system32" installname="comp.exe" allowwarnings="true">
|
||||
<library>kernel32</library>
|
||||
<file>comp.c</file>
|
||||
<file>comp.rc</file>
|
||||
</module>
|
||||
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
<module name="mode" type="win32cui" installbase="system32" installname="mode.exe">
|
||||
<include base="mode">.</include>
|
||||
<include base="mode">.</include>
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>kernel32</library>
|
||||
<library>shell32</library>
|
||||
<library>user32</library>
|
||||
<file>mode.c</file>
|
||||
<file>mode.rc</file>
|
||||
</module>
|
|
@ -1,7 +1,4 @@
|
|||
<module name="sort" type="win32cui" installbase="system32" installname="sort.exe">
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>kernel32</library>
|
||||
<file>sort.c</file>
|
||||
<file>sort.rc</file>
|
||||
</module>
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
<module name="tee" type="win32cui" installbase="system32" installname="tee.exe">
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>kernel32</library>
|
||||
<file>tee.c</file>
|
||||
<file>tee.rc</file>
|
||||
</module>
|
||||
|
|
|
@ -44,7 +44,7 @@ char copyright[] =
|
|||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <time.h>
|
||||
|
||||
//#ifdef __STDC__
|
||||
//#error "__STDC__ defined"
|
||||
|
@ -146,9 +146,9 @@ main(int argc, char *argv[])
|
|||
if (stat(*argv, &sb)) {
|
||||
if (!cflag) {
|
||||
/* Create the file. */
|
||||
fd = open(*argv,
|
||||
fd = _open(*argv,
|
||||
O_WRONLY | O_CREAT, DEFFILEMODE);
|
||||
if (fd == -1 || fstat(fd, &sb) || close(fd)) {
|
||||
if (fd == -1 || fstat(fd, &sb) || _close(fd)) {
|
||||
rval = 1;
|
||||
warn("%s", *argv);
|
||||
continue;
|
||||
|
@ -300,37 +300,37 @@ rw(char *fname, struct stat *sbp, int force)
|
|||
}
|
||||
|
||||
needed_chmod = rval = 0;
|
||||
if ((fd = open(fname, O_RDWR, 0)) == -1) {
|
||||
if (!force || chmod(fname, DEFFILEMODE))
|
||||
if ((fd = _open(fname, O_RDWR, 0)) == -1) {
|
||||
if (!force || _chmod(fname, DEFFILEMODE))
|
||||
goto err;
|
||||
if ((fd = open(fname, O_RDWR, 0)) == -1)
|
||||
if ((fd = _open(fname, O_RDWR, 0)) == -1)
|
||||
goto err;
|
||||
needed_chmod = 1;
|
||||
}
|
||||
|
||||
if (sbp->st_size != 0) {
|
||||
if (read(fd, &byte, sizeof(byte)) != sizeof(byte))
|
||||
if (_read(fd, &byte, sizeof(byte)) != sizeof(byte))
|
||||
goto err;
|
||||
if (lseek(fd, (off_t)0, SEEK_SET) == -1)
|
||||
if (_lseek(fd, (off_t)0, SEEK_SET) == -1)
|
||||
goto err;
|
||||
if (write(fd, &byte, sizeof(byte)) != sizeof(byte))
|
||||
if (_write(fd, &byte, sizeof(byte)) != sizeof(byte))
|
||||
goto err;
|
||||
} else {
|
||||
if (write(fd, &byte, sizeof(byte)) != sizeof(byte)) {
|
||||
if (_write(fd, &byte, sizeof(byte)) != sizeof(byte)) {
|
||||
err: rval = 1;
|
||||
warn("%s", fname);
|
||||
/* } else if (ftruncate(fd, (off_t)0)) {*/
|
||||
} else if (chsize(fd, (off_t)0)) {
|
||||
} else if (_chsize(fd, (off_t)0)) {
|
||||
rval = 1;
|
||||
warn("%s: file modified", fname);
|
||||
}
|
||||
}
|
||||
|
||||
if (close(fd) && rval != 1) {
|
||||
if (_close(fd) && rval != 1) {
|
||||
rval = 1;
|
||||
warn("%s", fname);
|
||||
}
|
||||
if (needed_chmod && chmod(fname, sbp->st_mode) && rval != 1) {
|
||||
if (needed_chmod && _chmod(fname, sbp->st_mode) && rval != 1) {
|
||||
rval = 1;
|
||||
warn("%s: permissions modified", fname);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
<module name="touch" type="win32cui" installbase="system32" installname="touch.exe">
|
||||
<include base="touch">.</include>
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>ntdll</library>
|
||||
<library>kernel32</library>
|
||||
<file>err.c</file>
|
||||
<file>touch.c</file>
|
||||
<file>touch.rc</file>
|
||||
</module>
|
|
@ -1,8 +1,5 @@
|
|||
<module name="uptime" type="win32cui" installbase="system32" installname="uptime.exe" allowwarnings="true">
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<!-- <define name="LINUX_OUTPUT"></define> -->
|
||||
<library>kernel32</library>
|
||||
<file>uptime.c</file>
|
||||
<file>uptime.rc</file>
|
||||
</module>
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
<module name="y" type="win32cui" installbase="system32" installname="y.exe">
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>kernel32</library>
|
||||
<file>y.c</file>
|
||||
<file>y.rc</file>
|
||||
</module>
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "misc.h"
|
||||
#include "any_op.h"
|
||||
|
||||
|
||||
CPU_INT AnyalsingProcess()
|
||||
{
|
||||
/* FIXME it will set a name to the memory if we got one */
|
||||
|
||||
/* FIXME build the jump table */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1,261 +0,0 @@
|
|||
|
||||
#include <windows.h>
|
||||
#include <winnt.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "misc.h"
|
||||
#include "any_op.h"
|
||||
|
||||
/*
|
||||
* eax = register 3
|
||||
* edx = register 4
|
||||
* esp = register 1
|
||||
* ebp = register 31
|
||||
|
||||
* ecx = 8
|
||||
* ebx = 9
|
||||
* esi = 10
|
||||
* edi = 11
|
||||
* mmx/sse/fpu 0 = 12
|
||||
* mmx/sse/fpu 1 = 14
|
||||
* mmx/sse/fpu 2 = 16
|
||||
* mmx/sse/fpu 3 = 18
|
||||
* mmx/sse/fpu 4 = 20
|
||||
* mmx/sse/fpu 5 = 22
|
||||
* mmx/sse/fpu 6 = 24
|
||||
* mmx/sse/fpu 7 = 28
|
||||
*/
|
||||
|
||||
static void standardreg(CPU_INT *RegTableCount, CPU_INT reg, CPU_INT setup_ebp, FILE *outfp)
|
||||
{
|
||||
/* eax */
|
||||
if (reg == RegTableCount[3])
|
||||
{
|
||||
fprintf(outfp,"eax");
|
||||
}
|
||||
/* ebp */
|
||||
else if (reg == RegTableCount[31])
|
||||
{
|
||||
fprintf(outfp,"ebp");
|
||||
}
|
||||
/* edx */
|
||||
else if (reg == RegTableCount[4])
|
||||
{
|
||||
fprintf(outfp,"edx");
|
||||
}
|
||||
/* esp */
|
||||
else if (reg == RegTableCount[1])
|
||||
{
|
||||
fprintf(outfp,"esp");
|
||||
}
|
||||
/* ecx */
|
||||
else if (reg == RegTableCount[8])
|
||||
{
|
||||
fprintf(outfp,"ecx");
|
||||
}
|
||||
/* ebx */
|
||||
else if (reg == RegTableCount[9])
|
||||
{
|
||||
fprintf(outfp,"ebx");
|
||||
}
|
||||
/* esi */
|
||||
else if (reg == RegTableCount[10])
|
||||
{
|
||||
fprintf(outfp,"esi");
|
||||
}
|
||||
/* edi */
|
||||
else if (reg == RegTableCount[11])
|
||||
{
|
||||
fprintf(outfp,"edi");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (setup_ebp == 1)
|
||||
fprintf(outfp,"dword [ebx - %d]");
|
||||
else
|
||||
fprintf(outfp,"; unsuported should not happen it happen :(\n");
|
||||
}
|
||||
}
|
||||
|
||||
CPU_INT ConvertToIA32Process( FILE *outfp,
|
||||
PMYBrainAnalys pMystart,
|
||||
PMYBrainAnalys pMyend, CPU_INT regbits,
|
||||
CPU_INT HowManyRegInUse,
|
||||
CPU_INT *RegTableCount)
|
||||
{
|
||||
|
||||
CPU_INT stack = 0;
|
||||
CPU_UNINT tmp;
|
||||
CPU_INT setup_ebp = 0 ; /* 0 = no, 1 = yes */
|
||||
CPU_INT t=0;
|
||||
|
||||
/* Fixme optimze the RegTableCount table */
|
||||
|
||||
//if (HowManyRegInUse > 9)
|
||||
if (HowManyRegInUse > 8)
|
||||
{
|
||||
setup_ebp =1; /* we will use ebx as ebp */
|
||||
stack = HowManyRegInUse * regbits;
|
||||
}
|
||||
|
||||
if (RegTableCount[1]!=0)
|
||||
t++;
|
||||
if (RegTableCount[3]!=0)
|
||||
t++;
|
||||
if (RegTableCount[4]!=0)
|
||||
t++;
|
||||
if (RegTableCount[8]!=0)
|
||||
t++;
|
||||
if (RegTableCount[9]!=0)
|
||||
t++;
|
||||
if (RegTableCount[10]!=0)
|
||||
t++;
|
||||
if (RegTableCount[11]!=0)
|
||||
t++;
|
||||
if (RegTableCount[31]!=0)
|
||||
t++;
|
||||
|
||||
if (HowManyRegInUse != t)
|
||||
{
|
||||
/* fixme optimze the table or active the frame pointer */
|
||||
setup_ebp =1; /* we will use ebx as ebp */
|
||||
stack = HowManyRegInUse * regbits;
|
||||
}
|
||||
|
||||
fprintf(outfp,"BITS 32\n");
|
||||
fprintf(outfp,"GLOBAL _main\n");
|
||||
fprintf(outfp,"SECTION .text\n\n");
|
||||
fprintf(outfp,"; compile with nasm filename.asm -f win32, ld filename.obj -o filename.exe\n\n");
|
||||
fprintf(outfp,"_main:\n");
|
||||
|
||||
/* setup a frame pointer */
|
||||
|
||||
if (setup_ebp == 1)
|
||||
{
|
||||
fprintf(outfp,"\n; Setup frame pointer \n");
|
||||
fprintf(outfp,"push ebx\n");
|
||||
fprintf(outfp,"mov ebx,esp\n");
|
||||
fprintf(outfp,"sub esp, %d ; Alloc %d bytes for reg\n\n",stack,stack);
|
||||
}
|
||||
|
||||
|
||||
fprintf(outfp,"; Start the program \n");
|
||||
while (pMystart!=NULL)
|
||||
{
|
||||
/* fixme the line lookup from anaylysing process */
|
||||
|
||||
/* mov not full implement */
|
||||
if (pMystart->op == OP_ANY_mov)
|
||||
{
|
||||
printf("waring OP_ANY_mov are not full implement\n");
|
||||
|
||||
if ((pMystart->type & 8)== 8)
|
||||
{
|
||||
/* dst are register */
|
||||
tmp = stack - (pMystart->dst*regbits);
|
||||
|
||||
if ((pMystart->type & 2)== 2)
|
||||
{
|
||||
fprintf(outfp,"mov ");
|
||||
standardreg( RegTableCount,
|
||||
pMystart->dst,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp," , ");
|
||||
standardreg( RegTableCount,
|
||||
pMystart->src,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp,"\n");
|
||||
|
||||
}
|
||||
if ((pMystart->type & 16)== 16)
|
||||
{
|
||||
/* source are imm */
|
||||
if ((pMystart->src == 0) &&
|
||||
(setup_ebp == 0))
|
||||
{
|
||||
/* small optimze */
|
||||
fprintf(outfp,"xor ");
|
||||
standardreg( RegTableCount,
|
||||
pMystart->dst,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp,",");
|
||||
standardreg( RegTableCount,
|
||||
pMystart->dst,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp,"\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(outfp,"mov ");
|
||||
standardreg( RegTableCount,
|
||||
pMystart->dst,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp,",%llu\n",pMystart->src);
|
||||
}
|
||||
} /* end "source are imm" */
|
||||
} /* end pMyBrainAnalys->type & 8 */
|
||||
|
||||
if ((pMystart->type & 64)== 64)
|
||||
{
|
||||
if ((pMystart->type & 2)== 2)
|
||||
{
|
||||
/* dest [eax - 0x20], source reg */
|
||||
|
||||
fprintf(outfp,"mov dword [");
|
||||
standardreg( RegTableCount,
|
||||
pMystart->dst,
|
||||
setup_ebp, outfp);
|
||||
if (pMystart->dst_extra>=0)
|
||||
fprintf(outfp," +%d], ",pMystart->dst_extra);
|
||||
else
|
||||
fprintf(outfp," %d], ",pMystart->dst_extra);
|
||||
|
||||
standardreg( RegTableCount,
|
||||
pMystart->src,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp,"\n");
|
||||
|
||||
if ((pMystart->type & 128)== 128)
|
||||
{
|
||||
fprintf(outfp,"mov ");
|
||||
standardreg( RegTableCount,
|
||||
pMystart->src,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp," , ");
|
||||
standardreg( RegTableCount,
|
||||
pMystart->dst,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp," %d\n",pMystart->dst_extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* return */
|
||||
if (pMystart->op == OP_ANY_ret)
|
||||
{
|
||||
if (pMyBrainAnalys->ptr_next == NULL)
|
||||
{
|
||||
if (setup_ebp == 1)
|
||||
{
|
||||
fprintf(outfp,"\n; clean up after the frame \n");
|
||||
fprintf(outfp,"mov esp, ebx\n");
|
||||
fprintf(outfp,"pop ebx\n");
|
||||
}
|
||||
}
|
||||
fprintf(outfp,"ret\n");
|
||||
}
|
||||
if (pMystart == pMyend)
|
||||
pMystart=NULL;
|
||||
else
|
||||
pMystart = (PMYBrainAnalys) pMystart->ptr_next;
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -1,180 +0,0 @@
|
|||
|
||||
#include <windows.h>
|
||||
#include <winnt.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "misc.h"
|
||||
#include "any_op.h"
|
||||
|
||||
static void standardreg(CPU_INT *RegTableCount, CPU_UNINT reg,
|
||||
CPU_INT setup_ebp, FILE *outfp)
|
||||
{
|
||||
CPU_INT t, found = 0;
|
||||
for (t=0;t<31;t++)
|
||||
{
|
||||
if (reg == RegTableCount[t])
|
||||
{
|
||||
fprintf(outfp,"r%d",t);
|
||||
found++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found == 0)
|
||||
{
|
||||
fprintf(outfp,"r%d",reg);
|
||||
}
|
||||
}
|
||||
|
||||
CPU_INT ConvertToPPCProcess( FILE *outfp,
|
||||
PMYBrainAnalys pMystart,
|
||||
PMYBrainAnalys pMyend, CPU_INT regbits,
|
||||
CPU_INT HowManyRegInUse,
|
||||
CPU_INT *RegTableCount)
|
||||
{
|
||||
|
||||
CPU_INT stack = 0;
|
||||
//CPU_UNINT tmp;
|
||||
CPU_INT setup_ebp = 0 ; /* 0 = no, 1 = yes */
|
||||
CPU_INT t=0;
|
||||
|
||||
if (HowManyRegInUse > 31)
|
||||
{
|
||||
setup_ebp =1; /* we will use ebx as ebp */
|
||||
stack = HowManyRegInUse * regbits;
|
||||
}
|
||||
|
||||
if (RegTableCount[1]!=0)
|
||||
t++;
|
||||
if (RegTableCount[3]!=0)
|
||||
t++;
|
||||
if (RegTableCount[4]!=0)
|
||||
t++;
|
||||
if (RegTableCount[8]!=0)
|
||||
t++;
|
||||
if (RegTableCount[9]!=0)
|
||||
t++;
|
||||
if (RegTableCount[10]!=0)
|
||||
t++;
|
||||
if (RegTableCount[11]!=0)
|
||||
t++;
|
||||
if (RegTableCount[31]!=0)
|
||||
t++;
|
||||
|
||||
if (HowManyRegInUse != t)
|
||||
{
|
||||
/* fixme optimze the table or active the frame pointer */
|
||||
setup_ebp =1; /* we will use ebx as ebp */
|
||||
stack = HowManyRegInUse * regbits;
|
||||
}
|
||||
|
||||
|
||||
/* fixme gas compatible
|
||||
fprintf(outfp,"BITS 32\n");
|
||||
fprintf(outfp,"GLOBAL _main\n");
|
||||
fprintf(outfp,"SECTION .text\n\n");
|
||||
fprintf(outfp,"; compile with nasm filename.asm -f win32, ld filename.obj -o filename.exe\n\n");
|
||||
fprintf(outfp,"_main:\n");
|
||||
*/
|
||||
|
||||
/* setup a frame pointer */
|
||||
if (setup_ebp == 1)
|
||||
{
|
||||
/* fixme ppc frame pointer */
|
||||
// fprintf(outfp,"\n; Setup frame pointer \n");
|
||||
}
|
||||
|
||||
fprintf(outfp,"; Start the program \n");
|
||||
while (pMystart!=NULL)
|
||||
{
|
||||
/* fixme the line lookup from anaylysing process */
|
||||
|
||||
/* mov not full implement */
|
||||
if (pMystart->op == OP_ANY_mov)
|
||||
{
|
||||
printf("waring OP_ANY_mov are not full implement\n");
|
||||
|
||||
if ((pMystart->type & 8)== 8)
|
||||
{
|
||||
/* dst are register */
|
||||
// FIXME frame pointer setup
|
||||
// tmp = stack - (pMystart->dst*regbits);
|
||||
|
||||
if ((pMystart->type & 2)== 2)
|
||||
{
|
||||
fprintf(outfp,"mr ");
|
||||
standardreg( RegTableCount,
|
||||
pMystart->dst,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp,",");
|
||||
standardreg( RegTableCount,
|
||||
pMystart->src,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp,"\n");
|
||||
}
|
||||
|
||||
if ((pMystart->type & 16)== 16)
|
||||
{
|
||||
/* source are imm */
|
||||
if (setup_ebp == 1)
|
||||
fprintf(outfp,"not supporet\n");
|
||||
else
|
||||
{
|
||||
fprintf(outfp,"li ");
|
||||
standardreg( RegTableCount,
|
||||
pMystart->dst,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp," , %llu\n",pMystart->src);
|
||||
}
|
||||
}
|
||||
} /* end pMyBrainAnalys->type & 8 */
|
||||
|
||||
if ((pMystart->type & 64)== 64)
|
||||
{
|
||||
if ((pMystart->type & 2)== 2)
|
||||
{
|
||||
/* dest [eax - 0x20], source reg */
|
||||
if ((pMystart->type & 128)== 128)
|
||||
{
|
||||
fprintf(outfp,"stwu ");
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(outfp,"stw ");
|
||||
}
|
||||
|
||||
standardreg( RegTableCount,
|
||||
pMystart->src,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp,", %d(",pMystart->dst_extra);
|
||||
|
||||
standardreg( RegTableCount,
|
||||
pMystart->dst,
|
||||
setup_ebp, outfp);
|
||||
fprintf(outfp,")\n");
|
||||
}
|
||||
} /* end pMyBrainAnalys->type & 64 */
|
||||
}
|
||||
|
||||
/* return */
|
||||
if (pMystart->op == OP_ANY_ret)
|
||||
{
|
||||
if (pMyBrainAnalys->ptr_next == NULL)
|
||||
{
|
||||
if (setup_ebp == 1)
|
||||
{
|
||||
// FIXME end our own frame pointer
|
||||
fprintf(outfp,"\n; clean up after the frame \n");
|
||||
}
|
||||
}
|
||||
fprintf(outfp,"blr\n");
|
||||
}
|
||||
if (pMystart == pMyend)
|
||||
pMystart=NULL;
|
||||
else
|
||||
pMystart = (PMYBrainAnalys) pMystart->ptr_next;
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
#include <windows.h>
|
||||
#include <winnt.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "misc.h"
|
||||
#include "any_op.h"
|
||||
|
||||
/* hack should be in misc.h*/
|
||||
|
||||
|
||||
CPU_INT ConvertProcess(FILE *outfp, CPU_INT FromCpuid, CPU_INT ToCpuid)
|
||||
{
|
||||
CPU_INT ret=0;
|
||||
CPU_INT regbits=-1;
|
||||
CPU_INT HowManyRegInUse = 0;
|
||||
CPU_INT RegTableCount[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
CPU_INT t;
|
||||
PMYBrainAnalys pMystart = pStartMyBrainAnalys;
|
||||
PMYBrainAnalys pMyend = pMyBrainAnalys;
|
||||
|
||||
PMYBrainAnalys ptmpMystart = pStartMyBrainAnalys;
|
||||
PMYBrainAnalys ptmpMyend = pMyBrainAnalys;
|
||||
|
||||
if ( (FromCpuid == IMAGE_FILE_MACHINE_POWERPC) ||
|
||||
(FromCpuid == IMAGE_FILE_MACHINE_I386))
|
||||
{
|
||||
regbits = 32 / 8;
|
||||
}
|
||||
|
||||
/* FIXME calc where todo first split */
|
||||
|
||||
/* count how many register we got */
|
||||
ptmpMystart = pMystart;
|
||||
ptmpMyend = pMyend;
|
||||
while (ptmpMystart!=NULL)
|
||||
{
|
||||
if ((ptmpMystart->type & 2) == 2)
|
||||
RegTableCount[ptmpMystart->src]++;
|
||||
|
||||
if ((ptmpMystart->type & 8) == 8)
|
||||
RegTableCount[ptmpMystart->dst]++;
|
||||
|
||||
if ((ptmpMystart->type & 32) == 32)
|
||||
RegTableCount[ptmpMystart->src]++;
|
||||
|
||||
if ((ptmpMystart->type & 64) == 64)
|
||||
RegTableCount[ptmpMystart->dst]++;
|
||||
|
||||
if (ptmpMystart == ptmpMyend)
|
||||
ptmpMystart=NULL;
|
||||
else
|
||||
ptmpMystart = (PMYBrainAnalys) ptmpMystart->ptr_next;
|
||||
}
|
||||
|
||||
for (t=0;t<=31;t++)
|
||||
{
|
||||
if (RegTableCount[t]!=0)
|
||||
{
|
||||
HowManyRegInUse++;
|
||||
RegTableCount[t]=t;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* switch to the acual converting now */
|
||||
switch (ToCpuid)
|
||||
{
|
||||
case IMAGE_FILE_MACHINE_I386:
|
||||
ret = ConvertToIA32Process( outfp, pMystart,
|
||||
pMyend, regbits,
|
||||
HowManyRegInUse,
|
||||
RegTableCount);
|
||||
if (ret !=0)
|
||||
{
|
||||
printf("should not happen contact a devloper, x86 fail\n");
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
case IMAGE_FILE_MACHINE_POWERPC:
|
||||
ret = ConvertToPPCProcess( outfp, pMystart,
|
||||
pMyend, regbits,
|
||||
HowManyRegInUse,
|
||||
RegTableCount);
|
||||
if (ret !=0)
|
||||
{
|
||||
printf("should not happen contact a devloper, x86 fail\n");
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("should not happen contact a devloper, unknown fail\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "misc.h"
|
||||
#include "any_op.h"
|
||||
|
||||
PMYBrainAnalys pMyBrainAnalys = NULL;
|
||||
PMYBrainAnalys pStartMyBrainAnalys = NULL;
|
||||
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
//CPU_UNINT BaseAddress=0;
|
||||
//int t=0;
|
||||
//char *infile=NULL;
|
||||
//char *outfile=NULL;
|
||||
//char *cpuid=NULL;
|
||||
//CPU_INT type=0;
|
||||
//CPU_INT mode = 1;
|
||||
|
||||
|
||||
//printf("Usage :\n");
|
||||
//printf(" need for -inbin and autodetect if it does not found a PE header \n");
|
||||
//printf(" -cpu m68000 : convert motorala 68000/68008 to intel asm \n");
|
||||
//printf(" -cpu m68010 : convert motorala 68010 to intel asm \n");
|
||||
//printf(" -cpu m68020 : convert motorala 68020 to intel asm \n");
|
||||
//printf(" -cpu m68030 : convert motorala 68030 to intel asm \n");
|
||||
//printf(" -cpu m68040 : convert motorala 68040 to intel asm \n");
|
||||
//printf(" -cpu ppc : convert PowerPC to intel asm \n");
|
||||
//printf(" -cpu ARM4 : convert ARM4 to intel asm \n");
|
||||
//printf("------------------------------------------------------------------\n");
|
||||
//printf(" for -inbin and autodetect if it does not found a PE header or do\n");
|
||||
//printf(" not set at all, this options are free to use \n");
|
||||
//printf(".......-BaseAddress adr : the start base address only accpect \n");
|
||||
//printf("....... dec value");
|
||||
//printf("------------------------------------------------------------------\n");
|
||||
//printf(" -in filename : try autodetect file type for you");
|
||||
//printf(" whant convert\n");
|
||||
//printf(" -inBin filename : the bin file you whant convert\n");
|
||||
//printf(" -inExe filename : the PE file you whant convert\n");
|
||||
//printf(" -OutAsm filename : the Asm file you whant create\n");
|
||||
//printf(" -OutDis filename : Do disambler of the source file\n");
|
||||
//printf("------------------------------------------------------------------\n");
|
||||
//printf("More cpu will be added with the time or options, this is \n");
|
||||
//printf("version 0.0.1 of the cpu to intel converter writen by \n");
|
||||
//printf("Magnus Olsen (magnus@greatlord.com), it does not do anything \n");
|
||||
//printf("yet, more that basic desgin how it should be writen. \n");
|
||||
//printf("Copyright 2006 by Magnus Olsen, licen under GPL 2.0 for now. \n");
|
||||
|
||||
|
||||
//if (argc <4)
|
||||
// return 110;
|
||||
|
||||
///* fixme better error checking for the input param */
|
||||
//for (t=1; t<argc;t+=2)
|
||||
//{
|
||||
// if (stricmp(argv[t],"-in"))
|
||||
// {
|
||||
// infile = argv[t+1];
|
||||
// type=0;
|
||||
// }
|
||||
|
||||
// if (stricmp(argv[t],"-inBin"))
|
||||
// {
|
||||
// infile = argv[t+1];
|
||||
// type=1;
|
||||
// }
|
||||
|
||||
// if (stricmp(argv[t],"-inExe"))
|
||||
// {
|
||||
// infile = argv[t+1];
|
||||
// type=1;
|
||||
// }
|
||||
|
||||
// if (stricmp(argv[t],"-OutAsm"))
|
||||
// {
|
||||
// outfile = argv[t+1];
|
||||
// }
|
||||
// if (stricmp(argv[t],"-OutDis"))
|
||||
// {
|
||||
// outfile = argv[t+1];
|
||||
// mode = 0;
|
||||
// }
|
||||
// if (stricmp(argv[t],"-BaseAddress"))
|
||||
// {
|
||||
// BaseAddress = atol(argv[t+1]);
|
||||
// }
|
||||
// if (stricmp(argv[t],"-cpu"))
|
||||
// {
|
||||
// cpuid = argv[t+1];
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
// mode 0 disambler
|
||||
// mode 1 convert to intel
|
||||
// mode 2 convert to ppc
|
||||
//return LoadPFileImage(infile,outfile,BaseAddress,cpuid,type, mode);
|
||||
//LoadPFileImage("e:\\testppc.exe","e:\\cputointel.asm",0,0,0,1);
|
||||
LoadPFileImage("e:\\testppc.exe","e:\\cputointel.asm",0,0,0,1);
|
||||
//pMyBrainAnalys = NULL;
|
||||
//pStartMyBrainAnalys = NULL;
|
||||
//LoadPFileImage("e:\\testppc.exe","e:\\cputoppc.asm",0,0,0,2);
|
||||
|
||||
// return LoadPFileImage("e:\\testms.exe","e:\\cputointel.asm",0,0,0,1); // convert
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
|
||||
#include "../../misc.h"
|
||||
|
||||
CPU_INT ARMBrain( CPU_BYTE *cpu_buffer,
|
||||
CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size,
|
||||
CPU_UNINT BaseAddress,
|
||||
CPU_UNINT cpuarch,
|
||||
FILE *outfp);
|
||||
|
||||
/* here we put the prototype for the opcode api that brain need we show a example for it */
|
||||
CPU_INT ARM_(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
|
||||
|
||||
/* Export comment thing see m68k for example
|
||||
* in dummy we do not show it, for it is diffent for each cpu
|
||||
*/
|
|
@ -1,98 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "ARMBrain.h"
|
||||
#include "ARM.h"
|
||||
#include "../../misc.h"
|
||||
|
||||
/*
|
||||
* DummyBrain is example how you create you own cpu brain to translate from
|
||||
* cpu to intel assembler, I have not add DummyBrain to the loader it is not
|
||||
* need it in our example. When you write you own brain, it must be setup in
|
||||
* misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not
|
||||
* need the brain you have writen so you do not need setup it there then.
|
||||
*
|
||||
* input param:
|
||||
* cpu_buffer : the memory buffer with loaded program we whant translate
|
||||
* cpu_pos : the positions in the cpu_buffer
|
||||
* cpu_size : the alloced memory size of the cpu_buffer
|
||||
* BaseAddress : the virtual memory address we setup to use.
|
||||
* cpuarch : the sub arch for the brain, example if it exists more one
|
||||
* cpu with same desgin but few other opcode or extend opcode
|
||||
* outfp : the output file pointer
|
||||
*
|
||||
* mode : if we should run disambler of this binary or
|
||||
* translate it, Disambler will not calc the
|
||||
* the row name right so we simple give each
|
||||
row a name. In translations mode we run a
|
||||
* analys so we getting better optimzing and
|
||||
* only row name there we need.
|
||||
* value for mode are :
|
||||
* 0 = disambler mode
|
||||
* 1 = translate mode intel
|
||||
*
|
||||
* return value
|
||||
* 0 : Ok
|
||||
* 1 : unimplemt
|
||||
* 2 : Unkonwn Opcode
|
||||
* 3 : unimplement cpu
|
||||
* 4 : unknown machine
|
||||
*/
|
||||
|
||||
CPU_INT ARMBrain( CPU_BYTE *cpu_buffer,
|
||||
CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size,
|
||||
CPU_UNINT BaseAddress,
|
||||
CPU_UNINT cpuarch,
|
||||
FILE *outfp)
|
||||
{
|
||||
CPU_UNINT cpu_oldpos;
|
||||
CPU_INT cpuint;
|
||||
CPU_INT retcode = 0;
|
||||
CPU_INT retsize;
|
||||
|
||||
|
||||
/* now we start the process */
|
||||
while (cpu_pos<cpu_size)
|
||||
{
|
||||
cpu_oldpos = cpu_pos;
|
||||
|
||||
cpuint = cpu_buffer[cpu_pos];
|
||||
|
||||
/* Add */
|
||||
if ((cpuint - (cpuint & GetMaskByte32(cpuARMInit_))) == ConvertBitToByte32(cpuARMInit_))
|
||||
{
|
||||
retsize = ARM_( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Found all Opcode and breakout and return no error found */
|
||||
if (cpu_pos >=cpu_size)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check if we have found a cpu opcode */
|
||||
if (cpu_oldpos == cpu_pos)
|
||||
{
|
||||
if (retcode == 0)
|
||||
{
|
||||
/* no unimplement error where found so we return a msg for unknown opcode */
|
||||
printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]);
|
||||
retcode = 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* Erorro Found ? */
|
||||
if (retcode!=0)
|
||||
{
|
||||
/* Erorro Found break and return the error code */
|
||||
break;
|
||||
}
|
||||
}
|
||||
return retcode;
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
#include "../../misc.h"
|
||||
|
||||
|
||||
/* example how setup a opcode, this opcode is 16bit long (taken from M68K)
|
||||
* 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent
|
||||
* thing in the opcode, example which reg so on, it can be etither 0 or 1 in
|
||||
* the opcode. but a opcode have also normal bit that is always been set to
|
||||
* same. thuse bit are always 0 or 1
|
||||
*/
|
||||
CPU_BYTE cpuARMInit_[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2};
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "../../misc.h"
|
||||
|
||||
|
||||
/* cpuDummyInit_Add
|
||||
* Input param :
|
||||
* out : The file pointer that we write to (the output file to intel asm)
|
||||
* cpu_buffer : The memory buffer we have our binary code that we whant convert
|
||||
* cpu_pos : Current positions in the cpu_buffer
|
||||
* cpu_size : The memory size of the cpu_buffer
|
||||
* BaseAddress : The base address you whant the binay file should run from
|
||||
* cpuarch : if it exists diffent cpu from a manufactor like pentium,
|
||||
* pentinum-mmx so on, use this flag to specify which type
|
||||
* of cpu you whant or do not use it if it does not exists
|
||||
* other or any sub model.
|
||||
*
|
||||
* mode : if we should run disambler of this binary or
|
||||
* translate it, Disambler will not calc the
|
||||
* the row name right so we simple give each
|
||||
row a name. In translations mode we run a
|
||||
* analys so we getting better optimzing and
|
||||
* only row name there we need.
|
||||
* value for mode are :
|
||||
* 0 = disambler mode
|
||||
* 1 = translate mode intel
|
||||
|
||||
*
|
||||
* Return value :
|
||||
* value -1 : unimplement
|
||||
* value 0 : wrong opcode or not vaild opcode
|
||||
* value +1 and higher : who many byte we should add to cpu_pos
|
||||
*/
|
||||
|
||||
CPU_INT ARM_( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
|
||||
{
|
||||
/*
|
||||
* ConvertBitToByte() is perfect to use to get the bit being in use from a bit array
|
||||
* GetMaskByte() is perfect if u whant known which bit have been mask out
|
||||
* see M68kopcode.c and how it use the ConvertBitToByte()
|
||||
*/
|
||||
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Add unimplement\n");
|
||||
return -1;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
|
||||
#include "../../misc.h"
|
||||
|
||||
CPU_INT IA32Brain( CPU_BYTE *cpu_buffer,
|
||||
CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size,
|
||||
CPU_UNINT BaseAddress,
|
||||
CPU_UNINT cpuarch,
|
||||
FILE *outfp);
|
||||
|
||||
/* here we put the prototype for the opcode api that brain need we show a example for it */
|
||||
CPU_INT IA32_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
|
||||
|
||||
/* Export comment thing see m68k for example
|
||||
* in dummy we do not show it, for it is diffent for each cpu
|
||||
*/
|
|
@ -1,107 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "IA32Brain.h"
|
||||
#include "IA32.h"
|
||||
#include "../../any_op.h"
|
||||
#include "../../misc.h"
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* DummyBrain is example how you create you own cpu brain to translate from
|
||||
* cpu to intel assembler, I have not add DummyBrain to the loader it is not
|
||||
* need it in our example. When you write you own brain, it must be setup in
|
||||
* misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not
|
||||
* need the brain you have writen so you do not need setup it there then.
|
||||
*
|
||||
* input param:
|
||||
* cpu_buffer : the memory buffer with loaded program we whant translate
|
||||
* cpu_pos : the positions in the cpu_buffer
|
||||
* cpu_size : the alloced memory size of the cpu_buffer
|
||||
* BaseAddress : the virtual memory address we setup to use.
|
||||
* cpuarch : the sub arch for the brain, example if it exists more one
|
||||
* cpu with same desgin but few other opcode or extend opcode
|
||||
* outfp : the output file pointer
|
||||
*
|
||||
* mode : if we should run disambler of this binary or
|
||||
* translate it, Disambler will not calc the
|
||||
* the row name right so we simple give each
|
||||
row a name. In translations mode we run a
|
||||
* analys so we getting better optimzing and
|
||||
* only row name there we need.
|
||||
* value for mode are :
|
||||
* 0 = disambler mode
|
||||
* 1 = translate mode intel
|
||||
*
|
||||
* return value
|
||||
* 0 : Ok
|
||||
* 1 : unimplemt
|
||||
* 2 : Unkonwn Opcode
|
||||
* 3 : unimplement cpu
|
||||
* 4 : unknown machine
|
||||
*/
|
||||
|
||||
CPU_INT IA32Brain( CPU_BYTE *cpu_buffer,
|
||||
CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size,
|
||||
CPU_UNINT BaseAddress,
|
||||
CPU_UNINT cpuarch,
|
||||
FILE *outfp)
|
||||
{
|
||||
CPU_UNINT cpu_oldpos;
|
||||
CPU_INT cpuint;
|
||||
CPU_INT retcode = 0;
|
||||
CPU_INT retsize;
|
||||
|
||||
/* now we start the process */
|
||||
while (cpu_pos<cpu_size)
|
||||
{
|
||||
cpu_oldpos = cpu_pos;
|
||||
|
||||
/* use the GetData32Be or GetData32Le
|
||||
to read from the memory the
|
||||
Le is for small endian and the
|
||||
Be is for big endian
|
||||
the 32 is how many bits we should read
|
||||
*/
|
||||
cpuint = GetData32Be(&cpu_buffer[cpu_pos]);
|
||||
|
||||
/* Add */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuIA32Init_Add))) == ConvertBitToByte(cpuIA32Init_Add))
|
||||
{
|
||||
retsize = IA32_Add( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Found all Opcode and breakout and return no error found */
|
||||
if (cpu_pos >=cpu_size)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check if we have found a cpu opcode */
|
||||
if (cpu_oldpos == cpu_pos)
|
||||
{
|
||||
if (retcode == 0)
|
||||
{
|
||||
/* no unimplement error where found so we return a msg for unknown opcode */
|
||||
printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]);
|
||||
retcode = 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* Erorro Found ? */
|
||||
if (retcode!=0)
|
||||
{
|
||||
/* Erorro Found break and return the error code */
|
||||
break;
|
||||
}
|
||||
}
|
||||
return retcode;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
|
||||
|
||||
#include "../../misc.h"
|
||||
|
||||
|
||||
/* example how setup a opcode, this opcode is 16bit long (taken from M68K)
|
||||
* 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent
|
||||
* thing in the opcode, example which reg so on, it can be etither 0 or 1 in
|
||||
* the opcode. but a opcode have also normal bit that is always been set to
|
||||
* same. thuse bit are always 0 or 1
|
||||
*/
|
||||
CPU_BYTE cpuIA32Init_Add[16] = {1,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2};
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "IA32.h"
|
||||
#include "../../misc.h"
|
||||
|
||||
|
||||
/* cpuDummyInit_Add
|
||||
* Input param :
|
||||
* out : The file pointer that we write to (the output file to intel asm)
|
||||
* cpu_buffer : The memory buffer we have our binary code that we whant convert
|
||||
* cpu_pos : Current positions in the cpu_buffer
|
||||
* cpu_size : The memory size of the cpu_buffer
|
||||
* BaseAddress : The base address you whant the binay file should run from
|
||||
* cpuarch : if it exists diffent cpu from a manufactor like pentium,
|
||||
* pentinum-mmx so on, use this flag to specify which type
|
||||
* of cpu you whant or do not use it if it does not exists
|
||||
* other or any sub model.
|
||||
*
|
||||
* mode : if we should run disambler of this binary or
|
||||
* translate it, Disambler will not calc the
|
||||
* the row name right so we simple give each
|
||||
row a name. In translations mode we run a
|
||||
* analys so we getting better optimzing and
|
||||
* only row name there we need.
|
||||
* value for mode are :
|
||||
* 0 = disambler mode
|
||||
* 1 = translate mode intel
|
||||
*
|
||||
* Return value :
|
||||
* value -1 : unimplement
|
||||
* value 0 : wrong opcode or not vaild opcode
|
||||
* value +1 and higher : who many byte we should add to cpu_pos
|
||||
*/
|
||||
|
||||
CPU_INT IA32_Add( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
|
||||
{
|
||||
/*
|
||||
* ConvertBitToByte() is perfect to use to get the bit being in use from a bit array
|
||||
* GetMaskByte() is perfect if u whant known which bit have been mask out
|
||||
* see M68kopcode.c and how it use the ConvertBitToByte()
|
||||
*/
|
||||
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Add unimplement\n");
|
||||
return -1;
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
|
||||
#include "../../misc.h"
|
||||
|
||||
CPU_INT PPCBrain( CPU_BYTE *cpu_buffer,
|
||||
CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size,
|
||||
CPU_UNINT BaseAddress,
|
||||
CPU_UNINT cpuarch,
|
||||
FILE *outfp);
|
||||
|
||||
|
||||
/* here we put the prototype for the opcode api that brain need we show a example for it */
|
||||
CPU_INT PPC_Blr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT PPC_Li( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT PPC_mr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT PPC_Stw( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT PPC_Stwu( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
|
||||
/* Export comment thing see m68k for example
|
||||
* in dummy we do not show it, for it is diffent for each cpu
|
||||
*/
|
||||
|
||||
|
|
@ -1,143 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PPCBrain.h"
|
||||
#include "PPC.h"
|
||||
#include "../../misc.h"
|
||||
|
||||
/*
|
||||
* DummyBrain is example how you create you own cpu brain to translate from
|
||||
* cpu to intel assembler, I have not add DummyBrain to the loader it is not
|
||||
* need it in our example. When you write you own brain, it must be setup in
|
||||
* misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not
|
||||
* need the brain you have writen so you do not need setup it there then.
|
||||
*
|
||||
* input param:
|
||||
* cpu_buffer : the memory buffer with loaded program we whant translate
|
||||
* cpu_pos : the positions in the cpu_buffer
|
||||
* cpu_size : the alloced memory size of the cpu_buffer
|
||||
* BaseAddress : the virtual memory address we setup to use.
|
||||
* cpuarch : the sub arch for the brain, example if it exists more one
|
||||
* cpu with same desgin but few other opcode or extend opcode
|
||||
* outfp : the output file pointer
|
||||
*
|
||||
* mode : if we should run disambler of this binary or
|
||||
* translate it, Disambler will not calc the
|
||||
* the row name right so we simple give each
|
||||
row a name. In translations mode we run a
|
||||
* analys so we getting better optimzing and
|
||||
* only row name there we need.
|
||||
* value for mode are :
|
||||
* 0 = disambler mode
|
||||
* 1 = translate mode intel
|
||||
*
|
||||
* return value
|
||||
* 0 : Ok
|
||||
* 1 : unimplemt
|
||||
* 2 : Unkonwn Opcode
|
||||
* 3 : unimplement cpu
|
||||
* 4 : unknown machine
|
||||
*/
|
||||
|
||||
CPU_INT PPCBrain( CPU_BYTE *cpu_buffer,
|
||||
CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size,
|
||||
CPU_UNINT BaseAddress,
|
||||
CPU_UNINT cpuarch,
|
||||
FILE *outfp)
|
||||
{
|
||||
CPU_UNINT cpu_oldpos;
|
||||
CPU_INT cpuint;
|
||||
CPU_INT retcode = 0;
|
||||
CPU_INT retsize;
|
||||
|
||||
/* now we start the process */
|
||||
while (cpu_pos<cpu_size)
|
||||
{
|
||||
cpu_oldpos = cpu_pos;
|
||||
|
||||
cpuint = GetData32Le(&cpu_buffer[cpu_pos]);
|
||||
|
||||
/* blr */
|
||||
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_Blr))) == ConvertBitToByte32(cpuPPCInit_Blr))
|
||||
{
|
||||
retsize = PPC_Blr( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Li*/
|
||||
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_Li))) == ConvertBitToByte32(cpuPPCInit_Li))
|
||||
{
|
||||
retsize = PPC_Li( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* mr */
|
||||
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_mr))) == ConvertBitToByte32(cpuPPCInit_mr))
|
||||
{
|
||||
retsize = PPC_mr( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* stw */
|
||||
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_stw))) == ConvertBitToByte32(cpuPPCInit_stw))
|
||||
{
|
||||
retsize = PPC_Stw( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* stwu */
|
||||
if ((cpuint - (cpuint & GetMaskByte32(cpuPPCInit_stwu))) == ConvertBitToByte32(cpuPPCInit_stwu))
|
||||
{
|
||||
retsize = PPC_Stwu( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Found all Opcode and breakout and return no error found */
|
||||
if (cpu_pos >=cpu_size)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check if we have found a cpu opcode */
|
||||
if (cpu_oldpos == cpu_pos)
|
||||
{
|
||||
if (retcode == 0)
|
||||
{
|
||||
/* no unimplement error where found so we return a msg for unknown opcode */
|
||||
printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]);
|
||||
retcode = 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* Erorro Found ? */
|
||||
if (retcode!=0)
|
||||
{
|
||||
/* Erorro Found break and return the error code */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0; // hack getting dismabler working or converting working
|
||||
return retcode;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
|
||||
#include "../../misc.h"
|
||||
|
||||
|
||||
/* example how setup a opcode, this opcode is 16bit long (taken from M68K)
|
||||
* 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent
|
||||
* thing in the opcode, example which reg so on, it can be etither 0 or 1 in
|
||||
* the opcode. but a opcode have also normal bit that is always been set to
|
||||
* same. thuse bit are always 0 or 1
|
||||
*/
|
||||
|
||||
/* FIXME RA should be 0 in stwu */
|
||||
CPU_BYTE cpuPPCInit_Blr[32] = {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 0,1,0,0,1,1, 1,0};
|
||||
/* addi */
|
||||
CPU_BYTE cpuPPCInit_Li[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,0, 0,0,1,1,1,0, 2,2};
|
||||
CPU_BYTE cpuPPCInit_stw[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 1,0,0,1,0,0, 2,2};
|
||||
CPU_BYTE cpuPPCInit_stwu[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 1,0,0,1,0,1, 2,2};
|
||||
CPU_BYTE cpuPPCInit_mr[32] = {0,1,1,1,1,0,0,0,0,0,0,0,1,0,1,1,2,2,2,2,2,2,2,2, 0,1,1,1,1,1, 2,2};
|
||||
CPU_BYTE cpuPPCInit_lwz[32] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 1,0,0,0,0,0, 2,2};
|
||||
|
||||
|
||||
|
||||
/* mask */
|
||||
/*
|
||||
* no mask we implement function getting the reg right
|
||||
*/
|
||||
|
||||
/* bit index
|
||||
3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
|
||||
1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
|
||||
*/
|
||||
|
|
@ -1,192 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "PPC.h"
|
||||
#include "../../misc.h"
|
||||
#include "../../any_op.h"
|
||||
|
||||
/* reg r0-r31
|
||||
r3 = eax
|
||||
*/
|
||||
|
||||
/* cpuDummyInit_Add
|
||||
* Input param :
|
||||
* out : The file pointer that we write to (the output file to intel asm)
|
||||
* cpu_buffer : The memory buffer we have our binary code that we whant convert
|
||||
* cpu_pos : Current positions in the cpu_buffer
|
||||
* cpu_size : The memory size of the cpu_buffer
|
||||
* BaseAddress : The base address you whant the binay file should run from
|
||||
* cpuarch : if it exists diffent cpu from a manufactor like pentium,
|
||||
* pentinum-mmx so on, use this flag to specify which type
|
||||
* of cpu you whant or do not use it if it does not exists
|
||||
* other or any sub model.
|
||||
*
|
||||
* Return value :
|
||||
* value -1 : unimplement
|
||||
* value 0 : wrong opcode or not vaild opcode
|
||||
* value +1 and higher : who many byte we should add to cpu_pos
|
||||
*/
|
||||
|
||||
/* Get Dest register */
|
||||
#define PPC_GetBitArraySrcReg(opcode) (((opcode & 0x3) << 3) | ((opcode & 0xE000) >> 13))
|
||||
|
||||
/* Get Source register */
|
||||
CPU_UNINT PPC_GetBitArrayBto31xx(CPU_UNINT opcode)
|
||||
{
|
||||
CPU_INT x1;
|
||||
|
||||
/* FIXME make it to a macro
|
||||
* not tested to 100% yet */
|
||||
x1 = ((opcode & 0x1F00)>>8);
|
||||
return x1;
|
||||
}
|
||||
|
||||
|
||||
CPU_UNINT PPC_GetBitArrayBto31(CPU_UNINT opcode)
|
||||
{
|
||||
CPU_INT x1;
|
||||
/* FIXME make it to a macro
|
||||
* not tested to 100% yet */
|
||||
x1 = ((opcode & 0xFFFF0000)>>16);
|
||||
return x1;
|
||||
}
|
||||
|
||||
|
||||
CPU_INT PPC_Blr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
|
||||
BaseAddress +=cpu_pos;
|
||||
|
||||
/* own translatons langues */
|
||||
if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
pMyBrainAnalys->op = OP_ANY_ret;
|
||||
pMyBrainAnalys->memAdr=BaseAddress;
|
||||
|
||||
return 4;
|
||||
}
|
||||
|
||||
|
||||
CPU_INT PPC_Li( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
CPU_UNINT opcode;
|
||||
|
||||
opcode = GetData32Le(&cpu_buffer[cpu_pos]);
|
||||
|
||||
BaseAddress +=cpu_pos;
|
||||
|
||||
/* own translatons langues */
|
||||
if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
pMyBrainAnalys->op = OP_ANY_mov;
|
||||
pMyBrainAnalys->type= 8 + 16; /* 8 dst reg, 16 imm */
|
||||
pMyBrainAnalys->src_size = 16;
|
||||
pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode);
|
||||
pMyBrainAnalys->dst = PPC_GetBitArrayBto31(opcode);
|
||||
pMyBrainAnalys->memAdr=BaseAddress;
|
||||
|
||||
return 4;
|
||||
}
|
||||
|
||||
|
||||
CPU_INT PPC_mr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
CPU_UNINT opcode;
|
||||
|
||||
opcode = GetData32Le(&cpu_buffer[cpu_pos]);
|
||||
|
||||
BaseAddress +=cpu_pos;
|
||||
|
||||
/* own translatons langues */
|
||||
if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
pMyBrainAnalys->op = OP_ANY_mov;
|
||||
pMyBrainAnalys->type= 2 + 8; /* 8 dst reg, 2 src reg */
|
||||
pMyBrainAnalys->src_size = 32;
|
||||
pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode);
|
||||
pMyBrainAnalys->dst = PPC_GetBitArrayBto31xx(opcode);
|
||||
pMyBrainAnalys->memAdr=BaseAddress;
|
||||
|
||||
return 4;
|
||||
}
|
||||
|
||||
|
||||
CPU_INT PPC_Stw( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
/* r1 store at -0x20(r1) */
|
||||
|
||||
CPU_UNINT opcode;
|
||||
CPU_SHORT tmp = 0;
|
||||
|
||||
opcode = GetData32Le(&cpu_buffer[cpu_pos]);
|
||||
|
||||
BaseAddress +=cpu_pos;
|
||||
|
||||
/* own translatons langues */
|
||||
if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
tmp = _byteswap_ushort( ((CPU_SHORT)((opcode >> 16) & 0xffff)));
|
||||
|
||||
pMyBrainAnalys->op = OP_ANY_mov;
|
||||
pMyBrainAnalys->type= 2 + 64;
|
||||
pMyBrainAnalys->src_size = 32;
|
||||
pMyBrainAnalys->dst_size = 32;
|
||||
pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode);
|
||||
pMyBrainAnalys->dst = PPC_GetBitArrayBto31xx(opcode);
|
||||
pMyBrainAnalys-> dst_extra = tmp;
|
||||
pMyBrainAnalys->memAdr=BaseAddress;
|
||||
|
||||
return 4;
|
||||
}
|
||||
|
||||
CPU_INT PPC_Stwu( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
/* r1 store at -0x20(r1) */
|
||||
|
||||
CPU_UNINT opcode;
|
||||
CPU_INT DstReg;
|
||||
CPU_SHORT tmp = 0;
|
||||
|
||||
opcode = GetData32Le(&cpu_buffer[cpu_pos]);
|
||||
|
||||
DstReg = PPC_GetBitArrayBto31xx(opcode);
|
||||
if (DstReg == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
BaseAddress +=cpu_pos;
|
||||
|
||||
/* own translatons langues */
|
||||
if (AllocAny()!=0) /* alloc memory for pMyBrainAnalys */
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
tmp = _byteswap_ushort( ((CPU_SHORT)((opcode >> 16) & 0xffff)));
|
||||
|
||||
pMyBrainAnalys->op = OP_ANY_mov;
|
||||
pMyBrainAnalys->type= 2 + 64 + 128;
|
||||
pMyBrainAnalys->src_size = 32;
|
||||
pMyBrainAnalys->dst_size = 32;
|
||||
pMyBrainAnalys->src = PPC_GetBitArraySrcReg(opcode);
|
||||
pMyBrainAnalys->dst = DstReg;
|
||||
pMyBrainAnalys-> dst_extra = tmp;
|
||||
pMyBrainAnalys->memAdr=BaseAddress;
|
||||
|
||||
return 4;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
|
||||
#include "../../misc.h"
|
||||
|
||||
CPU_INT DummyBrain( CPU_BYTE *cpu_buffer,
|
||||
CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size,
|
||||
CPU_UNINT BaseAddress,
|
||||
CPU_UNINT cpuarch,
|
||||
FILE *outfp);
|
||||
|
||||
/* here we put the prototype for the opcode api that brain need we show a example for it */
|
||||
CPU_INT DUMMY_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
|
||||
|
||||
/* Export comment thing see m68k for example
|
||||
* in dummy we do not show it, for it is diffent for each cpu
|
||||
*/
|
|
@ -1,95 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "DummyBrain.h"
|
||||
#include "Dummy.h"
|
||||
#include "../../misc.h"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* DummyBrain is example how you create you own cpu brain to translate from
|
||||
* cpu to intel assembler, I have not add DummyBrain to the loader it is not
|
||||
* need it in our example. When you write you own brain, it must be setup in
|
||||
* misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not
|
||||
* need the brain you have writen so you do not need setup it there then.
|
||||
*
|
||||
* input param:
|
||||
* cpu_buffer : the memory buffer with loaded program we whant translate
|
||||
* cpu_pos : the positions in the cpu_buffer
|
||||
* cpu_size : the alloced memory size of the cpu_buffer
|
||||
* BaseAddress : the virtual memory address we setup to use.
|
||||
* cpuarch : the sub arch for the brain, example if it exists more one
|
||||
* cpu with same desgin but few other opcode or extend opcode
|
||||
* outfp : the output file pointer
|
||||
*
|
||||
* return value
|
||||
* 0 : Ok
|
||||
* 1 : unimplemt
|
||||
* 2 : Unkonwn Opcode
|
||||
* 3 : unimplement cpu
|
||||
* 4 : unknown machine
|
||||
*/
|
||||
|
||||
CPU_INT DummyBrain( CPU_BYTE *cpu_buffer,
|
||||
CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size,
|
||||
CPU_UNINT BaseAddress,
|
||||
CPU_UNINT cpuarch,
|
||||
FILE *outfp)
|
||||
{
|
||||
CPU_UNINT cpu_oldpos;
|
||||
CPU_INT cpuint;
|
||||
CPU_INT retcode = 0;
|
||||
CPU_INT retsize;
|
||||
|
||||
/* now we start the process */
|
||||
while (cpu_pos<cpu_size)
|
||||
{
|
||||
cpu_oldpos = cpu_pos;
|
||||
|
||||
/* use the GetData32Be or GetData32Le
|
||||
to read from the memory the
|
||||
Le is for small endian and the
|
||||
Be is for big endian
|
||||
the 32 is how many bits we should read
|
||||
*/
|
||||
cpuint = GetData32Be(&cpu_buffer[cpu_pos]);
|
||||
|
||||
/* Add */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuDummyInit_Add))) == ConvertBitToByte(cpuDummyInit_Add))
|
||||
{
|
||||
retsize = DUMMY_Add( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Found all Opcode and breakout and return no error found */
|
||||
if (cpu_pos >=cpu_size)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check if we have found a cpu opcode */
|
||||
if (cpu_oldpos == cpu_pos)
|
||||
{
|
||||
if (retcode == 0)
|
||||
{
|
||||
/* no unimplement error where found so we return a msg for unknown opcode */
|
||||
printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]);
|
||||
retcode = 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* Erorro Found ? */
|
||||
if (retcode!=0)
|
||||
{
|
||||
/* Erorro Found break and return the error code */
|
||||
break;
|
||||
}
|
||||
}
|
||||
return retcode;
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
|
||||
#include "../../misc.h"
|
||||
|
||||
|
||||
/* example how setup a opcode, this opcode is 16bit long (taken from M68K)
|
||||
* 0 and 1 mean normal bit, 2 mean mask bit the bit that are determent diffent
|
||||
* thing in the opcode, example which reg so on, it can be etither 0 or 1 in
|
||||
* the opcode. but a opcode have also normal bit that is always been set to
|
||||
* same. thuse bit are always 0 or 1
|
||||
*/
|
||||
CPU_BYTE cpuDummyInit_Add[16] = {1,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2};
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "Dummy.h"
|
||||
#include "../../misc.h"
|
||||
|
||||
|
||||
/* cpuDummyInit_Add
|
||||
* Input param :
|
||||
* out : The file pointer that we write to (the output file to intel asm)
|
||||
* cpu_buffer : The memory buffer we have our binary code that we whant convert
|
||||
* cpu_pos : Current positions in the cpu_buffer
|
||||
* cpu_size : The memory size of the cpu_buffer
|
||||
* BaseAddress : The base address you whant the binay file should run from
|
||||
* cpuarch : if it exists diffent cpu from a manufactor like pentium,
|
||||
* pentinum-mmx so on, use this flag to specify which type
|
||||
* of cpu you whant or do not use it if it does not exists
|
||||
* other or any sub model.
|
||||
* Return value :
|
||||
* value -1 : unimplement
|
||||
* value 0 : wrong opcode or not vaild opcode
|
||||
* value +1 and higher : who many byte we should add to cpu_pos
|
||||
*/
|
||||
|
||||
CPU_INT DUMMY_Add( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
|
||||
{
|
||||
/*
|
||||
* ConvertBitToByte() is perfect to use to get the bit being in use from a bit array
|
||||
* GetMaskByte() is perfect if u whant known which bit have been mask out
|
||||
* see M68kopcode.c and how it use the ConvertBitToByte()
|
||||
*/
|
||||
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Add unimplement\n");
|
||||
return -1;
|
||||
}
|
|
@ -1,320 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "M68kBrain.h"
|
||||
#include "m68k.h"
|
||||
#include "../../misc.h"
|
||||
|
||||
/*
|
||||
* DummyBrain is example how you create you own cpu brain to translate from
|
||||
* cpu to intel assembler, I have not add DummyBrain to the loader it is not
|
||||
* need it in our example. When you write you own brain, it must be setup in
|
||||
* misc.c function LoadPFileImage and PEFileStart, PEFileStart maybe does not
|
||||
* need the brain you have writen so you do not need setup it there then.
|
||||
*
|
||||
* input param:
|
||||
* cpu_buffer : the memory buffer with loaded program we whant translate
|
||||
* cpu_pos : the positions in the cpu_buffer
|
||||
* cpu_size : the alloced memory size of the cpu_buffer
|
||||
* BaseAddress : the virtual memory address we setup to use.
|
||||
* cpuarch : the sub arch for the brain, example if it exists more one
|
||||
* cpu with same desgin but few other opcode or extend opcode
|
||||
* outfp : the output file pointer
|
||||
*
|
||||
* return value
|
||||
* 0 : Ok
|
||||
* 1 : unimplemt
|
||||
* 2 : Unkonwn Opcode
|
||||
* 3 : unimplement cpu
|
||||
* 4 : unknown machine
|
||||
*/
|
||||
|
||||
CPU_INT M68KBrain( CPU_BYTE *cpu_buffer,
|
||||
CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size,
|
||||
CPU_UNINT BaseAddress,
|
||||
CPU_UNINT cpuarch,
|
||||
FILE *outfp)
|
||||
{
|
||||
CPU_UNINT cpu_oldpos;
|
||||
CPU_INT cpuint;
|
||||
CPU_INT retcode = 0;
|
||||
CPU_INT retsize;
|
||||
|
||||
/* now we start the process */
|
||||
while (cpu_pos<cpu_size)
|
||||
{
|
||||
cpu_oldpos = cpu_pos;
|
||||
|
||||
cpuint = cpu_buffer[cpu_pos];
|
||||
|
||||
/* Abcd */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Abcd))) == ConvertBitToByte(cpuM68kInit_Abcd))
|
||||
{
|
||||
retsize = M68k_Abcd( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
/* Add */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Add))) == ConvertBitToByte(cpuM68kInit_Add))
|
||||
{
|
||||
retsize = M68k_Add( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
/* Addi */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Addi))) == ConvertBitToByte(cpuM68kInit_Addi))
|
||||
{
|
||||
retsize = M68k_Addi( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
/* Addq */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Addq))) == ConvertBitToByte(cpuM68kInit_Addq))
|
||||
{
|
||||
retsize = M68k_Addq( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
/* Addx */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Addx))) == ConvertBitToByte(cpuM68kInit_Addx))
|
||||
{
|
||||
retsize = M68k_Addx( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
/* And */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_And))) == ConvertBitToByte(cpuM68kInit_And))
|
||||
{
|
||||
retsize = M68k_Add( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
/* Andi */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Andi))) == ConvertBitToByte(cpuM68kInit_Andi))
|
||||
{
|
||||
retsize = M68k_Andi( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
/* AndToCCR */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_AndToCCRF))) == ConvertBitToByte(cpuM68kInit_AndToCCRF))
|
||||
{
|
||||
cpuint = cpu_buffer[cpu_pos+1];
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_AndToCCRS))) == ConvertBitToByte(cpuM68kInit_AndToCCRS))
|
||||
{
|
||||
cpu_pos++;
|
||||
retsize = M68k_AndToCCR( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
else
|
||||
{
|
||||
cpuint = cpu_buffer[cpu_pos];
|
||||
}
|
||||
}
|
||||
|
||||
/* Bhi */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bhi))) == ConvertBitToByte(cpuM68kInit_Bhi))
|
||||
{
|
||||
retsize = M68k_Bhi( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Bls */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bls))) == ConvertBitToByte(cpuM68kInit_Bls))
|
||||
{
|
||||
retsize = M68k_Bls( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Bcc */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bcc))) == ConvertBitToByte(cpuM68kInit_Bcc))
|
||||
{
|
||||
retsize = M68k_Bcc( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Bcs */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bcs))) == ConvertBitToByte(cpuM68kInit_Bcs))
|
||||
{
|
||||
retsize = M68k_Bcs( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Bne */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bne))) == ConvertBitToByte(cpuM68kInit_Bne))
|
||||
{
|
||||
retsize = M68k_Bne( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Beq */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Beq))) == ConvertBitToByte(cpuM68kInit_Beq))
|
||||
{
|
||||
retsize = M68k_Beq( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Bvc */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bvc))) == ConvertBitToByte(cpuM68kInit_Bvc))
|
||||
{
|
||||
retsize = M68k_Bvc( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Bvs */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bvs))) == ConvertBitToByte(cpuM68kInit_Bvs))
|
||||
{
|
||||
retsize = M68k_Bvs( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Bpl */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bpl))) == ConvertBitToByte(cpuM68kInit_Bpl))
|
||||
{
|
||||
retsize = M68k_Bpl( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Bmi */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bmi))) == ConvertBitToByte(cpuM68kInit_Bmi))
|
||||
{
|
||||
retsize = M68k_Bmi( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Bge */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bge))) == ConvertBitToByte(cpuM68kInit_Bge))
|
||||
{
|
||||
retsize = M68k_Bge( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Blt */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Blt))) == ConvertBitToByte(cpuM68kInit_Blt))
|
||||
{
|
||||
retsize = M68k_Blt( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Bgt */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Bgt))) == ConvertBitToByte(cpuM68kInit_Bgt))
|
||||
{
|
||||
retsize = M68k_Bgt( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Ble */
|
||||
if ((cpuint - (cpuint & GetMaskByte(cpuM68kInit_Ble))) == ConvertBitToByte(cpuM68kInit_Ble))
|
||||
{
|
||||
retsize = M68k_Ble( outfp, cpu_buffer, cpu_pos, cpu_size,
|
||||
BaseAddress, cpuarch);
|
||||
if (retsize<0)
|
||||
retcode = 1;
|
||||
else
|
||||
cpu_pos += retsize;
|
||||
}
|
||||
|
||||
/* Found all Opcode and breakout and return no error found */
|
||||
if (cpu_pos >=cpu_size)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Check if we have found a cpu opcode */
|
||||
if (cpu_oldpos == cpu_pos)
|
||||
{
|
||||
if (retcode == 0)
|
||||
{
|
||||
/* no unimplement error where found so we return a msg for unknown opcode */
|
||||
printf("Unkonwn Opcode found at 0x%8x opcode 0x%2x\n",cpu_oldpos+BaseAddress,(unsigned int)cpu_buffer[cpu_oldpos]);
|
||||
retcode = 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* Erorro Found ? */
|
||||
if (retcode!=0)
|
||||
{
|
||||
/* Erorro Found break and return the error code */
|
||||
break;
|
||||
}
|
||||
}
|
||||
return retcode;
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
|
||||
#include "../../misc.h"
|
||||
|
||||
CPU_BYTE cpuM68kInit_Abcd[16] = {1,1,1,1,2,2,2,1,0,0,0,0,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Add[16] = {1,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Addi[16] = {0,0,0,0,0,1,1,0,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Addq[16] = {0,1,0,1,2,2,2,0,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Addx[16] = {1,1,0,1,2,2,2,1,2,2,0,0,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_And[16] = {1,1,0,0,2,2,2,2,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Andi[16] = {0,0,0,0,0,0,1,0,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_AndToCCRF[16] = {0,0,0,0,0,0,1,0,0,0,1,1,1,1,0,0};
|
||||
CPU_BYTE cpuM68kInit_AndToCCRS[16] = {0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Asl[16] = {1,1,1,0,2,2,2,0,2,2,2,0,0,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Asr[16] = {1,1,1,0,2,2,2,1,2,2,2,0,0,2,2,2};
|
||||
|
||||
CPU_BYTE cpuM68kInit_Bhi[16] = {0,1,1,0,0,0,1,0,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Bls[16] = {0,1,1,0,0,0,1,1,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Bcc[16] = {0,1,1,0,0,1,0,0,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Bcs[16] = {0,1,1,0,0,1,0,1,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Bne[16] = {0,1,1,0,0,1,1,0,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Beq[16] = {0,1,1,0,0,1,1,1,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Bvc[16] = {0,1,1,0,1,0,0,0,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Bvs[16] = {0,1,1,0,1,0,0,1,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Bpl[16] = {0,1,1,0,1,0,1,0,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Bmi[16] = {0,1,1,0,1,0,1,1,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Bge[16] = {0,1,1,0,1,1,0,0,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Blt[16] = {0,1,1,0,1,1,0,1,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Bgt[16] = {0,1,1,0,1,1,1,0,2,2,2,2,2,2,2,2};
|
||||
CPU_BYTE cpuM68kInit_Ble[16] = {0,1,1,0,1,1,1,1,2,2,2,2,2,2,2,2};
|
||||
|
||||
|
||||
CPU_BYTE M68k_Rx[16] = {0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0};
|
||||
CPU_BYTE M68k_RM[16] = {0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0};
|
||||
CPU_BYTE M68k_Ry[16] = {0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1};
|
||||
CPU_BYTE M68k_Opmode[16] = {0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0};
|
||||
CPU_BYTE M68k_Mode[16] = {0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0};
|
||||
CPU_BYTE M68k_Size[16] = {0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0};
|
||||
|
|
@ -1,287 +0,0 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "m68k.h"
|
||||
#include "misc.h"
|
||||
|
||||
|
||||
CPU_INT M68k_Abcd( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Abcd unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
CPU_INT opmode;
|
||||
CPU_INT mode;
|
||||
CPU_INT Rx;
|
||||
CPU_INT Ry;
|
||||
//CPU_INT cpuint;
|
||||
|
||||
opmode = ConvertBitToByte(M68k_Opmode);
|
||||
mode = ConvertBitToByte(M68k_Mode);
|
||||
Rx = ConvertBitToByte(M68k_Rx);
|
||||
Ry = ConvertBitToByte(M68k_Ry);
|
||||
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
if (opmode == 0x00)
|
||||
{
|
||||
/* <ea> + Dn -> Dn */
|
||||
printf(";Add unimplement of \"<ea> + Dn -> Dn\" \n");
|
||||
|
||||
}
|
||||
|
||||
if (opmode == 0x01)
|
||||
{
|
||||
/* <ea> + Dn -> Dn */
|
||||
printf(";Add unimplement of \"<ea> + Dn -> Dn\" \n");
|
||||
}
|
||||
|
||||
if (opmode == 0x02)
|
||||
{
|
||||
/* <ea> + Dn -> Dn */
|
||||
printf(";Add unimplement of \"<ea> + Dn -> Dn\" \n");
|
||||
}
|
||||
|
||||
if (opmode == 0x03)
|
||||
{
|
||||
/* <ea> + An -> An */
|
||||
printf(";Add unimplement of \"<ea> + An -> An\" \n");
|
||||
}
|
||||
|
||||
if (opmode == 0x04)
|
||||
{
|
||||
/* Dn + <ea> -> <ea> */
|
||||
printf(";Add unimplement of \"Dn + <ea> -> <ea>\" \n");
|
||||
}
|
||||
|
||||
if (opmode == 0x05)
|
||||
{
|
||||
/* Dn + <ea> -> <ea> */
|
||||
printf(";Add unimplement of \"Dn + <ea> -> <ea>\" \n");
|
||||
}
|
||||
|
||||
if (opmode == 0x06)
|
||||
{
|
||||
/* Dn + <ea> -> <ea> */
|
||||
printf(";Add unimplement of \"Dn + <ea> -> <ea>\" \n");
|
||||
}
|
||||
|
||||
if (opmode == 0x07)
|
||||
{
|
||||
/* <ea> + An -> An */
|
||||
printf(";Add unimplement of \"<ea> + An -> An\" \n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Addi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Addi unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Addq( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Addq unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Addx( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Addx unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_And( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";And unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Andi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Andi unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_AndToCCR( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";AndToCCR unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Asl( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Asl unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Asr( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Asr unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Bhi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Bhi unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Bls( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Bls unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Bcc( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Bcc unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Bcs( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Bcs unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Bne( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Bne unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Beq( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Beq unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Bvc( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Bvc unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Bvs( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Bvs unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Bpl( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Bpl unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Bmi( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Bmi unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Bge( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Bge unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Blt( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Blt unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Bgt( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Bgt unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CPU_INT M68k_Ble( FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch)
|
||||
{
|
||||
fprintf(out,"Line_0x%8x :\n",BaseAddress + cpu_pos);
|
||||
|
||||
printf(";Ble unimplement\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
|
||||
#include "../../misc.h"
|
||||
CPU_INT M68KBrain( CPU_BYTE *cpu_buffer,
|
||||
CPU_UNINT cpu_pos,
|
||||
CPU_UNINT cpu_size,
|
||||
CPU_UNINT BaseAddress,
|
||||
CPU_UNINT cpuarch,
|
||||
FILE *outfp);
|
||||
|
||||
|
||||
CPU_INT M68k_Abcd(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Add(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Addi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Addq(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Addx(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_And(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Andi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_AndToCCR(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Asl(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Asr(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Bhi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Bls(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Bcc(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Bcs(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Bne(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Beq(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Bvc(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Bvs(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Bpl(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Bmi(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Bge(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Blt(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Bgt(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
CPU_INT M68k_Ble(FILE *out, CPU_BYTE * cpu_buffer, CPU_UNINT cpu_pos, CPU_UNINT cpu_size, CPU_UNINT BaseAddress, CPU_UNINT cpuarch);
|
||||
|
||||
extern CPU_BYTE M68k_Rx[16];
|
||||
extern CPU_BYTE M68k_RM[16];
|
||||
extern CPU_BYTE M68k_Ry[16];
|
||||
extern CPU_BYTE M68k_Opmode[16];
|
||||
extern CPU_BYTE M68k_Mode[16];
|
||||
extern CPU_BYTE M68k_Size[16];
|
|
@ -1,563 +0,0 @@
|
|||
#include <windows.h>
|
||||
#include <winnt.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "misc.h"
|
||||
#include "From/ARM/ARM.h"
|
||||
#include "From/m68k/m68k.h"
|
||||
#include "From/PPC/PPC.h"
|
||||
|
||||
static CPU_INT machine_type = 0;
|
||||
//static CPU_INT ToMachine_type = IMAGE_FILE_MACHINE_I386;
|
||||
static CPU_INT ToMachine_type = IMAGE_FILE_MACHINE_POWERPC;
|
||||
/*
|
||||
* infileName file name to convert or disambler
|
||||
* outputfileName file name to save to
|
||||
* BaseAddress the address we should emulate
|
||||
* cpuid the cpu we choice not vaild for pe loader
|
||||
* type the loading mode Auto, PE, bin
|
||||
* mode disambler mode : 0 the arch cpu.
|
||||
* translate mode : 1 intel
|
||||
* translate mode : 2 ppc
|
||||
*
|
||||
*/
|
||||
|
||||
static void SetCPU(CPU_INT FromCpu, CPU_INT mode)
|
||||
{
|
||||
machine_type = FromCpu;
|
||||
switch(mode)
|
||||
{
|
||||
case 0:
|
||||
ToMachine_type = machine_type;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
ToMachine_type = IMAGE_FILE_MACHINE_I386;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ToMachine_type = IMAGE_FILE_MACHINE_POWERPC;
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Not supported mode\n");
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void Convert(FILE *outfp, CPU_INT FromCpu, CPU_INT mode)
|
||||
{
|
||||
SetCPU(machine_type,mode);
|
||||
AnyalsingProcess();
|
||||
ConvertProcess(outfp, machine_type, ToMachine_type);
|
||||
FreeAny();
|
||||
}
|
||||
|
||||
|
||||
CPU_INT LoadPFileImage( char *infileName, char *outputfileName,
|
||||
CPU_UNINT BaseAddress, char *cpuid,
|
||||
CPU_UNINT type, CPU_INT mode)
|
||||
{
|
||||
FILE *infp;
|
||||
FILE *outfp;
|
||||
CPU_BYTE *cpu_buffer;
|
||||
CPU_UNINT cpu_pos = 0;
|
||||
CPU_UNINT cpu_size=0;
|
||||
CPU_INT ret;
|
||||
//fopen("testms.exe","RB");
|
||||
|
||||
|
||||
/* Open file for read */
|
||||
|
||||
if (!(infp = fopen(infileName, "rb")))
|
||||
{
|
||||
printf("Can not open file %s\n",infileName);
|
||||
return 3;
|
||||
}
|
||||
|
||||
/* Open file for write */
|
||||
if (!(outfp = fopen(outputfileName,"wb")))
|
||||
{
|
||||
printf("Can not open file %s\n",outputfileName);
|
||||
return 4;
|
||||
}
|
||||
|
||||
/* Load the binary file to a memory buffer */
|
||||
fseek(infp,0,SEEK_END);
|
||||
if (ferror(infp))
|
||||
{
|
||||
printf("error can not seek in the read file");
|
||||
fclose(infp);
|
||||
fclose(outfp);
|
||||
return 5;
|
||||
}
|
||||
|
||||
/* get the memory size buffer */
|
||||
cpu_size = ftell(infp);
|
||||
if (ferror(infp))
|
||||
{
|
||||
printf("error can not get file size of the read file");
|
||||
fclose(infp);
|
||||
fclose(outfp);
|
||||
return 6;
|
||||
}
|
||||
|
||||
/* Load the binary file to a memory buffer */
|
||||
fseek(infp,0,SEEK_SET);
|
||||
if (ferror(infp))
|
||||
{
|
||||
printf("error can not seek in the read file");
|
||||
fclose(infp);
|
||||
fclose(outfp);
|
||||
return 5;
|
||||
}
|
||||
|
||||
if (cpu_size==0)
|
||||
{
|
||||
printf("error file size is Zero lenght of the read file");
|
||||
fclose(infp);
|
||||
fclose(outfp);
|
||||
return 7;
|
||||
}
|
||||
|
||||
/* alloc memory now */
|
||||
;
|
||||
if (!(cpu_buffer = (unsigned char *) malloc(cpu_size+1)))
|
||||
{
|
||||
printf("error can not alloc %uld size for memory buffer",cpu_size);
|
||||
fclose(infp);
|
||||
fclose(outfp);
|
||||
return 8;
|
||||
}
|
||||
ZeroMemory(cpu_buffer,cpu_size);
|
||||
|
||||
/* read from the file now in one sweep */
|
||||
fread((void *)cpu_buffer,1,cpu_size,infp);
|
||||
if (ferror(infp))
|
||||
{
|
||||
printf("error can not read file ");
|
||||
fclose(infp);
|
||||
fclose(outfp);
|
||||
return 9;
|
||||
}
|
||||
fclose(infp);
|
||||
|
||||
if (type==0)
|
||||
{
|
||||
if ( PEFileStart(cpu_buffer, 0, BaseAddress, cpu_size, outfp, mode) !=0)
|
||||
{
|
||||
type=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mode > 0)
|
||||
{
|
||||
Convert(outfp,machine_type,mode);
|
||||
}
|
||||
fclose(outfp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* fixme */
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (type== 1)
|
||||
{
|
||||
if (stricmp(cpuid,"m68000"))
|
||||
{
|
||||
ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68000,outfp);
|
||||
if (mode > 1)
|
||||
{
|
||||
Convert(outfp,machine_type,mode);
|
||||
}
|
||||
fclose(outfp);
|
||||
}
|
||||
else if (stricmp(cpuid,"m68010"))
|
||||
{
|
||||
ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68010,outfp);
|
||||
if (mode > 1)
|
||||
{
|
||||
Convert(outfp,machine_type,mode);
|
||||
}
|
||||
fclose(outfp);
|
||||
return ret;
|
||||
}
|
||||
else if (stricmp(cpuid,"m68020"))
|
||||
{
|
||||
ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68020,outfp);
|
||||
if (mode > 1)
|
||||
{
|
||||
Convert(outfp,machine_type,mode);
|
||||
}
|
||||
fclose(outfp);
|
||||
return ret;
|
||||
}
|
||||
else if (stricmp(cpuid,"m68030"))
|
||||
{
|
||||
ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68030,outfp);
|
||||
if (mode > 1)
|
||||
{
|
||||
Convert(outfp,machine_type,mode);
|
||||
}
|
||||
fclose(outfp);
|
||||
return ret;
|
||||
}
|
||||
else if (stricmp(cpuid,"m68040"))
|
||||
{
|
||||
ret = M68KBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,68040,outfp);
|
||||
if (mode > 1)
|
||||
{
|
||||
Convert(outfp,machine_type,mode);
|
||||
}
|
||||
fclose(outfp);
|
||||
return ret;
|
||||
}
|
||||
else if (stricmp(cpuid,"ppc"))
|
||||
{
|
||||
ret = PPCBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,0,outfp);
|
||||
if (mode > 1)
|
||||
{
|
||||
Convert(outfp,machine_type,mode);
|
||||
}
|
||||
fclose(outfp);
|
||||
return ret;
|
||||
}
|
||||
else if (stricmp(cpuid,"arm4"))
|
||||
{
|
||||
ret = ARMBrain(cpu_buffer,cpu_pos,cpu_size,BaseAddress,4,outfp);
|
||||
if (mode > 1)
|
||||
{
|
||||
Convert(outfp,machine_type,mode);
|
||||
}
|
||||
fclose(outfp);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (type==2)
|
||||
{
|
||||
|
||||
ret = PEFileStart(cpu_buffer, 0, BaseAddress, cpu_size, outfp, mode);
|
||||
if (mode > 1)
|
||||
{
|
||||
Convert(outfp,machine_type,mode);
|
||||
}
|
||||
fclose(outfp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define MAXSECTIONNUMBER 16
|
||||
|
||||
CPU_INT PEFileStart( CPU_BYTE *memory, CPU_UNINT pos,
|
||||
CPU_UNINT base, CPU_UNINT size,
|
||||
FILE *outfp, CPU_INT mode)
|
||||
{
|
||||
PIMAGE_DOS_HEADER DosHeader;
|
||||
PIMAGE_NT_HEADERS NtHeader;
|
||||
IMAGE_SECTION_HEADER SectionHeader[MAXSECTIONNUMBER] = {NULL};
|
||||
PIMAGE_SECTION_HEADER pSectionHeader;
|
||||
PIMAGE_EXPORT_DIRECTORY ExportEntry;
|
||||
INT NumberOfSections;
|
||||
INT NumberOfSectionsCount=0;
|
||||
INT i;
|
||||
|
||||
DosHeader = (PIMAGE_DOS_HEADER)memory;
|
||||
if ( (DosHeader->e_magic != IMAGE_DOS_SIGNATURE) ||
|
||||
(size < 0x3c+2) )
|
||||
{
|
||||
printf("No MZ file \n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
NtHeader = (PIMAGE_NT_HEADERS) (((ULONG)memory) + ((ULONG)DosHeader->e_lfanew));
|
||||
if (NtHeader->Signature != IMAGE_NT_SIGNATURE)
|
||||
{
|
||||
printf("No PE header found \n");
|
||||
}
|
||||
|
||||
if (!(NtHeader->FileHeader.Characteristics & IMAGE_FILE_EXECUTABLE_IMAGE))
|
||||
{
|
||||
printf("No execute image found \n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
switch(NtHeader->OptionalHeader.Subsystem)
|
||||
{
|
||||
case IMAGE_SUBSYSTEM_EFI_APPLICATION:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_EFI_APPLICATION\n");
|
||||
printf("This exe file is desgin run in EFI bios as applactions\n");
|
||||
break;
|
||||
case IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER\n");
|
||||
printf("This exe file is desgin run in EFI bios as service driver\n");
|
||||
break;
|
||||
case IMAGE_SUBSYSTEM_EFI_ROM:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_EFI_ROM\n");
|
||||
printf("This exe file is EFI ROM\n");
|
||||
break;
|
||||
case IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER\n");
|
||||
printf("This exe file is desgin run in EFI bios as driver\n");
|
||||
break;
|
||||
case IMAGE_SUBSYSTEM_NATIVE:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_NATIVE\n");
|
||||
printf("This exe file does not need any subsystem\n");
|
||||
break;
|
||||
case IMAGE_SUBSYSTEM_NATIVE_WINDOWS:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_NATIVE_WINDOWS\n");
|
||||
printf("This exe file is desgin run on Windows 9x as driver \n");
|
||||
break;
|
||||
case IMAGE_SUBSYSTEM_OS2_CUI:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_OS2_CUI\n");
|
||||
printf("This exe file is desgin run on OS2 as CUI\n");
|
||||
break;
|
||||
case IMAGE_SUBSYSTEM_POSIX_CUI:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_POSIX_CUI\n");
|
||||
printf("This exe file is desgin run on POSIX as CUI\n");
|
||||
break;
|
||||
case IMAGE_SUBSYSTEM_WINDOWS_CE_GUI:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_WINDOWS_CE_GUI\n");
|
||||
printf("This exe file is desgin run on Windows CE as GUI\n");
|
||||
break;
|
||||
case IMAGE_SUBSYSTEM_WINDOWS_CUI:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_WINDOWS_CUI\n");
|
||||
printf("This exe file is desgin run on Windows as CUI\n");
|
||||
break;
|
||||
case IMAGE_SUBSYSTEM_WINDOWS_GUI:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_WINDOWS_GUI\n");
|
||||
printf("This exe file is desgin run on Windows as GUI\n");
|
||||
break;
|
||||
case IMAGE_SUBSYSTEM_XBOX:
|
||||
fprintf(outfp,"; OS type : IMAGE_SUBSYSTEM_XBOX\n");
|
||||
printf("This exe file is desgin run on X-Box\n");
|
||||
break;
|
||||
default:
|
||||
fprintf(outfp,"; OS type : Unknown\n");
|
||||
printf("Unknown OS : SubID : %d\n",NtHeader->OptionalHeader.Subsystem);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
printf("Number of object : %d\n",NtHeader->FileHeader.NumberOfSections);
|
||||
printf("Base Address : %8x\n\n",NtHeader->OptionalHeader.ImageBase);
|
||||
|
||||
pSectionHeader = IMAGE_FIRST_SECTION(NtHeader);
|
||||
|
||||
NumberOfSections = NtHeader->FileHeader.NumberOfSections;
|
||||
|
||||
for (i = 0; i < NumberOfSections; i++)
|
||||
{
|
||||
SectionHeader[i] = *pSectionHeader++;
|
||||
printf("Found Sector : %s \n ",SectionHeader[i].Name);
|
||||
printf("RVA: %08lX ",SectionHeader[i].VirtualAddress);
|
||||
printf("Offset: %08lX ",SectionHeader[i].PointerToRawData);
|
||||
printf("Size: %08lX ",SectionHeader[i].SizeOfRawData);
|
||||
printf("Flags: %08lX \n\n",SectionHeader[i].Characteristics);
|
||||
}
|
||||
|
||||
/* Get export data */
|
||||
if (NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size != 0)
|
||||
{
|
||||
for (i = 0; i < NumberOfSections; i++)
|
||||
{
|
||||
if ( SectionHeader[i].VirtualAddress <= (ULONG) NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress &&
|
||||
SectionHeader[i].VirtualAddress + SectionHeader[i].SizeOfRawData > (ULONG)NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress)
|
||||
{
|
||||
ExportEntry = (PIMAGE_NT_HEADERS) (((ULONG)memory) +
|
||||
(ULONG)(NtHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress -
|
||||
SectionHeader[i].VirtualAddress +
|
||||
SectionHeader[i].PointerToRawData));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* start decoding */
|
||||
|
||||
for (i=0;i < NumberOfSections; i++)
|
||||
{
|
||||
if (strnicmp((PCHAR) SectionHeader[i].Name,".text\0",6)==0)
|
||||
{
|
||||
switch (NtHeader->FileHeader.Machine)
|
||||
{
|
||||
case IMAGE_FILE_MACHINE_ALPHA:
|
||||
printf("CPU ALPHA Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found Alpha\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_ALPHA;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_ALPHA64:
|
||||
printf("CPU ALPHA64/AXP64 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found Alpha64/AXP64\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_ALPHA64;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_AM33:
|
||||
printf("CPU AM33 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found AM33\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_AM33;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_AMD64:
|
||||
printf("CPU AMD64 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found AMD64\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_AMD64;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_ARM:
|
||||
printf("CPU ARM Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found ARM\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_ARM;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_CEE:
|
||||
printf("CPU CEE Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found CEE\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_CEE;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_CEF:
|
||||
printf("CPU CEF Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found CEF\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_CEF;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_EBC:
|
||||
printf("CPU EBC Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found EBC\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_EBC;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_I386:
|
||||
printf("CPU I386 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found I386\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_I386;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_IA64:
|
||||
printf("CPU IA64 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found IA64\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_IA64;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_M32R:
|
||||
printf("CPU M32R Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found M32R\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_M32R;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_MIPS16:
|
||||
printf("CPU MIPS16 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found MIPS16\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_MIPS16;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_MIPSFPU:
|
||||
printf("CPU MIPSFPU Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found MIPSFPU\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_MIPSFPU;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_MIPSFPU16:
|
||||
printf("CPU MIPSFPU16 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found MIPSFPU16\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_MIPSFPU16;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_POWERPC:
|
||||
printf("CPU POWERPC Detected partily CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found POWERPC\n");
|
||||
//PPCBrain(memory, pos, cpu_size, base, 0, outfp);
|
||||
machine_type = IMAGE_FILE_MACHINE_POWERPC;
|
||||
PPCBrain(memory+SectionHeader[i].PointerToRawData, 0, SectionHeader[i].SizeOfRawData, NtHeader->OptionalHeader.ImageBase, 0, outfp);
|
||||
break;
|
||||
|
||||
|
||||
case IMAGE_FILE_MACHINE_POWERPCFP:
|
||||
printf("CPU POWERPCFP Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found POWERPCFP\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_POWERPCFP;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_R10000:
|
||||
printf("CPU R10000 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found R10000\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_R10000;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_R3000:
|
||||
printf("CPU R3000 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found R3000\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_R3000;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_R4000:
|
||||
printf("CPU R4000 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found R4000\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_R4000;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_SH3:
|
||||
printf("CPU SH3 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found SH3\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_SH3;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_SH3DSP:
|
||||
printf("CPU SH3DSP Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found SH3DSP\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_SH3DSP;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_SH3E:
|
||||
printf("CPU SH3E Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found SH3E\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_SH3E;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_SH4:
|
||||
printf("CPU SH4 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found SH4\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_SH4;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_SH5:
|
||||
printf("CPU SH5 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found SH5\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_SH5;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_THUMB:
|
||||
printf("CPU THUMB Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found THUMB\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_THUMB;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_TRICORE:
|
||||
printf("CPU TRICORE Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found TRICORE\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_TRICORE;
|
||||
return 3;
|
||||
|
||||
case IMAGE_FILE_MACHINE_WCEMIPSV2:
|
||||
printf("CPU WCEMIPSV2 Detected no CPUBrain implement for it\n");
|
||||
fprintf(outfp,"; CPU found WCEMIPSV2\n");
|
||||
machine_type = IMAGE_FILE_MACHINE_WCEMIPSV2;
|
||||
return 3;
|
||||
|
||||
default:
|
||||
printf("Unknown Machine : %d",NtHeader->FileHeader.Machine);
|
||||
return 4;
|
||||
} /* end case switch*/
|
||||
} /* end if text sector */
|
||||
} /* end for */
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
|
||||
PowerPC 32bits
|
||||
|
||||
reg = R0-R31
|
||||
#imm = a value you set
|
||||
|
||||
Bit expain
|
||||
0 = mean bit is zero
|
||||
1 = mean bit is set
|
||||
2 = mean this bit can be 0 or 1
|
||||
|
||||
opcode Name Desciptions
|
||||
0010 0000 0000 0000 1000 0000 0100 1110 blr return from a functions
|
||||
|
||||
0222 2222 2222 2222 2222 2222 0011 1000 Li reg,#imm move a value to a register
|
||||
|
||||
2222 2222 2222 2222 2222 2222 1001 0022 stw reg,mem store a value into memory
|
||||
|
||||
2222 2222 2222 2222 2222 2222 1001 0122 stwu reg,mem store contain of reg to memory and
|
||||
move reg to that memory position
|
||||
|
||||
|
||||
|
||||
Here how the primary opcode work
|
||||
xxxx xxxx xxxx xxxx DDDS SSSS 3333 33DD
|
||||
|
||||
|
||||
3 = it is the primary opcode
|
||||
D = Destions register
|
||||
S = Source reigters
|
||||
opcode
|
||||
-------------------------
|
||||
|bit order: 5432 10 67 |
|
||||
------- ------- ----------- ----
|
||||
34: | 0c 00 | | e1 93 | stw r31,12(r1) 0000 1100 0000 0000 1110 0001 | 1001 00 | 00
|
||||
38: | 14 00 | | 01 90 | stw r0,20(r1) 0001 0100 0000 0000 0000 0001 | 1001 00 | 11
|
||||
------- ------- ---------
|
||||
| |
|
||||
| |--> Get source register R0-R31 (0xE1 & 0x1F) = 1
|
||||
| |
|
||||
| |--> Get Dest register R0-R31 ((0xE1 & 0xE0)>>5) | ((0x90 & 0x3)<<3) = 31 or 0
|
||||
| | (The adding the two last bit on the end is maybe wrong need examine it)
|
||||
| |
|
||||
| --> Get the opcpde (0x90 & 0xFC)
|
||||
\ /
|
||||
|
||||
The address offset 12 or 20
|
||||
|
||||
opcode
|
||||
---------------------------------------------------------
|
||||
|bit order: pos 1111 1111 1111 1111 0000 0000 0000 0000 |
|
||||
| 5432 10 |
|
||||
|---------------------------------------------------------|
|
||||
| bits 0000 1100 0000 0000 1110 0001 1001 0000 |
|
||||
---------------------------------------------------------
|
||||
| math (opcode>>2) & 0x3F |
|
||||
---------------------------------------------------------
|
||||
|
||||
Dest Register
|
||||
---------------------------------------------------------
|
||||
|bit order: pos 1111 1111 1111 1111 0000 0000 0000 0000 |
|
||||
| 210 43 |
|
||||
|---------------------------------------------------------|
|
||||
| bits 0000 1100 0000 0000 1110 0001 1001 0000 |
|
||||
---------------------------------------------------------
|
||||
| math (((opcode & 0x3) << 3) | ((opcode & 0xE000) >> 13))|
|
||||
---------------------------------------------------------
|
||||
|
||||
source Register
|
||||
---------------------------------------------------------
|
||||
|bit order: pos 1111 1111 1111 1111 0000 0000 0000 0000 |
|
||||
| x xxxx |
|
||||
|---------------------------------------------------------|
|
||||
| bits 0000 1100 0000 0000 1110 0001 1001 0000 |
|
||||
---------------------------------------------------------
|
||||
| math |
|
||||
---------------------------------------------------------
|
|
@ -1,76 +0,0 @@
|
|||
CpuToIntel is a experment tools and is strict under havy devloping
|
||||
|
||||
|
||||
The Idea
|
||||
The idea is to converting binary files or win pe files
|
||||
from one cpu to another cpu, But it does not exists
|
||||
plan to port over diffent hardware architect like
|
||||
how diffent hw comucate, example x86 DMA controller
|
||||
to PPC like that stuff. It is only to convert the
|
||||
binary or pe files to another cpu. it mean a user
|
||||
mode apps will always be ported, but if it self
|
||||
modify code it will not work. But it exists idea how
|
||||
to deal with self modify code.
|
||||
|
||||
|
||||
The idea to handling self modify code
|
||||
The idea is to add a small emulator or adding
|
||||
anaylysing process to dectect self modify code
|
||||
and extract it. This is very hard part todo, some say
|
||||
imposible, some other say almost imposble. and I say
|
||||
it is posible todo but extream hard todo. for it is
|
||||
very diffcul to dectect self modify code with a
|
||||
analysing process.
|
||||
|
||||
|
||||
Why the name are CpuToIntel
|
||||
When I start write on it it was only ment to convert
|
||||
from ARM, PPC, m68k to X86 but then I come think of
|
||||
ReactOS PPC port that is going on. for or later we
|
||||
will need something that doing convert from x86 to
|
||||
PPC apps. It exists two way todo it. One is to use
|
||||
dymatic translation a jit, like UAE or QEMU doing
|
||||
converting. But it will lose of allot of speed if
|
||||
it is a game or a havy apps to much. So the idea
|
||||
is to convert the whole file in one sweep. will give
|
||||
one other problem it will be a slow process todo it,
|
||||
and hard dectect self modify program. so not all program
|
||||
can be really convert with this process.
|
||||
|
||||
|
||||
Who will it work
|
||||
we take it step for step and I will describe the
|
||||
binary translations how it works. The PE file
|
||||
work simluare way.
|
||||
|
||||
step 1 : it will disambler the program frist
|
||||
|
||||
step 2 : translate everthing to a middle asm dialect,
|
||||
it is own asm dialect it is not suite for a real
|
||||
|
||||
step 3 : (not implement) send it to ananalysing processs
|
||||
to get any name or mark out which row is a new functions
|
||||
|
||||
step 3.5 (not implement) split the code into functions here
|
||||
|
||||
step 4 : Now it start the convert process.
|
||||
|
||||
step 4.5 (not implement) maybe a optimzer.
|
||||
|
||||
step 5 : now it is finish.
|
||||
|
||||
|
||||
The arch that are plan
|
||||
PPC to IA32, PPC (work in progress)
|
||||
m68k to IA32, PPC (stubed)
|
||||
ARM to IA32, PPC (stubed)
|
||||
IA32 to IA32, PPC (work in progress)
|
||||
|
||||
|
||||
The Winodws NT PPC and x85 diffrent
|
||||
R1 The stack pointer equal with x86 esp
|
||||
R3 The return reg equal with x86 eax
|
||||
R4 The return reg equal with x86 edx
|
||||
R31 The base pointer equal with x86 ebp
|
||||
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
|
||||
#ifndef __ANY_OP_H__
|
||||
#define __ANY_OP_H__
|
||||
|
||||
#define OP_ANY_mov 0x00000000
|
||||
#define OP_ANY_ret 0x00000001
|
||||
|
||||
/* We are using same abi as PPC
|
||||
* eax = register 3
|
||||
* edx = register 4
|
||||
* esp = register 1
|
||||
* ebp = register 31
|
||||
|
||||
* ecx = 8
|
||||
* ebx = 9
|
||||
* esi = 10
|
||||
* edi = 11
|
||||
* mmx/sse/fpu 0 = 12
|
||||
* mmx/sse/fpu 1 = 14
|
||||
* mmx/sse/fpu 2 = 16
|
||||
* mmx/sse/fpu 3 = 18
|
||||
* mmx/sse/fpu 4 = 20
|
||||
* mmx/sse/fpu 5 = 22
|
||||
* mmx/sse/fpu 6 = 24
|
||||
* mmx/sse/fpu 7 = 28
|
||||
*/
|
||||
|
||||
typedef struct _BrainAnalys
|
||||
{
|
||||
CPU_UNINT op; /* one tranlator for any cpu type set our own opcode */
|
||||
CPU_INT type; /* 1 = source are memmory, 2 source are register */
|
||||
/* 4 = dest are memmory, 8 dest are register */
|
||||
/* 16 = source are imm */
|
||||
/* 32 = soucre -xx(r1) or [eax-xx] */
|
||||
/* 64 = dest -xx(r1) or [eax-xx] */
|
||||
/* 128 = update form the src be update with dest */
|
||||
|
||||
CPU_INT src_size; /* who many bits are src not vaild for reg*/
|
||||
CPU_INT dst_size; /* who many bits are dst not vaild for reg*/
|
||||
|
||||
CPU_UNINT64 src;
|
||||
CPU_UNINT64 dst;
|
||||
|
||||
CPU_INT src_extra; /* if type == 32 are set */
|
||||
CPU_INT dst_extra; /* if type == 32 are set */
|
||||
|
||||
CPU_UNINT memAdr; /* where are we in the current memory pos + baseaddress */
|
||||
|
||||
CPU_INT row; /* 0 = no row,
|
||||
* 1 = row is bcc (conditions),
|
||||
* 2 = row is jsr (Call)
|
||||
*/
|
||||
|
||||
/* try translate the Adress to a name */
|
||||
CPU_BYTE* ptr_next; /* hook next one */
|
||||
CPU_BYTE* ptr_prev; /* hook previus one */
|
||||
} MYBrainAnalys, *PMYBrainAnalys;
|
||||
|
||||
extern PMYBrainAnalys pMyBrainAnalys; /* current working address */
|
||||
extern PMYBrainAnalys pStartMyBrainAnalys; /* start address */
|
||||
|
||||
CPU_INT ConvertToIA32Process( FILE *outfp,
|
||||
PMYBrainAnalys pMystart,
|
||||
PMYBrainAnalys pMyend, CPU_INT regbits,
|
||||
CPU_INT HowManyRegInUse,
|
||||
CPU_INT *RegTableCount);
|
||||
|
||||
CPU_INT ConvertToPPCProcess( FILE *outfp,
|
||||
PMYBrainAnalys pMystart,
|
||||
PMYBrainAnalys pMyend, CPU_INT regbits,
|
||||
CPU_INT HowManyRegInUse,
|
||||
CPU_INT *RegTableCount);
|
||||
|
||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||
<module name="cputointel" type="win32cui" installbase="system32" installname="cputointel.exe" stdlib="host">
|
||||
<include base="cputointel">.</include>
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>kernel32</library>
|
||||
<library>user32</library>
|
||||
|
||||
<file>CpuToIntel.c</file>
|
||||
<file>misc.c</file>
|
||||
|
||||
<file>From/ARM/ARMBrain.c</file>
|
||||
<file>From/ARM/ARMopcode.c</file>
|
||||
|
||||
<file>From/IA32/IA32Brain.c</file>
|
||||
<file>From/IA32/IA32opcode.c</file>
|
||||
|
||||
<file>From/m68k/M68kBrain.c</file>
|
||||
<file>From/m68k/M68kopcode.c</file>
|
||||
|
||||
<file>From/PPC/PPCBrain.c</file>
|
||||
<file>From/PPC/PPCopcode.c</file>
|
||||
|
||||
<file>From/dummycpu/DummyBrain.c</file>
|
||||
<file>From/dummycpu/Dummyopcode.c</file>
|
||||
|
||||
<file>ImageLoader.c</file>
|
||||
<file>AnyalsingProcess.c</file>
|
||||
<file>ConvertingProcess.c</file>
|
||||
<file>ConvertToIA32Process.c</file>
|
||||
<file>ConvertToPPCProcess.c</file>
|
||||
|
||||
|
||||
</module>
|
|
@ -1,199 +0,0 @@
|
|||
|
||||
/* only for getting the pe struct */
|
||||
#include <windows.h>
|
||||
#include <winnt.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "misc.h"
|
||||
#include "any_op.h"
|
||||
#include "From/ARM/ARM.h"
|
||||
#include "From/m68k/m68k.h"
|
||||
#include "From/PPC/PPC.h"
|
||||
|
||||
|
||||
/* retun
|
||||
* 0 = Ok
|
||||
* 1 = unimplemt
|
||||
* 2 = Unkonwn Opcode
|
||||
* 3 = can not open read file
|
||||
* 4 = can not open write file
|
||||
* 5 = can not seek to end of read file
|
||||
* 6 = can not get the file size of the read file
|
||||
* 7 = read file size is Zero
|
||||
* 8 = can not alloc memory
|
||||
* 9 = can not read file
|
||||
*-------------------------
|
||||
* type 0 : auto
|
||||
* type 1 : bin
|
||||
* type 2 : exe/dll/sys
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* Conveting bit array to a int byte */
|
||||
CPU_UNINT ConvertBitToByte(CPU_BYTE *bit)
|
||||
{
|
||||
CPU_UNINT Byte = 0;
|
||||
CPU_INT t;
|
||||
CPU_UNINT size = 15;
|
||||
|
||||
for(t=size;t>=0;t--)
|
||||
{
|
||||
if (bit[size-t] != 2)
|
||||
Byte = Byte + (bit[size-t]<<t);
|
||||
}
|
||||
return Byte;
|
||||
}
|
||||
|
||||
/* Conveting bit array mask to a int byte mask */
|
||||
CPU_UNINT GetMaskByte(CPU_BYTE *bit)
|
||||
{
|
||||
CPU_UNINT MaskByte = 0;
|
||||
CPU_INT t;
|
||||
CPU_UNINT size = 15;
|
||||
|
||||
for(t=size;t>=0;t--)
|
||||
{
|
||||
if (bit[size-t] == 2)
|
||||
{
|
||||
MaskByte = MaskByte + ( (bit[size-t]-1) <<t);
|
||||
}
|
||||
}
|
||||
return MaskByte;
|
||||
}
|
||||
|
||||
/* Conveting bit array to a int byte */
|
||||
CPU_UNINT ConvertBitToByte32(CPU_BYTE *bit)
|
||||
{
|
||||
CPU_UNINT Byte = 0;
|
||||
CPU_INT t;
|
||||
CPU_UNINT size = 31;
|
||||
|
||||
for(t=size;t>=0;t--)
|
||||
{
|
||||
if (bit[size-t] != 2)
|
||||
Byte = Byte + (bit[size-t]<<t);
|
||||
}
|
||||
return Byte;
|
||||
}
|
||||
|
||||
/* Conveting bit array mask to a int byte mask */
|
||||
CPU_UNINT GetMaskByte32(CPU_BYTE *bit)
|
||||
{
|
||||
CPU_UNINT MaskByte = 0;
|
||||
CPU_INT t;
|
||||
CPU_UNINT size = 31;
|
||||
|
||||
for(t=size;t>=0;t--)
|
||||
{
|
||||
if (bit[size-t] == 2)
|
||||
{
|
||||
MaskByte = MaskByte + ( (bit[size-t]-1) <<t);
|
||||
}
|
||||
}
|
||||
return MaskByte;
|
||||
}
|
||||
|
||||
|
||||
|
||||
CPU_UNINT GetData32Le(CPU_BYTE *cpu_buffer)
|
||||
{
|
||||
CPU_UNINT cpuint;
|
||||
CPU_UNINT split1;
|
||||
CPU_UNINT split2;
|
||||
CPU_UNINT split3;
|
||||
CPU_UNINT split4;
|
||||
|
||||
cpuint = *((CPU_UNINT*) &cpu_buffer[0]);
|
||||
|
||||
split1 = cpu_buffer[0];
|
||||
split2 = cpu_buffer[1];
|
||||
split3 = cpu_buffer[2];
|
||||
split4 = cpu_buffer[3];
|
||||
|
||||
|
||||
cpuint = split4+(split3 <<8 )+(split2 <<16 )+(split1 <<24 );
|
||||
|
||||
return cpuint;
|
||||
}
|
||||
|
||||
CPU_UNINT GetData32Be(CPU_BYTE *cpu_buffer)
|
||||
{
|
||||
CPU_UNINT cpuint;
|
||||
|
||||
cpuint = *((CPU_UNINT*) &cpu_buffer[0]);
|
||||
|
||||
return cpuint;
|
||||
}
|
||||
|
||||
|
||||
CPU_INT AllocAny()
|
||||
{
|
||||
|
||||
if (pMyBrainAnalys== NULL)
|
||||
{
|
||||
pMyBrainAnalys = (PMYBrainAnalys) malloc(sizeof(MYBrainAnalys));
|
||||
if (pMyBrainAnalys==NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
ZeroMemory(pMyBrainAnalys,sizeof(MYBrainAnalys));
|
||||
pStartMyBrainAnalys = pMyBrainAnalys;
|
||||
}
|
||||
else
|
||||
{
|
||||
PMYBrainAnalys tmp;
|
||||
tmp = (PMYBrainAnalys) malloc(sizeof(MYBrainAnalys));
|
||||
if (tmp==NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
ZeroMemory(tmp,sizeof(MYBrainAnalys));
|
||||
|
||||
pMyBrainAnalys->ptr_next = (CPU_BYTE*)tmp;
|
||||
tmp->ptr_prev= (CPU_BYTE*)pMyBrainAnalys;
|
||||
|
||||
pMyBrainAnalys = tmp;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
CPU_INT FreeAny()
|
||||
{
|
||||
PMYBrainAnalys tmp = NULL;
|
||||
|
||||
if (pMyBrainAnalys == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
tmp = (PMYBrainAnalys)pMyBrainAnalys->ptr_prev;
|
||||
|
||||
while (pMyBrainAnalys != NULL)
|
||||
{
|
||||
if (pMyBrainAnalys == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
free(pMyBrainAnalys);
|
||||
|
||||
if (pMyBrainAnalys != NULL)
|
||||
{
|
||||
printf("fail to free memory");
|
||||
return -1;
|
||||
}
|
||||
|
||||
pMyBrainAnalys = tmp;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
|
||||
|
||||
/* 64bits unsigned */
|
||||
#define CPU_UNINT64 unsigned long long
|
||||
|
||||
/* 32bits */
|
||||
#define CPU_UNINT unsigned int
|
||||
#define CPU_INT int
|
||||
|
||||
/* 16 bits signed */
|
||||
#define CPU_SHORT short
|
||||
|
||||
/* 8bits unsigned */
|
||||
#define CPU_BYTE unsigned char
|
||||
|
||||
/* Prototypes for misc stuff */
|
||||
CPU_INT LoadPFileImage(char *infileName, char *outputfileName, CPU_UNINT BaseAddress, char *cpuid, CPU_UNINT type, CPU_INT mode);
|
||||
CPU_INT PEFileStart( CPU_BYTE *memory, CPU_UNINT pos, CPU_UNINT base, CPU_UNINT size, FILE *outfp, CPU_INT mode);
|
||||
|
||||
CPU_UNINT ConvertBitToByte(CPU_BYTE *bit);
|
||||
CPU_UNINT GetMaskByte(CPU_BYTE *bit);
|
||||
|
||||
CPU_UNINT ConvertBitToByte32(CPU_BYTE *bit);
|
||||
CPU_UNINT GetMaskByte32(CPU_BYTE *bit);
|
||||
|
||||
CPU_UNINT GetData32Le(CPU_BYTE *cpu_buffer);
|
||||
CPU_UNINT GetData32Be(CPU_BYTE *cpu_buffer);
|
||||
|
||||
CPU_INT AllocAny();
|
||||
CPU_INT FreeAny();
|
||||
CPU_INT AnyalsingProcess();
|
||||
|
||||
CPU_INT ConvertProcess(FILE *outfp, CPU_INT FromCpuid, CPU_INT ToCpuid);
|
||||
|
||||
|
|
@ -12,20 +12,16 @@
|
|||
<xi:include href="genguid/genguid.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="roswebparser">
|
||||
<xi:include href="roswebparser/roswebparser.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="syscalldump">
|
||||
<xi:include href="syscalldump/syscalldump.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="symdump">
|
||||
<xi:include href="symdump/symdump.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="vgafontedit">
|
||||
<xi:include href="vgafontedit/vgafontedit.rbuild" />
|
||||
</directory>
|
||||
|
||||
<directory name="zoomin">
|
||||
<xi:include href="zoomin/zoomin.rbuild" />
|
||||
</directory>
|
||||
</group>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define PARAMS_SEPARATOR " "
|
||||
#define PARAMS_SEPARATOR_LEN strlen(PARAMS_SEPARATOR);
|
||||
|
||||
void DisplayError(char *pszAPI);
|
||||
void DisplayError(const char *pszAPI);
|
||||
void ReadAndHandleOutput(HANDLE hPipeRead);
|
||||
void PrepAndLaunchRedirectedChild(HANDLE hChildStdOut,
|
||||
HANDLE hChildStdIn,
|
||||
|
@ -177,6 +177,7 @@ void PrepAndLaunchRedirectedChild(HANDLE hChildStdOut,
|
|||
{
|
||||
PROCESS_INFORMATION pi;
|
||||
STARTUPINFO si;
|
||||
static CHAR Title[] = "debugged program console";
|
||||
|
||||
// Set up the start up info struct.
|
||||
ZeroMemory(&si,sizeof(STARTUPINFO));
|
||||
|
@ -185,7 +186,7 @@ void PrepAndLaunchRedirectedChild(HANDLE hChildStdOut,
|
|||
si.hStdOutput = hChildStdOut;
|
||||
si.hStdInput = hChildStdIn;
|
||||
si.hStdError = hChildStdErr;
|
||||
si.lpTitle = "debugged program console";
|
||||
si.lpTitle = Title;
|
||||
// Use this if you want to hide the child:
|
||||
// si.wShowWindow = SW_HIDE;
|
||||
// Note that dwFlags must include STARTF_USESHOWWINDOW if you want to
|
||||
|
@ -274,7 +275,7 @@ DWORD WINAPI GetAndSendInputThread(LPVOID lpvThreadParam)
|
|||
// DisplayError
|
||||
// Displays the error number and corresponding message.
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
void DisplayError(char *pszAPI)
|
||||
void DisplayError(const char *pszAPI)
|
||||
{
|
||||
LPVOID lpvMessageBuffer;
|
||||
CHAR szPrintBuffer[512];
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
<module name="gdb2" type="win32cui" installbase="system32" installname="gdb2.exe" stdlib="host">
|
||||
<include base="gdb2">.</include>
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>kernel32</library>
|
||||
<library>user32</library>
|
||||
<file>gdb2.cpp</file>
|
||||
</module>
|
|
@ -1,9 +1,6 @@
|
|||
<module name="gdihv" type="win32gui" installbase="system32" installname="gdihv.exe">
|
||||
<include base="gdihv">.</include>
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>user32</library>
|
||||
<library>kernel32</library>
|
||||
<library>comctl32</library>
|
||||
<library>psapi</library>
|
||||
<file>gdihv.c</file>
|
||||
|
|
|
@ -83,9 +83,10 @@ HandleList_Update(HWND hHandleListCtrl, HANDLE ProcessId)
|
|||
{
|
||||
pEntry = &GdiHandleTable[i];
|
||||
if ( ((ProcessId != (HANDLE)1) && ((pEntry->Type & GDI_HANDLE_BASETYPE_MASK) != 0)) ||
|
||||
((ProcessId == (HANDLE)1) && ((pEntry->Type & GDI_HANDLE_BASETYPE_MASK) == 0)) )
|
||||
((ProcessId == (HANDLE)1) && ((pEntry->Type & GDI_HANDLE_BASETYPE_MASK) == 0)) ||
|
||||
(ProcessId == (HANDLE)2) )
|
||||
{
|
||||
if (ProcessId == (HANDLE)1 ||
|
||||
if (ProcessId == (HANDLE)1 || ProcessId == (HANDLE)2 ||
|
||||
((LONG)ProcessId & 0xfffc) == ((ULONG)pEntry->ProcessId & 0xfffc))
|
||||
{
|
||||
handle = GDI_HANDLE_CREATE(i, pEntry->Type);
|
||||
|
|
|
@ -73,6 +73,15 @@ ProcessList_Update(HWND hListCtrl)
|
|||
wsprintf(strText, L"%#08x",1);
|
||||
ListView_SetItemText(hListCtrl, 1, 1, strText);
|
||||
|
||||
/* Insert "all" */
|
||||
item.iItem = 2;
|
||||
item.lParam = 2;
|
||||
item.pszText = L"<all>";
|
||||
(void)ListView_InsertItem(hListCtrl, &item);
|
||||
item.pszText = strText;
|
||||
wsprintf(strText, L"%#08x", 2);
|
||||
ListView_SetItemText(hListCtrl, 1, 1, strText);
|
||||
|
||||
if (!EnumProcesses(ProcessIds, sizeof(ProcessIds), &BytesReturned ))
|
||||
{
|
||||
return;
|
||||
|
|
|
@ -23,8 +23,7 @@
|
|||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
GUID m_guid;
|
||||
m_guid = GUID_NULL;
|
||||
GUID m_guid = GUID_NULL;
|
||||
int arg;
|
||||
HRESULT result;
|
||||
char *strfmt = "";
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
<module name="genguid" type="win32cui" installbase="system32" installname="genguid.exe">
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>kernel32</library>
|
||||
<library>ole32</library>
|
||||
<library>uuid</library>
|
||||
<file>genguid.c</file>
|
||||
</module>
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Windows OEM 457 code page table. need by english rc files, area 0x80 to 0x9f should be blank
|
||||
*/
|
||||
|
||||
unsigned short table_Windows28591[256] =
|
||||
{
|
||||
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009,
|
||||
0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013,
|
||||
0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D,
|
||||
0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
|
||||
0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031,
|
||||
0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B,
|
||||
0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045,
|
||||
0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
|
||||
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
|
||||
0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063,
|
||||
0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D,
|
||||
0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
|
||||
0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081,
|
||||
0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B,
|
||||
0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095,
|
||||
0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
|
||||
0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9,
|
||||
0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, 0x00B3,
|
||||
0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD,
|
||||
0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
|
||||
0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1,
|
||||
0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB,
|
||||
0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5,
|
||||
0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
|
||||
0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9,
|
||||
0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF};
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* Windows OEM 457 code page table. need by english rc files, area 0x80 to 0x9f should be blank
|
||||
*/
|
||||
|
||||
unsigned short table_Windows28592[256] =
|
||||
{
|
||||
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009,
|
||||
0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013,
|
||||
0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D,
|
||||
0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
|
||||
0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031,
|
||||
0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B,
|
||||
0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045,
|
||||
0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
|
||||
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
|
||||
0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063,
|
||||
0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D,
|
||||
0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
|
||||
0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, 0x0081,
|
||||
0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008A, 0x008B,
|
||||
0x008C, 0x008D, 0x008E, 0x008F, 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095,
|
||||
0x0096, 0x0097, 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
|
||||
0x00A0, 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, 0x00A8, 0x0160,
|
||||
0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B, 0x00B0, 0x0105, 0x02DB, 0x0142,
|
||||
0x00B4, 0x013E, 0x015B, 0x02C7, 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD,
|
||||
0x017E, 0x017C, 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7,
|
||||
0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, 0x0110, 0x0143,
|
||||
0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158, 0x016E, 0x00DA, 0x0170,
|
||||
0x00DC, 0x00DD, 0x0162, 0x00DF, 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A,
|
||||
0x0107, 0x00E7, 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
|
||||
0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, 0x0159, 0x016F,
|
||||
0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9};
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
/*
|
||||
* Windows OEM 457 code page table. need by english rc files
|
||||
*/
|
||||
|
||||
unsigned short table_OEM437[256] =
|
||||
{
|
||||
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009,
|
||||
0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013,
|
||||
0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D,
|
||||
0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
|
||||
0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031,
|
||||
0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B,
|
||||
0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045,
|
||||
0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
|
||||
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
|
||||
0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063,
|
||||
0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D,
|
||||
0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
|
||||
0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x00C7, 0x00FC,
|
||||
0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF,
|
||||
0x00EE, 0x00EC, 0x00C4, 0x00C5, 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2,
|
||||
0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192,
|
||||
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x2310,
|
||||
0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, 0x2591, 0x2592, 0x2593, 0x2502,
|
||||
0x2524, 0x2561, 0x2562, 0x2556, 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C,
|
||||
0x255B, 0x2510, 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
|
||||
0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567, 0x2568, 0x2564,
|
||||
0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B, 0x256A, 0x2518, 0x250C, 0x2588,
|
||||
0x2584, 0x258C, 0x2590, 0x2580, 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3,
|
||||
0x00B5, 0x03C4, 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229,
|
||||
0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248, 0x00B0, 0x2219,
|
||||
0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0};
|
||||
|
||||
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Windows OEM 850 code page table. need by english rc files
|
||||
*/
|
||||
|
||||
unsigned short table_OEM850[256] =
|
||||
{
|
||||
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009,
|
||||
0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011, 0x0012, 0x0013,
|
||||
0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D,
|
||||
0x001E, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
|
||||
0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, 0x0030, 0x0031,
|
||||
0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B,
|
||||
0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045,
|
||||
0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
|
||||
0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
|
||||
0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063,
|
||||
0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D,
|
||||
0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077,
|
||||
0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x00C7, 0x00FC,
|
||||
0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, 0x00EA, 0x00EB, 0x00E8, 0x00EF,
|
||||
0x00EE, 0x00EC, 0x00C4, 0x00C5, 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2,
|
||||
0x00FB, 0x00F9, 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192,
|
||||
0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, 0x00BF, 0x00AE,
|
||||
0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, 0x2591, 0x2592, 0x2593, 0x2502,
|
||||
0x2524, 0x00C1, 0x00C2, 0x00C0, 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2,
|
||||
0x00A5, 0x2510, 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3,
|
||||
0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4, 0x00F0, 0x00D0,
|
||||
0x00CA, 0x00CB, 0x00C8, 0x0131, 0x00CD, 0x00CE, 0x00CF, 0x2518, 0x250C, 0x2588,
|
||||
0x2584, 0x00A6, 0x00CC, 0x2580, 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5,
|
||||
0x00B5, 0x00FE, 0x00DE, 0x00DA, 0x00DB, 0x00D9, 0x00FD, 0x00DD, 0x00AF, 0x00B4,
|
||||
0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8, 0x00B0, 0x00A8,
|
||||
0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0};
|
File diff suppressed because it is too large
Load diff
|
@ -1,10 +0,0 @@
|
|||
<module name="roswebparser" type="win32cui" installbase="system32" installname="roswebparser.exe" allowwarnings ="true">
|
||||
<include base="zoomin">.</include>
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
|
||||
<library>kernel32</library>
|
||||
|
||||
<file>roswebparser.c</file>
|
||||
<file>utf8.c</file>
|
||||
</module>
|
|
@ -1,75 +0,0 @@
|
|||
|
||||
/*
|
||||
* Convert ansi to utf-8
|
||||
* it does not support more that utf-16
|
||||
* the table we are using is base on utf-16 then we convert the table to utf-8
|
||||
*
|
||||
* All table lookup the ansi char to utf-16 then we calc the utf-8 format.
|
||||
*/
|
||||
|
||||
#include "oem437.h" /* windows oem 437 */
|
||||
#include "oem850.h" /* windows oem 850 */
|
||||
#include "Windows28591.h" /* windows 28591 aka ISO-2859-1 (Latin 1) */
|
||||
#include "Windows28592.h" /* windows 28592 aka ISO-2859-2 (Latin 2) */
|
||||
|
||||
int ansiCodePage(int codepage, unsigned char *inBuffer, unsigned char *outBuffer, int Lenght)
|
||||
{
|
||||
int t;
|
||||
int ch;
|
||||
int pos=0;
|
||||
|
||||
for (t=0;t<Lenght;t++)
|
||||
{
|
||||
ch=-1;
|
||||
if (codepage == 437)
|
||||
{
|
||||
ch = (int) table_OEM437[ ((unsigned char)inBuffer[t])];
|
||||
}
|
||||
|
||||
if (codepage == 850)
|
||||
{
|
||||
ch = (int) table_OEM850[ ((unsigned char)inBuffer[t])];
|
||||
}
|
||||
|
||||
if (codepage == 28591)
|
||||
{
|
||||
ch = (int) table_Windows28591[ ((unsigned char)inBuffer[t])];
|
||||
}
|
||||
if (codepage == 28592)
|
||||
{
|
||||
ch = (int) table_Windows28592[ ((unsigned char)inBuffer[t])];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (ch == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (ch <= 0x7F)
|
||||
{
|
||||
outBuffer[pos]=ch;
|
||||
pos++;
|
||||
}
|
||||
else if (ch <=0x07FF) // 1 1111 11 1111
|
||||
{
|
||||
outBuffer[pos]= 0xC0 | (0x1F & (ch >> 6)); // 110x xxxx
|
||||
outBuffer[pos+1]= 0x80 | (0x3f & ch); // 11xx xxxx
|
||||
pos+=2;
|
||||
}
|
||||
|
||||
else if (ch <=0xFFFF) // 11 11 11 11 11 11 11 11
|
||||
{
|
||||
outBuffer[pos]= 0xC2 | (0xf & (ch >> 12)); // 1110xxxx
|
||||
outBuffer[pos+1]= 0x80 | (0x3f & (ch >> 6)); // 10xxxxxx
|
||||
outBuffer[pos+1]= 0x80 | (0x3f & ch); // 10xxxxxx
|
||||
pos+=3;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
991
rosapps/applications/devutils/symdump/symdump.c
Normal file
991
rosapps/applications/devutils/symdump/symdump.c
Normal file
|
@ -0,0 +1,991 @@
|
|||
/*
|
||||
* PE symbol dumper
|
||||
*
|
||||
* symdump.c
|
||||
*
|
||||
* Copyright (c) 2008 Timo Kreuzer <timo <dot> kreuzer <at> reactos <dot> org>
|
||||
*
|
||||
* This program is released under the terms of the GNU GPL.
|
||||
*
|
||||
* TODO:
|
||||
* - fix GDILoObjType
|
||||
* - fix UDTKind1
|
||||
* - include the correct headers for some stuff
|
||||
* - fix unions like LARGE_INTEGER
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#define _WINVER 0x501
|
||||
#include <windows.h>
|
||||
#include <shlwapi.h>
|
||||
#include <dbghelp.h>
|
||||
|
||||
HANDLE hCurrentProcess;
|
||||
BOOL g_bShowPos = 0;
|
||||
|
||||
#define MAX_SYMBOL_NAME 1024
|
||||
|
||||
#define CV_CALL_NEAR_C 0x00
|
||||
#define CV_CALL_FAR_C 0x01
|
||||
#define CV_CALL_NEAR_PASCAL 0x02
|
||||
#define CV_CALL_FAR_PASCAL 0x03
|
||||
#define CV_CALL_NEAR_FAST 0x04
|
||||
#define CV_CALL_FAR_FAST 0x05
|
||||
#define CV_CALL_SKIPPED 0x06
|
||||
#define CV_CALL_NEAR_STD 0x07
|
||||
#define CV_CALL_FAR_STD 0x08
|
||||
#define CV_CALL_NEAR_SYS 0x09
|
||||
#define CV_CALL_FAR_SYS 0x0a
|
||||
#define CV_CALL_THISCALL 0x0b
|
||||
#define CV_CALL_MIPSCALL 0x0c
|
||||
#define CV_CALL_GENERIC 0x0d
|
||||
#define CV_CALL_ALPHACALL 0x0e
|
||||
#define CV_CALL_PPCCALL 0x0f
|
||||
#define CV_CALL_SHCALL 0x10
|
||||
#define CV_CALL_ARMCALL 0x11
|
||||
#define CV_CALL_AM33CALL 0x12
|
||||
#define CV_CALL_TRICALL 0x13
|
||||
#define CV_CALL_SH5CALL 0x14
|
||||
#define CV_CALL_M32RCALL 0x15
|
||||
|
||||
enum SymTagEnum
|
||||
{
|
||||
SymTagNull,
|
||||
SymTagExe,
|
||||
SymTagCompiland,
|
||||
SymTagCompilandDetails,
|
||||
SymTagCompilandEnv,
|
||||
SymTagFunction,
|
||||
SymTagBlock,
|
||||
SymTagData,
|
||||
SymTagAnnotation,
|
||||
SymTagLabel,
|
||||
SymTagPublicSymbol,
|
||||
SymTagUDT,
|
||||
SymTagEnum,
|
||||
SymTagFunctionType,
|
||||
SymTagPointerType,
|
||||
SymTagArrayType,
|
||||
SymTagBaseType,
|
||||
SymTagTypedef,
|
||||
SymTagBaseClass,
|
||||
SymTagFriend,
|
||||
SymTagFunctionArgType,
|
||||
SymTagFuncDebugStart,
|
||||
SymTagFuncDebugEnd,
|
||||
SymTagUsingNamespace,
|
||||
SymTagVTableShape,
|
||||
SymTagVTable,
|
||||
SymTagCustom,
|
||||
SymTagThunk,
|
||||
SymTagCustomType,
|
||||
SymTagManagedType,
|
||||
SymTagDimension,
|
||||
SymTagMax
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
UDTKind_Struct = 0,
|
||||
UDTKind_Class = 1, /* ? */
|
||||
UDTKind_Union = 2,
|
||||
};
|
||||
|
||||
enum BasicType
|
||||
{
|
||||
btNoType = 0,
|
||||
btVoid = 1,
|
||||
btChar = 2,
|
||||
btWChar = 3,
|
||||
btInt = 6,
|
||||
btUInt = 7,
|
||||
btFloat = 8,
|
||||
btBCD = 9,
|
||||
btBool = 10,
|
||||
btLong = 13,
|
||||
btULong = 14,
|
||||
btCurrency = 25,
|
||||
btDate = 26,
|
||||
btVariant = 27,
|
||||
btComplex = 28,
|
||||
btBit = 29,
|
||||
btBSTR = 30,
|
||||
btHresult = 31
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
HANDLE hProcess;
|
||||
DWORD64 dwModuleBase;
|
||||
LPSTR pszSymbolName;
|
||||
BOOL bType;
|
||||
} ENUMINFO, *PENUMINFO;
|
||||
|
||||
VOID DumpType(DWORD dwTypeIndex, PENUMINFO pei, INT indent, BOOL bMembers);
|
||||
|
||||
CHAR *SymTagString[] =
|
||||
{
|
||||
"SymTagNull",
|
||||
"SymTagExe",
|
||||
"SymTagCompiland",
|
||||
"SymTagCompilandDetails",
|
||||
"SymTagCompilandEnv",
|
||||
"SymTagFunction",
|
||||
"SymTagBlock",
|
||||
"SymTagData",
|
||||
"SymTagAnnotation",
|
||||
"SymTagLabel",
|
||||
"SymTagPublicSymbol",
|
||||
"SymTagUDT",
|
||||
"SymTagEnum",
|
||||
"SymTagFunctionType",
|
||||
"SymTagPointerType",
|
||||
"SymTagArrayType",
|
||||
"SymTagBaseType",
|
||||
"SymTagTypedef",
|
||||
"SymTagBaseClass",
|
||||
"SymTagFriend",
|
||||
"SymTagFunctionArgType",
|
||||
"SymTagFuncDebugStart",
|
||||
"SymTagFuncDebugEnd",
|
||||
"SymTagUsingNamespace",
|
||||
"SymTagVTableShape",
|
||||
"SymTagVTable",
|
||||
"SymTagCustom",
|
||||
"SymTagThunk",
|
||||
"SymTagCustomType",
|
||||
"SymTagManagedType",
|
||||
"SymTagDimension",
|
||||
"SymTagMax"
|
||||
};
|
||||
|
||||
void
|
||||
IndentPrint(INT ind)
|
||||
{
|
||||
INT i;
|
||||
for (i = 0; i < ind; i++)
|
||||
{
|
||||
printf(" ");
|
||||
}
|
||||
}
|
||||
|
||||
#define printfi \
|
||||
IndentPrint(indent); printf
|
||||
|
||||
VOID
|
||||
PrintUsage()
|
||||
{
|
||||
printf("Syntax:\n\n");
|
||||
printf("dumpsym <file> [-sp=<symbolpath>] [-p] [<symname>]\n\n");
|
||||
printf("<file> The PE file you want to dump the symbols of\n");
|
||||
printf("-sp=<symbolpath> Path to your symbol files.\n");
|
||||
printf(" Default is MS symbol server.\n");
|
||||
printf("-p Enable struct positions.\n");
|
||||
printf("<symname> A name of a Symbol, you want to dump\n");
|
||||
printf(" Default is all symbols.\n");
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
BOOL InitDbgHelp(HANDLE hProcess, LPSTR pszSymbolPath)
|
||||
{
|
||||
if (!SymInitialize(hProcess, 0, FALSE))
|
||||
return FALSE;
|
||||
|
||||
SymSetOptions(SymGetOptions() | SYMOPT_ALLOW_ABSOLUTE_SYMBOLS);
|
||||
SymSetOptions(SymGetOptions() & (~SYMOPT_DEFERRED_LOADS));
|
||||
SymSetSearchPath(hProcess, pszSymbolPath);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
VOID
|
||||
DumpBaseType(DWORD dwTypeIndex, PENUMINFO pei, INT indent)
|
||||
{
|
||||
ULONG64 ulSize;
|
||||
DWORD dwBaseType;
|
||||
|
||||
SymGetTypeInfo(pei->hProcess, pei->dwModuleBase, dwTypeIndex, TI_GET_LENGTH, &ulSize);
|
||||
SymGetTypeInfo(pei->hProcess, pei->dwModuleBase, dwTypeIndex, TI_GET_BASETYPE, &dwBaseType);
|
||||
|
||||
switch (dwBaseType)
|
||||
{
|
||||
case btVoid:
|
||||
printfi("VOID");
|
||||
return;
|
||||
case btChar:
|
||||
printfi("CHAR");
|
||||
return;
|
||||
case btWChar:
|
||||
printfi("WCHAR");
|
||||
return;
|
||||
case btInt:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 1:
|
||||
printfi("CHAR");
|
||||
return;
|
||||
case 2:
|
||||
printfi("SHORT");
|
||||
return;
|
||||
case 4:
|
||||
printfi("INT");
|
||||
return;
|
||||
case 8:
|
||||
printfi("INT64");
|
||||
return;
|
||||
default:
|
||||
printfi("INT%ld", (ULONG)ulSize * 8);
|
||||
return;
|
||||
}
|
||||
case btUInt:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 1:
|
||||
printfi("UCHAR");
|
||||
return;
|
||||
case 2:
|
||||
printfi("USHORT");
|
||||
return;
|
||||
case 4:
|
||||
printfi("UINT");
|
||||
return;
|
||||
case 8:
|
||||
printfi("UINT64");
|
||||
return;
|
||||
default:
|
||||
printfi("UINT%ld", (ULONG)ulSize * 8);
|
||||
return;
|
||||
}
|
||||
case btFloat:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 4:
|
||||
printfi("FLOAT");
|
||||
return;
|
||||
case 8:
|
||||
printfi("DOUBLE");
|
||||
return;
|
||||
default:
|
||||
printfi("FLOAT%ld", (ULONG)ulSize * 8);
|
||||
return;
|
||||
}
|
||||
case btBCD:
|
||||
printfi("BCD%ld", (ULONG)ulSize * 8);
|
||||
return;
|
||||
case btBool:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 1:
|
||||
printfi("BOOLEAN");
|
||||
return;
|
||||
case 4:
|
||||
printfi("BOOL");
|
||||
return;
|
||||
default:
|
||||
printfi("BOOL%ld", (ULONG)ulSize * 8);
|
||||
return;
|
||||
}
|
||||
case btLong:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 1:
|
||||
printfi("CHAR");
|
||||
return;
|
||||
case 2:
|
||||
printfi("SHORT");
|
||||
return;
|
||||
case 4:
|
||||
printfi("LONG");
|
||||
return;
|
||||
case 8:
|
||||
printfi("LONGLONG");
|
||||
return;
|
||||
default:
|
||||
printfi("LONG%ld", (ULONG)ulSize * 8);
|
||||
return;
|
||||
}
|
||||
case btULong:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 1:
|
||||
printfi("UCHAR");
|
||||
return;
|
||||
case 2:
|
||||
printfi("USHORT");
|
||||
return;
|
||||
case 4:
|
||||
printfi("ULONG");
|
||||
return;
|
||||
case 8:
|
||||
printfi("ULONGLONG");
|
||||
return;
|
||||
default:
|
||||
printfi("ULONG%ld", (ULONG)ulSize * 8);
|
||||
return;
|
||||
}
|
||||
case btCurrency:
|
||||
case btDate:
|
||||
case btVariant:
|
||||
case btComplex:
|
||||
case btBit:
|
||||
case btBSTR:
|
||||
printfi("UNSUP_%ld_%ld", dwBaseType, (ULONG)ulSize);
|
||||
return;
|
||||
case btHresult:
|
||||
if (ulSize == 4)
|
||||
{
|
||||
printfi("HRESULT");
|
||||
return;
|
||||
}
|
||||
printfi("HRESULT%ld", (ULONG)ulSize);
|
||||
return;
|
||||
}
|
||||
|
||||
printfi("UNKNBASETYPE");
|
||||
}
|
||||
|
||||
VOID
|
||||
DumpArray(DWORD dwTypeIndex, PENUMINFO pei, INT indent)
|
||||
{
|
||||
DWORD dwTypeId;
|
||||
|
||||
SymGetTypeInfo(pei->hProcess, pei->dwModuleBase, dwTypeIndex, TI_GET_TYPE, &dwTypeId);
|
||||
DumpType(dwTypeId, pei, indent, FALSE);
|
||||
}
|
||||
|
||||
VOID
|
||||
DumpPointer(DWORD dwTypeIndex, PENUMINFO pei, INT indent)
|
||||
{
|
||||
DWORD dwRefTypeId;
|
||||
DWORD dwTag = 0;
|
||||
ULONG64 ulSize;
|
||||
DWORD dwBaseType;
|
||||
|
||||
SymGetTypeInfo(pei->hProcess, pei->dwModuleBase, dwTypeIndex, TI_GET_TYPE, &dwRefTypeId);
|
||||
SymGetTypeInfo(pei->hProcess, pei->dwModuleBase, dwRefTypeId, TI_GET_BASETYPE, &dwBaseType);
|
||||
SymGetTypeInfo(pei->hProcess, pei->dwModuleBase, dwRefTypeId, TI_GET_LENGTH, &ulSize);
|
||||
SymGetTypeInfo(pei->hProcess, pei->dwModuleBase, dwRefTypeId, TI_GET_SYMTAG, &dwTag);
|
||||
|
||||
if (dwTag == SymTagFunctionType)
|
||||
{
|
||||
printfi("PPROC");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (dwBaseType)
|
||||
{
|
||||
case btVoid:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 0:
|
||||
printfi("PVOID");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case btChar:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 1:
|
||||
printfi("PCHAR");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case btWChar:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 2:
|
||||
printfi("PWCHAR");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case btInt:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 4:
|
||||
printfi("PINT");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case btUInt:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 4:
|
||||
printfi("PUINT");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case btFloat:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 4:
|
||||
printfi("PFLOAT");
|
||||
return;
|
||||
case 8:
|
||||
printfi("PDOUBLE");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case btBCD:
|
||||
break;
|
||||
case btBool:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 1:
|
||||
printfi("PBOOLEAN");
|
||||
return;
|
||||
case 4:
|
||||
printfi("PBOOL");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case btLong:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 4:
|
||||
printfi("PLONG");
|
||||
return;
|
||||
case 8:
|
||||
printfi("PLONGLONG");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case btULong:
|
||||
switch (ulSize)
|
||||
{
|
||||
case 4:
|
||||
printfi("PULONG");
|
||||
return;
|
||||
case 8:
|
||||
printfi("PULONGLONG");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case btCurrency:
|
||||
case btDate:
|
||||
case btVariant:
|
||||
case btComplex:
|
||||
case btBit:
|
||||
case btBSTR:
|
||||
case btHresult:
|
||||
break;
|
||||
}
|
||||
|
||||
DumpType(dwRefTypeId, pei, indent, FALSE);
|
||||
printf("*");
|
||||
}
|
||||
|
||||
VOID
|
||||
PrintVariant(VARIANT *v)
|
||||
{
|
||||
// printf("<vt%d>", v->n1.n2.vt);
|
||||
switch (v->n1.n2.vt)
|
||||
{
|
||||
case VT_I1:
|
||||
printf("%d", (INT)v->n1.n2.n3.cVal);
|
||||
break;
|
||||
case VT_UI1:
|
||||
printf("0x%x", (UINT)v->n1.n2.n3.cVal);
|
||||
break;
|
||||
case VT_I2:
|
||||
printf("%d", (UINT)v->n1.n2.n3.iVal);
|
||||
break;
|
||||
case VT_UI2:
|
||||
printf("0x%x", (UINT)v->n1.n2.n3.iVal);
|
||||
break;
|
||||
case VT_INT:
|
||||
case VT_I4:
|
||||
printf("%d", (UINT)v->n1.n2.n3.lVal);
|
||||
break;
|
||||
case VT_UINT:
|
||||
case VT_UI4:
|
||||
printf("0x%x", (UINT)v->n1.n2.n3.lVal);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL
|
||||
IsUnnamed(WCHAR *pszName)
|
||||
{
|
||||
if ((StrStrW(pszName, L"__unnamed") != NULL) ||
|
||||
(StrStrW(pszName, L"<unnamed-tag>") != NULL))
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
VOID
|
||||
DumpEnum(DWORD dwTypeIndex, PENUMINFO pei, INT indent, BOOL bMembers)
|
||||
{
|
||||
DWORD64 dwModuleBase = pei->dwModuleBase;
|
||||
HANDLE hProcess = pei->hProcess;
|
||||
INT i;
|
||||
DWORD dwUDTKind;
|
||||
WCHAR *pszName, *pszNameX;
|
||||
struct
|
||||
{
|
||||
TI_FINDCHILDREN_PARAMS tfp;
|
||||
ULONG TypeIds[200];
|
||||
} tfpex;
|
||||
VARIANT v;
|
||||
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeIndex, TI_GET_SYMNAME, &pszNameX);
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeIndex, TI_GET_UDTKIND, &dwUDTKind);
|
||||
pszName = pszNameX;
|
||||
if (IsUnnamed(pszName))
|
||||
{
|
||||
if (bMembers)
|
||||
{
|
||||
LocalFree(pszNameX);
|
||||
return;
|
||||
}
|
||||
bMembers = TRUE;
|
||||
pszName = L"";
|
||||
}
|
||||
printfi("enum %ls", pszName);
|
||||
LocalFree(pszNameX);
|
||||
|
||||
if (bMembers)
|
||||
{
|
||||
printf(" /* %03x */", 0);
|
||||
printfi("\n{\n");
|
||||
|
||||
/* Get the children */
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeIndex, TI_GET_CHILDRENCOUNT, &tfpex.tfp.Count);
|
||||
|
||||
tfpex.tfp.Start = 0;
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeIndex, TI_FINDCHILDREN, &tfpex.tfp);
|
||||
|
||||
for (i = 0; i < tfpex.tfp.Count; i++)
|
||||
{
|
||||
pszName = L"";
|
||||
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, tfpex.tfp.ChildId[i], TI_GET_SYMNAME, &pszName);
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, tfpex.tfp.ChildId[i], TI_GET_VALUE, &v);
|
||||
|
||||
indent++;
|
||||
printfi("%ls = ", pszName);
|
||||
PrintVariant(&v);
|
||||
printf(",\n");
|
||||
indent--;
|
||||
|
||||
LocalFree(pszName);
|
||||
}
|
||||
printfi("}");
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
DumpUDT(DWORD dwTypeIndex, PENUMINFO pei, INT indent, BOOL bMembers)
|
||||
{
|
||||
DWORD64 dwModuleBase = pei->dwModuleBase;
|
||||
HANDLE hProcess = pei->hProcess;
|
||||
INT i;
|
||||
DWORD dwUDTKind;
|
||||
WCHAR *pszName, *pszNameX;
|
||||
struct
|
||||
{
|
||||
TI_FINDCHILDREN_PARAMS tfp;
|
||||
ULONG TypeIds[200];
|
||||
} tfpex;
|
||||
|
||||
DWORD dwDataKind;
|
||||
DWORD dwTypeId;
|
||||
DWORD dwCount;
|
||||
WCHAR *pszTypeName;
|
||||
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeIndex, TI_GET_SYMNAME, &pszNameX);
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeIndex, TI_GET_UDTKIND, &dwUDTKind);
|
||||
|
||||
pszName = pszNameX;
|
||||
if (IsUnnamed(pszName))
|
||||
{
|
||||
if (bMembers)
|
||||
{
|
||||
LocalFree(pszNameX);
|
||||
return;
|
||||
}
|
||||
bMembers = TRUE;
|
||||
pszName = L"";
|
||||
}
|
||||
if (dwUDTKind == UDTKind_Struct)
|
||||
{
|
||||
printfi("struct %ls", pszName);
|
||||
}
|
||||
else if (dwUDTKind == UDTKind_Union)
|
||||
{
|
||||
printfi("union %ls", pszName);
|
||||
}
|
||||
else
|
||||
{
|
||||
printfi("UTDKind%ld %ls", dwUDTKind, pszName);
|
||||
}
|
||||
LocalFree(pszNameX);
|
||||
|
||||
if (bMembers)
|
||||
{
|
||||
ULONG64 ulLength;
|
||||
|
||||
printf("\n");
|
||||
printfi("{\n");
|
||||
|
||||
/* Get the children */
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeIndex, TI_GET_CHILDRENCOUNT, &tfpex.tfp.Count);
|
||||
|
||||
tfpex.tfp.Start = 0;
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeIndex, TI_FINDCHILDREN, &tfpex.tfp);
|
||||
|
||||
for (i = 0; i < tfpex.tfp.Count; i++)
|
||||
{
|
||||
DWORD dwChildTag;
|
||||
DWORD dwOffset;
|
||||
|
||||
pszName = L"";
|
||||
pszTypeName = L"";
|
||||
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, tfpex.tfp.ChildId[i], TI_GET_SYMNAME, &pszName);
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, tfpex.tfp.ChildId[i], TI_GET_DATAKIND, &dwDataKind);
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, tfpex.tfp.ChildId[i], TI_GET_TYPE, &dwTypeId);
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, tfpex.tfp.ChildId[i], TI_GET_OFFSET, &dwOffset);
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeId, TI_GET_SYMTAG, &dwChildTag);
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeId, TI_GET_LENGTH, &ulLength);
|
||||
|
||||
printf(" /* %03lx */", dwOffset);
|
||||
DumpType(dwTypeId, pei, indent + 1, FALSE);
|
||||
printf(" %ls", pszName);
|
||||
if (dwChildTag == SymTagArrayType)
|
||||
{
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeId, TI_GET_COUNT, &dwCount);
|
||||
printf("[%ld]", dwCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
DWORD dwCurrentBitPos;
|
||||
DWORD dwNextBitPos;
|
||||
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, tfpex.tfp.ChildId[i], TI_GET_BITPOSITION, &dwCurrentBitPos);
|
||||
if (i < tfpex.tfp.Count - 1)
|
||||
{
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, tfpex.tfp.ChildId[i+1], TI_GET_BITPOSITION, &dwNextBitPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
dwNextBitPos = 0;
|
||||
}
|
||||
|
||||
if (dwNextBitPos == 0 && dwCurrentBitPos != 0)
|
||||
{
|
||||
dwNextBitPos = ulLength * 8;
|
||||
}
|
||||
|
||||
if (dwNextBitPos != dwCurrentBitPos)
|
||||
{
|
||||
printf(":%ld", dwNextBitPos - dwCurrentBitPos);
|
||||
}
|
||||
}
|
||||
printf(";\n");
|
||||
LocalFree(pszName);
|
||||
}
|
||||
printfi("}");
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
DumpType(DWORD dwTypeIndex, PENUMINFO pei, INT indent, BOOL bMembers)
|
||||
{
|
||||
HANDLE hProcess = pei->hProcess;
|
||||
DWORD64 dwModuleBase = pei->dwModuleBase;
|
||||
DWORD dwTag = 0;
|
||||
|
||||
SymGetTypeInfo(hProcess, dwModuleBase, dwTypeIndex, TI_GET_SYMTAG, &dwTag);
|
||||
|
||||
switch (dwTag)
|
||||
{
|
||||
case SymTagEnum:
|
||||
DumpEnum(dwTypeIndex, pei, indent, bMembers);
|
||||
break;
|
||||
|
||||
case SymTagUDT:
|
||||
DumpUDT(dwTypeIndex, pei, indent, bMembers);
|
||||
break;
|
||||
|
||||
case SymTagPointerType:
|
||||
DumpPointer(dwTypeIndex, pei, indent);
|
||||
break;
|
||||
|
||||
case SymTagBaseType:
|
||||
DumpBaseType(dwTypeIndex, pei, indent);
|
||||
break;
|
||||
|
||||
case SymTagArrayType:
|
||||
DumpArray(dwTypeIndex, pei, indent);
|
||||
break;
|
||||
|
||||
case SymTagFunctionType:
|
||||
printfi("function");
|
||||
break;
|
||||
|
||||
default:
|
||||
printfi("typeTag%ld", dwTag);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
DumpCV(DWORD dwTypeIndex, PENUMINFO pei)
|
||||
{
|
||||
DWORD cv = 0x20;
|
||||
|
||||
SymGetTypeInfo(pei->hProcess, pei->dwModuleBase, dwTypeIndex, TI_GET_CALLING_CONVENTION, &cv);
|
||||
switch (cv)
|
||||
{
|
||||
case CV_CALL_NEAR_C:
|
||||
printf("CDECL");
|
||||
return;
|
||||
case CV_CALL_FAR_C:
|
||||
printf("FAR CDECL");
|
||||
return;
|
||||
case CV_CALL_NEAR_PASCAL:
|
||||
printf("PASCAL");
|
||||
return;
|
||||
case CV_CALL_FAR_PASCAL:
|
||||
printf("FAR PASCAL");
|
||||
return;
|
||||
case CV_CALL_NEAR_FAST:
|
||||
printf("FASTCALL");
|
||||
return;
|
||||
case CV_CALL_FAR_FAST:
|
||||
printf("FAR FASTCALL");
|
||||
return;
|
||||
case CV_CALL_SKIPPED:
|
||||
printf("SKIPPED");
|
||||
return;
|
||||
case CV_CALL_NEAR_STD:
|
||||
printf("STDCALL");
|
||||
return;
|
||||
case CV_CALL_FAR_STD:
|
||||
printf("FAR STDCALL");
|
||||
return;
|
||||
case CV_CALL_NEAR_SYS:
|
||||
case CV_CALL_FAR_SYS:
|
||||
case CV_CALL_THISCALL:
|
||||
printf("THISCALL");
|
||||
return;
|
||||
case CV_CALL_MIPSCALL:
|
||||
printf("MIPSCALL");
|
||||
return;
|
||||
case CV_CALL_GENERIC:
|
||||
case CV_CALL_ALPHACALL:
|
||||
case CV_CALL_PPCCALL:
|
||||
case CV_CALL_SHCALL:
|
||||
case CV_CALL_ARMCALL:
|
||||
case CV_CALL_AM33CALL:
|
||||
case CV_CALL_TRICALL:
|
||||
case CV_CALL_SH5CALL:
|
||||
case CV_CALL_M32RCALL:
|
||||
default:
|
||||
printf("UNKNOWNCV");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BOOL CALLBACK
|
||||
EnumParamsProc(
|
||||
PSYMBOL_INFO pSymInfo,
|
||||
ULONG SymbolSize,
|
||||
PVOID UserContext)
|
||||
{
|
||||
printf("x, ");
|
||||
(*(INT*)UserContext)++;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
VOID
|
||||
DumpParams(PSYMBOL_INFO pSymInfo, PENUMINFO pei)
|
||||
{
|
||||
IMAGEHLP_STACK_FRAME sf;
|
||||
BOOL bRet;
|
||||
INT NumLocals = 0; // the number of local variables found
|
||||
|
||||
sf.InstructionOffset = pSymInfo->Address;
|
||||
|
||||
printf("(");
|
||||
bRet = SymSetContext(pei->hProcess, &sf, 0);
|
||||
|
||||
if (!bRet)
|
||||
{
|
||||
printf("\nError: SymSetContext() failed. Error code: %lu \n", GetLastError());
|
||||
return;
|
||||
}
|
||||
printf("Address == 0x%x, ReturnOffset = 0x%x", (UINT)pSymInfo->Address, (UINT)sf.ReturnOffset);
|
||||
|
||||
// Enumerate local variables
|
||||
|
||||
bRet = SymEnumSymbols(pei->hProcess, 0, 0, EnumParamsProc, &NumLocals);
|
||||
|
||||
if (!bRet)
|
||||
{
|
||||
// printf("Error: SymEnumSymbols() failed. Error code: %lu \n", GetLastError());
|
||||
printf("?)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (NumLocals == 0)
|
||||
{
|
||||
// printf("The function does not have parameters and local variables.\n");
|
||||
printf("void)");
|
||||
}
|
||||
|
||||
printf(")");
|
||||
}
|
||||
|
||||
VOID
|
||||
DumpFunction(PSYMBOL_INFO pSymInfo, PENUMINFO pei)
|
||||
{
|
||||
DWORD dwTypeId;
|
||||
|
||||
//printf("Name=%s, Size=%ld, TypeId=0x%ld\n", pSymInfo->Name, pSymInfo->Size, pSymInfo->TypeIndex);
|
||||
|
||||
SymGetTypeInfo(pei->hProcess, pei->dwModuleBase, pSymInfo->TypeIndex, TI_GET_TYPEID, &dwTypeId);
|
||||
|
||||
// DumpCV(pSymInfo->TypeIndex, pei);
|
||||
// printf("\n");
|
||||
// DumpType(pSymInfo->TypeIndex, pei, 0, FALSE);
|
||||
printf("%s", pSymInfo->Name);
|
||||
DumpParams(pSymInfo, pei);
|
||||
}
|
||||
|
||||
BOOL CALLBACK
|
||||
EnumSymbolsProc(
|
||||
PSYMBOL_INFO pSymInfo,
|
||||
ULONG SymbolSize,
|
||||
PVOID UserContext)
|
||||
{
|
||||
PENUMINFO pei = (PENUMINFO)UserContext;
|
||||
|
||||
if ((pei->pszSymbolName == NULL) ||
|
||||
(strstr(pSymInfo->Name, pei->pszSymbolName) != 0))
|
||||
{
|
||||
if (pei->bType)
|
||||
{
|
||||
DumpType(pSymInfo->TypeIndex, pei, 0, TRUE);
|
||||
printf("\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(__GNUC__) && \
|
||||
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40400)
|
||||
printf("Symbol: %s, TypeIndex=%ld, Flags=%lx, Value=0x%llx\n",
|
||||
#else
|
||||
printf("Symbol: %s, TypeIndex=%ld, Flags=%lx, Value=0x%I64x\n",
|
||||
#endif
|
||||
pSymInfo->Name, pSymInfo->TypeIndex, pSymInfo->Flags, pSymInfo->Value);
|
||||
//if (pSymInfo->Flags & SYMFLAG_FUNCTION)
|
||||
{
|
||||
// DumpFunction(pSymInfo, pei);
|
||||
// printf("\n\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
HANDLE hProcess;
|
||||
CHAR szFullFileName[MAX_PATH+1];
|
||||
DWORD64 dwModuleBase;
|
||||
BOOL bRet;
|
||||
LPSTR pszSymbolPath, pszSymbolName;
|
||||
INT i;
|
||||
ENUMINFO enuminfo;
|
||||
|
||||
printf("PE symbol dumper\n");
|
||||
printf("Copyright (c) Timo Kreuzer 2008\n\n");
|
||||
|
||||
if (argc < 2)
|
||||
{
|
||||
PrintUsage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Get the full path name of the PE file from first argument */
|
||||
GetFullPathName(argv[1], MAX_PATH, szFullFileName, NULL);
|
||||
|
||||
/* Default Symbol Name (all) */
|
||||
pszSymbolName = NULL;
|
||||
|
||||
/* Default to ms symbol server */
|
||||
pszSymbolPath = "srv**symbols*http://msdl.microsoft.com/download/symbols";
|
||||
|
||||
/* Check other command line arguments */
|
||||
for (i = 2; i < argc; i++)
|
||||
{
|
||||
if (*argv[i] == '-')
|
||||
{
|
||||
if (strncmp(argv[i], "-sp=", 4) == 0)
|
||||
{
|
||||
pszSymbolPath = argv[i] + 4;
|
||||
}
|
||||
else if (strcmp(argv[i], "-p") == 0)
|
||||
{
|
||||
g_bShowPos = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Invalid argument: %s\n", argv[i]);
|
||||
PrintUsage();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pszSymbolName = argv[i];
|
||||
}
|
||||
}
|
||||
|
||||
hProcess = GetCurrentProcess();
|
||||
|
||||
printf("Trying to get symbols from: %s\n", pszSymbolPath);
|
||||
|
||||
if (!InitDbgHelp(hProcess, pszSymbolPath))
|
||||
{
|
||||
printf("SymInitialize() failed\n");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
printf("Loading symbols for %s, please wait...\n", szFullFileName);
|
||||
dwModuleBase = SymLoadModule64(hProcess, 0, szFullFileName, 0, 0, 0);
|
||||
if (dwModuleBase == 0)
|
||||
{
|
||||
printf("SymLoadModule64() failed: %ld\n", GetLastError());
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
printf("\nSymbols:\n");
|
||||
enuminfo.hProcess = hProcess;
|
||||
enuminfo.pszSymbolName = pszSymbolName;
|
||||
enuminfo.bType = FALSE;
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
bRet = SymEnumSymbols(hProcess, dwModuleBase, NULL, EnumSymbolsProc, &enuminfo);
|
||||
if (!bRet)
|
||||
{
|
||||
printf("SymEnumSymbols failed: %ld\n", GetLastError());
|
||||
}
|
||||
|
||||
printf("\nTypes:\n");
|
||||
enuminfo.bType = TRUE;
|
||||
enuminfo.dwModuleBase = dwModuleBase;
|
||||
SetLastError(ERROR_SUCCESS);
|
||||
bRet = SymEnumTypes(hProcess, dwModuleBase, EnumSymbolsProc, &enuminfo);
|
||||
if (!bRet)
|
||||
{
|
||||
printf("SymEnumTypes failed: %ld\n", GetLastError());
|
||||
}
|
||||
|
||||
cleanup:
|
||||
|
||||
return 0;
|
||||
}
|
6
rosapps/applications/devutils/symdump/symdump.rbuild
Normal file
6
rosapps/applications/devutils/symdump/symdump.rbuild
Normal file
|
@ -0,0 +1,6 @@
|
|||
<module name="symdump" type="win32cui" installbase="system32" installname="symdump.exe">
|
||||
<include base="gdihv">.</include>
|
||||
<library>dbghelp</library>
|
||||
<library>shlwapi</library>
|
||||
<file>symdump.c</file>
|
||||
</module>
|
|
@ -36,7 +36,12 @@ ImageSymToVa(HANDLE hProcess, PSYMBOL_INFO pSym, PBYTE pModule, PCSTR Name)
|
|||
printf("SymGetSymFromName64() failed: %ld\n", GetLastError());
|
||||
return 0;
|
||||
}
|
||||
#if defined(__GNUC__) && \
|
||||
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40400)
|
||||
printf("looking up adress for %s: 0x%llx\n", Name, pSym->Address);
|
||||
#else
|
||||
printf("looking up adress for %s: 0x%I64x\n", Name, pSym->Address);
|
||||
#endif
|
||||
|
||||
NtHeaders = ImageNtHeader(pModule);
|
||||
p = ImageRvaToVa(NtHeaders, pModule, pSym->Address - pSym->ModBase, NULL);
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
<module name="syscalldump" type="win32cui" installname="syscalldump.exe">
|
||||
<include base="syscalldump">.</include>
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>kernel32</library>
|
||||
<library>dbghelp</library>
|
||||
<file>syscalldump.c</file>
|
||||
</module>
|
||||
|
|
|
@ -108,10 +108,11 @@ DrawProc(IN PFONT_WND_INFO Info, IN PAINTSTRUCT* ps)
|
|||
UCHAR uCharacterRow;
|
||||
UCHAR uBit;
|
||||
WCHAR szInfoText[9];
|
||||
HBITMAP hBitmapOld;
|
||||
|
||||
// Preparations
|
||||
hBoxDC = CreateCompatibleDC(NULL);
|
||||
SelectObject(hBoxDC, Info->MainWndInfo->hBoxBmp);
|
||||
hBitmapOld = SelectObject(hBoxDC, Info->MainWndInfo->hBoxBmp);
|
||||
|
||||
hFont = CreateFontW(13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, L"Tahoma");
|
||||
hOldFont = SelectObject(ps->hdc, hFont);
|
||||
|
@ -177,6 +178,7 @@ DrawProc(IN PFONT_WND_INFO Info, IN PAINTSTRUCT* ps)
|
|||
}
|
||||
}
|
||||
|
||||
SelectObject(hBoxDC, hBitmapOld);
|
||||
SelectObject(ps->hdc, hOldFont);
|
||||
DeleteObject(hFont);
|
||||
SelectObject(ps->hdc, hOldBrush);
|
||||
|
|
|
@ -146,7 +146,7 @@ FontWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
LoadAndFormatString(IDS_SAVEPROMPT, &pszPrompt, szFile);
|
||||
|
||||
nMsgBoxResult = MessageBoxW(hwnd, pszPrompt, szAppName, MB_YESNOCANCEL | MB_ICONQUESTION);
|
||||
HeapFree(hProcessHeap, 0, pszPrompt);
|
||||
LocalFree(pszPrompt);
|
||||
|
||||
switch(nMsgBoxResult)
|
||||
{
|
||||
|
@ -394,7 +394,7 @@ CreateFontWindow(IN PMAIN_WND_INFO MainWndInfo, IN PFONT_OPEN_INFO OpenInfo)
|
|||
(LPARAM)Info );
|
||||
|
||||
if(!OpenInfo->pszFileName)
|
||||
HeapFree(hProcessHeap, 0, pszWindowTitle);
|
||||
LocalFree(pszWindowTitle);
|
||||
|
||||
if(hFontWnd)
|
||||
{
|
||||
|
|
|
@ -89,6 +89,6 @@ BEGIN
|
|||
IDS_TOOLTIP_OPEN, "Ouvrir"
|
||||
IDS_TOOLTIP_SAVE, "Enregistrer"
|
||||
IDS_TOOLTIP_EDIT_GLYPH, "Éditer le glyphe"
|
||||
IDS_TOOLTIP_COPY, "Copy"
|
||||
IDS_TOOLTIP_PASTE, "Paste"
|
||||
IDS_TOOLTIP_COPY, "Copier"
|
||||
IDS_TOOLTIP_PASTE, "Coller"
|
||||
END
|
||||
|
|
|
@ -40,3 +40,4 @@ IDI_DOC ICON "res/doc.ico"
|
|||
#include "lang/ru-RU.rc"
|
||||
#include "lang/uk-UA.rc"
|
||||
#include "lang/it-IT.rc"
|
||||
#include "lang/no-NO.rc"
|
||||
|
|
|
@ -15,15 +15,16 @@ InitResources(IN PMAIN_WND_INFO Info)
|
|||
{
|
||||
HDC hMemDC;
|
||||
HDC hMainDC;
|
||||
HPEN hPen;
|
||||
HPEN hPen, hPenOld;
|
||||
RECT rect;
|
||||
HBITMAP hBitmapOld;
|
||||
|
||||
hMemDC = CreateCompatibleDC(NULL);
|
||||
hMainDC = GetDC(Info->hMainWnd);
|
||||
|
||||
// Create the "Box" bitmap
|
||||
Info->hBoxBmp = CreateCompatibleBitmap(hMainDC, CHARACTER_BOX_WIDTH, CHARACTER_BOX_HEIGHT);
|
||||
SelectObject(hMemDC, Info->hBoxBmp);
|
||||
hBitmapOld = SelectObject(hMemDC, Info->hBoxBmp);
|
||||
|
||||
rect.left = 0;
|
||||
rect.top = 0;
|
||||
|
@ -31,20 +32,24 @@ InitResources(IN PMAIN_WND_INFO Info)
|
|||
rect.bottom = CHARACTER_INFO_BOX_HEIGHT;
|
||||
FillRect( hMemDC, &rect, (HBRUSH)(COLOR_BTNFACE + 1) );
|
||||
|
||||
SelectObject( hMemDC, GetStockObject(WHITE_PEN) );
|
||||
hPenOld = SelectObject( hMemDC, GetStockObject(WHITE_PEN) );
|
||||
Rectangle(hMemDC, 0, 0, CHARACTER_INFO_BOX_WIDTH - 1, 2);
|
||||
Rectangle(hMemDC, 0, 2, 2, CHARACTER_INFO_BOX_HEIGHT - 1);
|
||||
hPen = SelectObject(hMemDC, hPenOld);
|
||||
|
||||
hPen = CreatePen( PS_SOLID, 1, RGB(128, 128, 128) );
|
||||
SelectObject(hMemDC, hPen);
|
||||
hPenOld = SelectObject(hMemDC, hPen);
|
||||
Rectangle(hMemDC, 1, CHARACTER_INFO_BOX_HEIGHT - 2, CHARACTER_INFO_BOX_WIDTH, CHARACTER_INFO_BOX_HEIGHT);
|
||||
Rectangle(hMemDC, CHARACTER_INFO_BOX_WIDTH - 2, 1, CHARACTER_INFO_BOX_WIDTH, CHARACTER_INFO_BOX_HEIGHT - 2);
|
||||
|
||||
SetPixel( hMemDC, CHARACTER_INFO_BOX_WIDTH - 1, 0, RGB(128, 128, 128) );
|
||||
SetPixel( hMemDC, 0, CHARACTER_INFO_BOX_HEIGHT - 1, RGB(128, 128, 128) );
|
||||
SelectObject(hMemDC, hBitmapOld);
|
||||
|
||||
hPen = SelectObject(hMemDC, hPenOld);
|
||||
DeleteObject(hPen);
|
||||
DeleteDC(hMemDC);
|
||||
ReleaseDC(Info->hMainWnd, hMainDC);
|
||||
}
|
||||
|
||||
static VOID
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
<module name="vgafontedit" type="win32gui" installname="vgafontedit.exe" unicode="yes">
|
||||
<include base="vgafontedit">.</include>
|
||||
|
||||
<library>kernel32</library>
|
||||
<library>user32</library>
|
||||
<library>gdi32</library>
|
||||
<library>comdlg32</library>
|
||||
|
|
|
@ -1,240 +0,0 @@
|
|||
/*
|
||||
* ReactOS zoomin
|
||||
*
|
||||
* framewnd.c
|
||||
*
|
||||
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
|
||||
* Copyright (C) 2005 Martin Fuchs <martin-fuchs@gmx.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#include "main.h"
|
||||
#include "framewnd.h"
|
||||
|
||||
extern void ExitInstance();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Global Variables:
|
||||
//
|
||||
|
||||
static int s_factor = 2; // zoom factor
|
||||
|
||||
static POINT s_srcPos = {0, 0}; // source rectangle position
|
||||
static RECT s_lastSrc = {-1,-1,-1,-1}; // last cursor position
|
||||
|
||||
BOOL s_dragging = FALSE;
|
||||
|
||||
|
||||
// zoom range
|
||||
|
||||
#define MIN_ZOOM 1
|
||||
#define MAX_ZOOM 16
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION: SetZoom()
|
||||
//
|
||||
// PURPOSE: Change zoom level
|
||||
//
|
||||
|
||||
static void SetZoom(HWND hWnd, int factor)
|
||||
{
|
||||
TCHAR buffer[MAX_LOADSTRING];
|
||||
|
||||
if (factor>=MIN_ZOOM && factor<=MAX_ZOOM) {
|
||||
s_factor = factor;
|
||||
|
||||
SetScrollPos(hWnd, SB_VERT, s_factor, TRUE);
|
||||
|
||||
wsprintf(buffer, TEXT("%s %dx"), szTitle, s_factor);
|
||||
SetWindowText(hWnd, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
|
||||
//
|
||||
// PURPOSE: Processes WM_COMMAND messages for the main frame window.
|
||||
//
|
||||
//
|
||||
|
||||
static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (LOWORD(wParam)) {
|
||||
// Parse the menu selections:
|
||||
case ID_EDIT_EXIT:
|
||||
DestroyWindow(hWnd);
|
||||
break;
|
||||
|
||||
case ID_EDIT_COPY:
|
||||
case ID_EDIT_REFRESH:
|
||||
case ID_OPTIONS_REFRESH_RATE:
|
||||
case ID_HELP_ABOUT:
|
||||
// TODO:
|
||||
break;
|
||||
|
||||
case ID_REFRESH:
|
||||
InvalidateRect(hWnd, NULL, FALSE);
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION: FrameWndProc(HWND, unsigned, WORD, LONG)
|
||||
//
|
||||
// PURPOSE: Processes messages for the main window.
|
||||
//
|
||||
|
||||
LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message) {
|
||||
case WM_CREATE:
|
||||
SetTimer(hWnd, 0, 200, NULL); // refresh display all 200 ms
|
||||
SetScrollRange(hWnd, SB_VERT, 1, MAX_ZOOM, FALSE);
|
||||
SetZoom(hWnd, s_factor);
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (!_CmdWndProc(hWnd, message, wParam, lParam)) {
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_PAINT: {
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdcMem;
|
||||
RECT clnt;
|
||||
SIZE size;
|
||||
|
||||
BeginPaint(hWnd, &ps);
|
||||
hdcMem = GetDC(GetDesktopWindow());
|
||||
|
||||
GetClientRect(hWnd, &clnt);
|
||||
size.cx = (clnt.right + s_factor-1) / s_factor;
|
||||
size.cy = (clnt.bottom + s_factor-1) / s_factor;
|
||||
|
||||
StretchBlt(ps.hdc, 0, 0, size.cx*s_factor, size.cy*s_factor,
|
||||
hdcMem, s_srcPos.x, s_srcPos.y, size.cx, size.cy, SRCCOPY);
|
||||
|
||||
ReleaseDC(GetDesktopWindow(), hdcMem);
|
||||
EndPaint(hWnd, &ps);
|
||||
break;}
|
||||
|
||||
case WM_TIMER:
|
||||
if (s_dragging && GetCapture()==hWnd) {
|
||||
RECT clnt, rect;
|
||||
|
||||
int width = GetSystemMetrics(SM_CXSCREEN);
|
||||
int height = GetSystemMetrics(SM_CYSCREEN);
|
||||
|
||||
GetCursorPos(&s_srcPos);
|
||||
|
||||
GetClientRect(hWnd, &clnt);
|
||||
|
||||
s_srcPos.x -= clnt.right / s_factor / 2;
|
||||
s_srcPos.y -= clnt.bottom / s_factor / 2;
|
||||
|
||||
if (s_srcPos.x < 0)
|
||||
s_srcPos.x = 0;
|
||||
else if (s_srcPos.x+clnt.right/s_factor > width)
|
||||
s_srcPos.x = width - clnt.right/s_factor;
|
||||
|
||||
if (s_srcPos.y < 0)
|
||||
s_srcPos.y = 0;
|
||||
else if (s_srcPos.y+clnt.bottom/s_factor > height)
|
||||
s_srcPos.y = height - clnt.bottom/s_factor;
|
||||
|
||||
if (memcmp(&rect, &s_lastSrc, sizeof(RECT))) {
|
||||
HDC hdc = GetDC(0);
|
||||
|
||||
if (s_lastSrc.bottom != -1)
|
||||
DrawFocusRect(hdc, &s_lastSrc);
|
||||
|
||||
rect.left = s_srcPos.x - 1;
|
||||
rect.top = s_srcPos.y - 1;
|
||||
rect.right = rect.left + clnt.right/s_factor + 2;
|
||||
rect.bottom = rect.top + clnt.bottom/s_factor + 2;
|
||||
DrawFocusRect(hdc, &rect);
|
||||
|
||||
ReleaseDC(0, hdc);
|
||||
|
||||
s_lastSrc = rect;
|
||||
}
|
||||
}
|
||||
|
||||
InvalidateRect(hWnd, NULL, FALSE);
|
||||
UpdateWindow(hWnd);
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
s_dragging = TRUE;
|
||||
SetCapture(hWnd);
|
||||
break;
|
||||
|
||||
case WM_LBUTTONUP:
|
||||
case WM_CANCELMODE:
|
||||
if (s_dragging) {
|
||||
HDC hdc = GetDC(0);
|
||||
DrawFocusRect(hdc, &s_lastSrc);
|
||||
ReleaseDC(0, hdc);
|
||||
|
||||
s_lastSrc.bottom = -1;
|
||||
|
||||
s_dragging = FALSE;
|
||||
ReleaseCapture();
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_VSCROLL:
|
||||
switch(wParam) {
|
||||
case SB_LINEUP:
|
||||
case SB_PAGEUP:
|
||||
SetZoom(hWnd, s_factor-1);
|
||||
break;
|
||||
|
||||
case SB_LINEDOWN:
|
||||
case SB_PAGEDOWN:
|
||||
SetZoom(hWnd, s_factor+1);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
KillTimer(hWnd, 0);
|
||||
PostQuitMessage(0);
|
||||
ExitInstance();
|
||||
break;
|
||||
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* ReactOS zoomin
|
||||
*
|
||||
* framewnd.h
|
||||
*
|
||||
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __FRAMEWND_H__
|
||||
#define __FRAMEWND_H__
|
||||
|
||||
LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
|
||||
#define WNDCLASS_ZOOMIN TEXT("ZOOMIN")
|
||||
|
||||
|
||||
#endif // __FRAMEWND_H__
|
|
@ -1,119 +0,0 @@
|
|||
/*
|
||||
* ReactOS zoomin
|
||||
*
|
||||
* main.c
|
||||
*
|
||||
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "main.h"
|
||||
#include "framewnd.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Global Variables:
|
||||
//
|
||||
|
||||
HWND hFrameWnd;
|
||||
HMENU hMenuFrame;
|
||||
|
||||
TCHAR szTitle[MAX_LOADSTRING];
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// FUNCTION: InitInstance(HANDLE, int)
|
||||
//
|
||||
// PURPOSE: creates main window
|
||||
//
|
||||
|
||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
{
|
||||
WNDCLASSEX wcFrame = {
|
||||
sizeof(WNDCLASSEX),
|
||||
CS_HREDRAW | CS_VREDRAW/*style*/,
|
||||
FrameWndProc,
|
||||
0/*cbClsExtra*/,
|
||||
0/*cbWndExtra*/,
|
||||
hInstance,
|
||||
LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ZOOMIN)),
|
||||
LoadCursor(0, IDC_ARROW),
|
||||
0,//(HBRUSH)(COLOR_BTNFACE+1),
|
||||
0/*lpszMenuName*/,
|
||||
WNDCLASS_ZOOMIN,
|
||||
(HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_ZOOMIN), IMAGE_ICON,
|
||||
GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED)
|
||||
};
|
||||
ATOM hFrameWndClass = RegisterClassEx(&wcFrame); // register frame window class
|
||||
|
||||
hMenuFrame = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_ZOOMIN_MENU));
|
||||
|
||||
hFrameWnd = CreateWindowEx(0, (LPCTSTR)UlongToPtr(hFrameWndClass), szTitle,
|
||||
WS_OVERLAPPEDWINDOW | WS_EX_CLIENTEDGE | WS_VSCROLL,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, 250, 250,
|
||||
NULL, hMenuFrame, hInstance, NULL/*lpParam*/);
|
||||
|
||||
if (!hFrameWnd) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow(hFrameWnd, nCmdShow);
|
||||
UpdateWindow(hFrameWnd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void ExitInstance(void)
|
||||
{
|
||||
DestroyMenu(hMenuFrame);
|
||||
}
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPSTR lpCmdLine,
|
||||
int nCmdShow)
|
||||
{
|
||||
MSG msg;
|
||||
HACCEL hAccel;
|
||||
|
||||
// Initialize global strings
|
||||
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||
|
||||
// Perform application initialization:
|
||||
if (!InitInstance(hInstance, nCmdShow)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ZOOMIN));
|
||||
|
||||
// Main message loop:
|
||||
while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
|
||||
if (!TranslateAccelerator(msg.hwnd, hAccel, &msg)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
return msg.wParam;
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
* ReactOS zoomin
|
||||
*
|
||||
* main.h
|
||||
*
|
||||
* Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __MAIN_H__
|
||||
#define __MAIN_H__
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
#define MAX_LOADSTRING 100
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Global Variables:
|
||||
//
|
||||
extern HWND hFrameWnd;
|
||||
extern HMENU hMenuFrame;
|
||||
|
||||
extern TCHAR szTitle[];
|
||||
|
||||
|
||||
#endif // __MAIN_H__
|
|
@ -1,22 +0,0 @@
|
|||
#define ID_ZOOMIN_MENU 0
|
||||
#define ID_FILE_MENU 1
|
||||
#define ID_OPTIONS_MENU 2
|
||||
#define ID_HELP_MENU 3
|
||||
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDS_APP_TITLE 103
|
||||
#define IDI_ZOOMIN 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDR_ZOOMIN_MENU 109
|
||||
#define IDR_ZOOMIN 110
|
||||
|
||||
#define ID_EDIT_EXIT 32700
|
||||
#define ID_EDIT_COPY 32701
|
||||
#define ID_EDIT_REFRESH 32702
|
||||
#define ID_OPTIONS_REFRESH_RATE 32704
|
||||
#define ID_HELP_ABOUT 32703
|
||||
|
||||
#define ID_REFRESH 40001
|
||||
|
||||
#define IDC_STATIC -1
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
|
@ -1,11 +0,0 @@
|
|||
<module name="zoomin" type="win32gui" installbase="system32" installname="zoomin.exe">
|
||||
<include base="zoomin">.</include>
|
||||
<define name="_WIN32_IE">0x0501</define>
|
||||
<define name="_WIN32_WINNT">0x0501</define>
|
||||
<library>kernel32</library>
|
||||
<library>gdi32</library>
|
||||
<library>user32</library>
|
||||
<file>framewnd.c</file>
|
||||
<file>main.c</file>
|
||||
<file>zoomin.rc</file>
|
||||
</module>
|
|
@ -1,91 +0,0 @@
|
|||
/* $Id$ */
|
||||
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Zoomin Utility\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "zoomin\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "zoomin.exe\0"
|
||||
#include <reactos/version.rc>
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_ZOOMIN ICON DISCARDABLE "zoomin.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmap
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDR_ZOOMIN_MENU MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "E&xit\tAlt-F4", ID_EDIT_EXIT
|
||||
END
|
||||
POPUP "&Edit"
|
||||
BEGIN
|
||||
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY, GRAYED
|
||||
MENUITEM "&Refresh\tF5", ID_EDIT_REFRESH
|
||||
END
|
||||
POPUP "&Options"
|
||||
BEGIN
|
||||
MENUITEM "&Refresh Rate...", ID_OPTIONS_REFRESH_RATE, GRAYED
|
||||
END
|
||||
POPUP "&Help"
|
||||
BEGIN
|
||||
MENUITEM "&About ...", ID_HELP_ABOUT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOGEX DISCARDABLE 22, 17, 230, 75
|
||||
STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About"
|
||||
FONT 8, "System"
|
||||
BEGIN
|
||||
ICON IDI_ZOOMIN,IDI_ZOOMIN,14,9,16,16
|
||||
LTEXT "ReactOS zoomin Version 1.0",IDC_STATIC,49,10,119,8,
|
||||
SS_NOPREFIX
|
||||
LTEXT "Copyright (C) 2002 ReactOS Team",IDC_STATIC,49,20,119,8
|
||||
DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_APP_TITLE "ReactOS Zoomin"
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDR_ZOOMIN ACCELERATORS DISCARDABLE
|
||||
BEGIN
|
||||
VK_F5, ID_REFRESH, VIRTKEY, NOINVERT
|
||||
END
|
|
@ -1,402 +0,0 @@
|
|||
/* PROJECT: ReactOS Downloader (was GetFirefox)
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: base/applications/downloader/download.c
|
||||
* PURPOSE: Displaying a download dialog
|
||||
* COPYRIGHT: Copyright 2001 John R. Sheets (for CodeWeavers)
|
||||
* Copyright 2004 Mike McCormack (for CodeWeavers)
|
||||
* Copyright 2005 Ge van Geldorp (gvg@reactos.org)
|
||||
* Copyright 2007 Dmitry Chapyshev (lentind@yandex.ru)
|
||||
*/
|
||||
/*
|
||||
* Based on Wine dlls/shdocvw/shdocvw_main.c
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
#define WIN32_NO_STATUS
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <shlobj.h>
|
||||
#include <shlwapi.h>
|
||||
#include <urlmon.h>
|
||||
|
||||
#include "resources.h"
|
||||
#include "structures.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
extern struct Application* SelectedApplication;
|
||||
extern WCHAR Strings [STRING_COUNT][MAX_STRING_LENGHT];
|
||||
|
||||
typedef struct _IBindStatusCallbackImpl
|
||||
{
|
||||
const IBindStatusCallbackVtbl *vtbl;
|
||||
LONG ref;
|
||||
HWND hDialog;
|
||||
BOOL *pbCancelled;
|
||||
} IBindStatusCallbackImpl;
|
||||
|
||||
static HRESULT WINAPI
|
||||
dlQueryInterface(IBindStatusCallback* This, REFIID riid, void** ppvObject)
|
||||
{
|
||||
if (NULL == ppvObject)
|
||||
{
|
||||
return E_POINTER;
|
||||
}
|
||||
|
||||
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IBindStatusCallback))
|
||||
{
|
||||
IBindStatusCallback_AddRef( This );
|
||||
*ppvObject = This;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI
|
||||
dlAddRef(IBindStatusCallback* iface)
|
||||
{
|
||||
IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface;
|
||||
|
||||
return InterlockedIncrement(&This->ref);
|
||||
}
|
||||
|
||||
static ULONG WINAPI
|
||||
dlRelease(IBindStatusCallback* iface)
|
||||
{
|
||||
IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface;
|
||||
DWORD ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
if( !ref )
|
||||
{
|
||||
DestroyWindow( This->hDialog );
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
dlOnStartBinding(IBindStatusCallback* iface, DWORD dwReserved, IBinding* pib)
|
||||
{
|
||||
DPRINT1("OnStartBinding not implemented\n");
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
dlGetPriority(IBindStatusCallback* iface, LONG* pnPriority)
|
||||
{
|
||||
DPRINT1("GetPriority not implemented\n");
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
dlOnLowResource( IBindStatusCallback* iface, DWORD reserved)
|
||||
{
|
||||
DPRINT1("OnLowResource not implemented\n");
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
dlOnProgress(IBindStatusCallback* iface, ULONG ulProgress,
|
||||
ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
|
||||
{
|
||||
IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface;
|
||||
HWND Item;
|
||||
LONG r;
|
||||
WCHAR OldText[100];
|
||||
|
||||
Item = GetDlgItem(This->hDialog, IDC_PROGRESS);
|
||||
if (NULL != Item && 0 != ulProgressMax)
|
||||
{
|
||||
SendMessageW(Item, PBM_SETPOS, (ulProgress * 100) / ulProgressMax, 0);
|
||||
}
|
||||
|
||||
Item = GetDlgItem(This->hDialog, IDC_STATUS);
|
||||
if (NULL != Item && NULL != szStatusText)
|
||||
{
|
||||
SendMessageW(Item, WM_GETTEXT, sizeof(OldText) / sizeof(OldText[0]),
|
||||
(LPARAM) OldText);
|
||||
if (sizeof(OldText) / sizeof(OldText[0]) - 1 <= wcslen(OldText) || 0 != wcscmp(OldText, szStatusText))
|
||||
{
|
||||
SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) szStatusText);
|
||||
}
|
||||
}
|
||||
|
||||
SetLastError(0);
|
||||
r = GetWindowLongPtrW(This->hDialog, GWLP_USERDATA);
|
||||
if (0 != r || 0 != GetLastError())
|
||||
{
|
||||
*This->pbCancelled = TRUE;
|
||||
DPRINT("Cancelled\n");
|
||||
return E_ABORT;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
dlOnStopBinding(IBindStatusCallback* iface, HRESULT hresult, LPCWSTR szError)
|
||||
{
|
||||
DPRINT1("OnStopBinding not implemented\n");
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
dlGetBindInfo(IBindStatusCallback* iface, DWORD* grfBINDF, BINDINFO* pbindinfo)
|
||||
{
|
||||
DPRINT1("GetBindInfo not implemented\n");
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
dlOnDataAvailable(IBindStatusCallback* iface, DWORD grfBSCF,
|
||||
DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
|
||||
{
|
||||
DPRINT1("OnDataAvailable implemented\n");
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI
|
||||
dlOnObjectAvailable(IBindStatusCallback* iface, REFIID riid, IUnknown* punk)
|
||||
{
|
||||
DPRINT1("OnObjectAvailable implemented\n");
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static const IBindStatusCallbackVtbl dlVtbl =
|
||||
{
|
||||
dlQueryInterface,
|
||||
dlAddRef,
|
||||
dlRelease,
|
||||
dlOnStartBinding,
|
||||
dlGetPriority,
|
||||
dlOnLowResource,
|
||||
dlOnProgress,
|
||||
dlOnStopBinding,
|
||||
dlGetBindInfo,
|
||||
dlOnDataAvailable,
|
||||
dlOnObjectAvailable
|
||||
};
|
||||
|
||||
static IBindStatusCallback*
|
||||
CreateDl(HWND Dlg, BOOL *pbCancelled)
|
||||
{
|
||||
IBindStatusCallbackImpl *This;
|
||||
|
||||
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IBindStatusCallbackImpl));
|
||||
if (!This)
|
||||
return NULL;
|
||||
|
||||
This->vtbl = &dlVtbl;
|
||||
This->ref = 1;
|
||||
This->hDialog = Dlg;
|
||||
This->pbCancelled = pbCancelled;
|
||||
|
||||
return (IBindStatusCallback*) This;
|
||||
}
|
||||
|
||||
static DWORD WINAPI
|
||||
ThreadFunc(LPVOID Context)
|
||||
{
|
||||
//static const WCHAR szUrl[] = DownloadUrl;
|
||||
IBindStatusCallback *dl;
|
||||
WCHAR path[MAX_PATH];
|
||||
LPWSTR p;
|
||||
STARTUPINFOW si;
|
||||
PROCESS_INFORMATION pi;
|
||||
HWND Dlg = (HWND) Context;
|
||||
DWORD r;
|
||||
BOOL bCancelled = FALSE;
|
||||
BOOL bTempfile = FALSE;
|
||||
HKEY hKey;
|
||||
DWORD dwSize = MAX_PATH;
|
||||
|
||||
/* built the path for the download */
|
||||
p = wcsrchr(SelectedApplication->Location, L'/');
|
||||
if (NULL == p)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Create default download path */
|
||||
if (GetWindowsDirectory(path, sizeof(path) / sizeof(WCHAR)))
|
||||
{
|
||||
WCHAR DPath[256];
|
||||
int i;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (i == 3)
|
||||
{
|
||||
DPath[i] = '\0';
|
||||
break;
|
||||
}
|
||||
DPath[i] = path[i];
|
||||
}
|
||||
LoadString(GetModuleHandle(NULL), IDS_DOWNLOAD_FOLDER, path, sizeof(path) / sizeof(WCHAR));
|
||||
wcscat((LPWSTR)DPath, path);
|
||||
wcscpy(path, DPath);
|
||||
}
|
||||
|
||||
if (RegOpenKey(HKEY_LOCAL_MACHINE,
|
||||
TEXT("Software\\ReactOS\\Downloader"),
|
||||
&hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
if ((RegQueryValueEx(hKey,
|
||||
L"DownloadFolder",
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)&path,
|
||||
&dwSize) != ERROR_SUCCESS) && (path[0] == 0))
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
if (GetFileAttributes(path) == 0xFFFFFFFF)
|
||||
if (!CreateDirectory((LPCTSTR)path,NULL))
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
wcscat(path, L"\\");
|
||||
wcscat(path, p + 1);
|
||||
|
||||
/* download it */
|
||||
bTempfile = TRUE;
|
||||
dl = CreateDl(Context, &bCancelled);
|
||||
r = URLDownloadToFileW(NULL, SelectedApplication->Location, path, 0, dl);
|
||||
if (NULL != dl)
|
||||
{
|
||||
IBindStatusCallback_Release(dl);
|
||||
}
|
||||
if (S_OK != r)
|
||||
{
|
||||
MessageBoxW(0,Strings[IDS_DOWNLOAD_ERROR],0,0);
|
||||
goto end;
|
||||
}
|
||||
else if (bCancelled)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
ShowWindow(Dlg, SW_HIDE);
|
||||
|
||||
/* run it */
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
r = CreateProcessW(path, NULL, NULL, NULL, 0, 0, NULL, NULL, &si, &pi);
|
||||
if (0 == r)
|
||||
{
|
||||
goto end;
|
||||
}
|
||||
CloseHandle(pi.hThread);
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
CloseHandle(pi.hProcess);
|
||||
|
||||
end:
|
||||
if (bTempfile)
|
||||
{
|
||||
if (bCancelled)
|
||||
DeleteFileW(path);
|
||||
else
|
||||
{
|
||||
DWORD dwSize = sizeof(DWORD);
|
||||
DWORD dwValue, dwType = REG_DWORD;
|
||||
if (RegQueryValueEx(hKey,
|
||||
L"DeleteInstaller",
|
||||
NULL,
|
||||
&dwType,
|
||||
(LPBYTE)&dwValue,
|
||||
&dwSize) == ERROR_SUCCESS)
|
||||
if (dwValue == 0x1)
|
||||
DeleteFileW(path);
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
}
|
||||
EndDialog(Dlg, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK
|
||||
DownloadProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HANDLE Thread;
|
||||
DWORD ThreadId;
|
||||
HWND Item;
|
||||
|
||||
switch (Msg)
|
||||
{
|
||||
case WM_INITDIALOG:/*
|
||||
Icon = LoadIconW((HINSTANCE) GetWindowLongPtr(Dlg, GWLP_HINSTANCE),
|
||||
MAKEINTRESOURCEW(IDI_ICON_MAIN));
|
||||
if (NULL != Icon)
|
||||
{
|
||||
SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) Icon);
|
||||
SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) Icon);
|
||||
}*/
|
||||
SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0);
|
||||
Item = GetDlgItem(Dlg, IDC_PROGRESS);
|
||||
if (NULL != Item)
|
||||
{
|
||||
SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0,100));
|
||||
SendMessageW(Item, PBM_SETPOS, 0, 0);
|
||||
}/*
|
||||
Item = GetDlgItem(Dlg, IDC_REMOVE);
|
||||
if (NULL != Item)
|
||||
{
|
||||
if (GetShortcutName(ShortcutName) &&
|
||||
INVALID_FILE_ATTRIBUTES != GetFileAttributesW(ShortcutName))
|
||||
{
|
||||
SendMessageW(Item, BM_SETCHECK, BST_CHECKED, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageW(Item, BM_SETCHECK, BST_UNCHECKED, 0);
|
||||
ShowWindow(Item, SW_HIDE);
|
||||
}
|
||||
}*/
|
||||
Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId);
|
||||
if (NULL == Thread)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
CloseHandle(Thread);
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (wParam == IDCANCEL)
|
||||
{
|
||||
SetWindowLongPtrW(Dlg, GWLP_USERDATA, 1);
|
||||
PostMessage(Dlg, WM_CLOSE, 0, 0);
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(Dlg, 0);
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<group xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<installfile installbase="system32">downloader.xml</installfile>
|
||||
<module name="downloader" type="win32gui" installbase="system32" installname="downloader.exe" unicode="yes">
|
||||
<include base="downloader">.</include>
|
||||
<include base="expat">.</include>
|
||||
|
||||
<define name="WINVER">0x0501</define>
|
||||
<define name="_WIN32_IE">0x0600</define>
|
||||
|
||||
<library>kernel32</library>
|
||||
<library>advapi32</library>
|
||||
<library>ntdll</library>
|
||||
<library>user32</library>
|
||||
<library>gdi32</library>
|
||||
<library>shell32</library>
|
||||
<library>comctl32</library>
|
||||
<library>msimg32</library>
|
||||
<library>shlwapi</library>
|
||||
<library>urlmon</library>
|
||||
<library>uuid</library>
|
||||
<library>expat</library>
|
||||
|
||||
<file>main.c</file>
|
||||
<file>xml.c</file>
|
||||
<file>download.c</file>
|
||||
<file>downloader.rc</file>
|
||||
</module>
|
||||
</group>
|
|
@ -1,10 +0,0 @@
|
|||
#include <windows.h>
|
||||
#include "resources.h"
|
||||
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "Download !\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "downloader\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "downloader.exe\0"
|
||||
|
||||
#include <reactos/version.rc>
|
||||
|
||||
#include "rsrc.rc"
|
|
@ -1,230 +0,0 @@
|
|||
<tree Version="1"> <!-- Application version this tree is made for -->
|
||||
<category name="Internet & Network" icon="1">
|
||||
<application name="Firefox 1.5">
|
||||
<regname>Mozilla Firefox (1.5)</regname>
|
||||
<licence>MPL/GPL/LGPL</licence>
|
||||
<version>1.5.0.12</version>
|
||||
<description>The most popular and one of the best free Web Browsers out there.</description>
|
||||
<location>http://svn.reactos.org/packages/Firefox%20Setup%201.5.0.12.exe</location>
|
||||
</application>
|
||||
<application name="Firefox 2.0">
|
||||
<regname>Mozilla Firefox (2.0.0.14)</regname>
|
||||
<licence>MPL/GPL/LGPL</licence>
|
||||
<version>2.0.0.14</version>
|
||||
<description>The most popular and one of the best free Web Browsers out there.</description>
|
||||
<location>http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest-2.0/win32/en-US/Firefox%20Setup%202.0.0.14.exe</location>
|
||||
</application>
|
||||
<application name="Opera">
|
||||
<regname>Opera</regname>
|
||||
<licence>Freeware</licence>
|
||||
<version>9.26</version>
|
||||
<description>The most popular and one of the best free Web Browsers out there.</description>
|
||||
<location>http://mirror.nwps.ws/opera/win/926/en/Opera_9.26_Classic_Setup.exe</location>
|
||||
</application>
|
||||
<application name="Thunderbird 1.5">
|
||||
<regname>Mozilla Thunderbird (1.5)</regname>
|
||||
<licence>MPL/GPL/LGPL</licence>
|
||||
<version>1.5.0.14</version>
|
||||
<description>The most popular and one of the best free Mail Clients out there.</description>
|
||||
<location>http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/latest-1.5/win32/en-US/Thunderbird%20Setup%201.5.0.14.exe</location>
|
||||
</application>
|
||||
<application name="Thunderbird 2.0">
|
||||
<regname>Mozilla Thunderbird (2.0.0.14)</regname>
|
||||
<licence>MPL/GPL/LGPL</licence>
|
||||
<version>2.0.0.14</version>
|
||||
<description>The most popular and one of the best free Mail Clients out there.</description>
|
||||
<location>http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/2.0.0.14/win32/en-US/Thunderbird%20Setup%202.0.0.14.exe</location>
|
||||
</application>
|
||||
<application name="SeaMonkey">
|
||||
<regname>SeaMonkey (1.1.9)</regname>
|
||||
<version>1.1.9</version>
|
||||
<description>Mozilla Suite is alive. This is the one and only Browser, Mail, Chat, and Composer bundle you will ever need.</description>
|
||||
<location>http://releases.mozilla.org/pub/mozilla.org/seamonkey/releases/1.1.9/seamonkey-1.1.9.en-US.win32.installer.exe</location>
|
||||
</application>
|
||||
<application name="Mozilla ActiveX Control">
|
||||
<regname>Mozilla ActiveX Control v1.7.12 (ReactOS special)</regname>
|
||||
<version>1.7.12</version>
|
||||
<description>Essential Component to get ReactOS Explorer's and other applications' Internet Browsing feature running.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/reactos/MozillaControl1712-ReactOS.exe</location>
|
||||
</application>
|
||||
<application name="Off By One Browser">
|
||||
<regname>The Off By One Web Browser</regname>
|
||||
<description>The Off By One Browser is a very small and fast web browser with full HTML 3.2 support.</description>
|
||||
<location>http://offbyone.com/offbyone/images/OffByOneSetup.exe</location>
|
||||
</application>
|
||||
<application name="mIRC">
|
||||
<regname>mIRC</regname>
|
||||
<licence>Shareware</licence>
|
||||
<version>6.31</version>
|
||||
<description>The most popular client for the Internet Relay Chat (IRC).</description>
|
||||
<location>http://mirc.bigchief.dk/mirc631.exe</location>
|
||||
</application>
|
||||
<application name="Samba TNG">
|
||||
<description>This tool allows you to access your Windows shared folders/printers with ReactOS.</description>
|
||||
<location>http://svn.reactos.org/packages/samba-tng.exe</location>
|
||||
</application>
|
||||
<application name="Miranda IM">
|
||||
<regname>Miranda IM</regname>
|
||||
<version>0.7.4</version>
|
||||
<description>Open source multiprotocol instant messaging application - May not work completely.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/miranda/miranda-im-v0.7.4-unicode.exe</location>
|
||||
</application>
|
||||
<application name="Putty">
|
||||
<regname>PuTTY version 0.60</regname>
|
||||
<licence>MIT</licence>
|
||||
<version>0.60</version>
|
||||
<description>A free SSH, Telnet, rlogin, and raw TCP client.</description>
|
||||
<location>http://the.earth.li/~sgtatham/putty/latest/x86/putty-0.60-installer.exe</location>
|
||||
</application>
|
||||
</category>
|
||||
<category name="Office" icon="2">
|
||||
<application name="Abiword">
|
||||
<regname>"AbiWord 2.6.2 (remove only)"</regname>
|
||||
<version>2.6.2</version>
|
||||
<description>Word processor.</description>
|
||||
<location>http://www.abiword.org/downloads/abiword/2.6.2/Windows/abiword-setup-2.6.2.exe</location>
|
||||
</application>
|
||||
<application name="OpenOffice">
|
||||
<regname>OpenOffice.org 2.4</regname>
|
||||
<version>2.4.0</version>
|
||||
<description>THE Open Source Office Suite.</description>
|
||||
<location>http://ftp.tu-chemnitz.de/pub/openoffice-extended/stable/2.4.0/OOo_2.4.0_Win32Intel_install_en-US.exe</location>
|
||||
</application>
|
||||
</category>
|
||||
<category name="Graphics" icon="3">
|
||||
<application name="IrfanView">
|
||||
<regname>IrfanView (remove only)</regname>
|
||||
<version>4.10</version>
|
||||
<description>Viewer for all kinds of graphics/audio files/video files.</description>
|
||||
<location>http://gd.tuwien.ac.at/graphics/irfanview/iview410_setup.exe</location>
|
||||
</application>
|
||||
<application name="IrfanView Plugins">
|
||||
<version>4.10</version>
|
||||
<description>Additional Plugins for supporting more file types.</description>
|
||||
<location>http://irfanview.tuwien.ac.at/plugins/irfanview_plugins_410_setup.exe</location>
|
||||
</application>
|
||||
<application name="TuxPaint">
|
||||
<regname>Tux Paint 0.9.19</regname>
|
||||
<version>0.9.19</version>
|
||||
<description>An Open Source bitmap graphics editor geared towards young children.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/tuxpaint/tuxpaint-0.9.19-win32-installer.exe</location>
|
||||
</application>
|
||||
<application name="zeckensack's glide wrapper">
|
||||
<regname>GlidewrapZbag</regname>
|
||||
<version>0.84c</version>
|
||||
<description>glidewrapper needed to run Diablo 2 on ReactOS.</description>
|
||||
<location>http://www.zeckensack.de/glide/archive/GlideWrapper084c.exe</location>
|
||||
</application>
|
||||
</category>
|
||||
<category name="Multimedia" icon="4">
|
||||
</category>
|
||||
<category name="Development" icon="5">
|
||||
<application name="ReactOS Build Environment">
|
||||
<regname>ReactOS Build Environment 1.2</regname>
|
||||
<version>1.2</version>
|
||||
<description>Allows you to build the ReactOS Source. For more instructions see ReactOS wiki.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/reactos/RosBE-1.2.exe</location>
|
||||
</application>
|
||||
<application name="MinGW">
|
||||
<regname>MinGW 5.1.3</regname>
|
||||
<version>5.1.3</version>
|
||||
<description>A Port of the GNU toolchain with GCC, GDB, GNU make, etc.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/mingw/MinGW-5.1.3.exe</location>
|
||||
</application>
|
||||
<application name="FreeBASIC">
|
||||
<regname>FreeBASIC 0.18.4b</regname>
|
||||
<version>0.18.4b</version>
|
||||
<description>Open Source BASIC Compiler. The BASIC syntax is compatible to QBASIC.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/fbc/FreeBASIC-v0.18.4b-win32.exe</location>
|
||||
</application>
|
||||
</category>
|
||||
<category name="Games & Fun" icon="6">
|
||||
<application name="ScummVM">
|
||||
<regname>ScummVM 0.11.1</regname>
|
||||
<version>0.11.1</version>
|
||||
<description>SamNMax, Day of Tentacle, etc on ReactOS</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/scummvm/scummvm-0.11.1-win32.exe</location>
|
||||
</application>
|
||||
<application name="Diablo 2 Shareware">
|
||||
<regname>Diablo II Shareware</regname>
|
||||
<version>1.4</version>
|
||||
<description>Diablo 2 Shareware. zeckensack's glide wrapper is req. to run it.</description>
|
||||
<location>http://ftp.freenet.de./pub/filepilot/windows/spiele/diabloiidemo.exe</location>
|
||||
<depends>GlidewrapZbag</depends>
|
||||
<postinstallaction>http://svn.reactos.org/downloads/d2fix.exe</postinstallaction>
|
||||
</application>
|
||||
<application name="Tile World">
|
||||
<description>Nice Clone of Chip's Challenge originally made for the Atari Lynx. Includes free CCLP2 Graphics Pack, so you dont need the copyrighted Original.</description>
|
||||
<location>http://www.muppetlabs.com/~breadbox/pub/software/tworld/tworld-1.3.0-win32-CCLP2.exe</location>
|
||||
</application>
|
||||
<application name="OpenTTD">
|
||||
<regname>OpenTTD 0.6.0</regname>
|
||||
<version>0.6.0</version>
|
||||
<description>Open Source clone of the "Transport Tycoon Deluxe" game engine. You need a copy of Transport Tycoon.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/openttd/openttd-0.6.0-win32.exe</location>
|
||||
</application>
|
||||
<application name="LBreakout2">
|
||||
<regname>LBreakout2 2.4.1</regname>
|
||||
<version>2.4.1</version>
|
||||
<description>Breakout Clone using SDL libs.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/lgames/lbreakout2-2.4.1-win32.exe</location>
|
||||
</application>
|
||||
<application name="LGeneral">
|
||||
<regname>LGeneral 1.1</regname>
|
||||
<version>1.1</version>
|
||||
<description>Panzer General Clone using SDL libs.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/lgames/lgeneral-1.1-win32.exe</location>
|
||||
</application>
|
||||
<application name="LMarbles">
|
||||
<regname>LMarbles 1.0.6</regname>
|
||||
<version>1.0.6</version>
|
||||
<description>Atomix Clone using SDL libs.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/lgames/lmarbles-1.0.6-win32.exe</location>
|
||||
</application>
|
||||
<application name="WinBoard">
|
||||
<regname>WinBoard 4.2.7b</regname>
|
||||
<version>4.2.7b</version>
|
||||
<licence>GPL 3</licence>
|
||||
<description>WinBoard is a graphical chessboard for the Windows/ReactOS that can serve as a user interface for GNU Chess, Crafty, and other chess engines, for the Internet Chess Servers, and for electronic mail correspondence chess.</description>
|
||||
<location>http://ftp.gnu.org/gnu/winboard/winboard-4_2_7b.exe</location>
|
||||
</application>
|
||||
</category>
|
||||
<category name="Science" icon="11">
|
||||
</category>
|
||||
<category name="Edutainment" icon="12">
|
||||
</category>
|
||||
<category name="Engineering" icon="13">
|
||||
</category>
|
||||
<category name="Tools" icon="7">
|
||||
<application name="7-Zip">
|
||||
<regname>7-Zip 4.57</regname>
|
||||
<version>4.57</version>
|
||||
<description>Utility to create and open 7zip, zip, tar, rar and other archive files.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/sevenzip/7z457.exe</location>
|
||||
</application>
|
||||
<application name="uTorrent">
|
||||
<regname>µTorrent</regname>
|
||||
<version>1.7.7</version>
|
||||
<description>Small and fast BitTorrent Client.</description>
|
||||
<location>http://download.utorrent.com/1.7.7/utorrent.exe</location>
|
||||
</application>
|
||||
<application name="Audio Grabber">
|
||||
<regname>Audiograbber 1.83 SE</regname>
|
||||
<version>1.83 SE</version>
|
||||
<description>A very good CD Ripper/Audio File Converter.</description>
|
||||
<location>http://www.audiograbber.de/files/4898276276/agsetup183se.exe</location>
|
||||
</application>
|
||||
</category>
|
||||
<category name="Others" icon="8">
|
||||
<application name="Simple Direct Media Layer (SDL) Runtime">
|
||||
<version>1.2.13</version>
|
||||
<description>Needed for many Open Source Games to run. You need 7-Zip or a similar Utility to extract it.</description>
|
||||
<location>http://www.libsdl.org/release/SDL-1.2.13-win32.zip</location>
|
||||
</application>
|
||||
<application name="DOSBox">
|
||||
<version>0.72</version>
|
||||
<description>DOSBox is a DOS emulator.</description>
|
||||
<location>http://ovh.dl.sourceforge.net/sourceforge/dosbox/DOSBox0.72-win32-installer.exe</location>
|
||||
</application>
|
||||
</category>
|
||||
</tree>
|
|
@ -1,60 +0,0 @@
|
|||
LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
|
||||
|
||||
IDD_DOWNLOAD DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Сваляне..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Отказ", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Предпочитания"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Папка за сваляне:", -1, 6, 10, 144, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "&Избор...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "&Изтриване на инсталационните файлове след слагането", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Сървър с обновявания:", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&Добре", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "&Отказ", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "Свали! - Свалячът на РеактОС"
|
||||
IDS_WELCOME_TITLE "Свалячът на РеактОС ви приветства"
|
||||
IDS_WELCOME "Изберете раздел отляво. Това е издание 1.1."
|
||||
IDS_NO_APP_TITLE "Не е избрано приложение"
|
||||
IDS_NO_APP "Изберете приложение, преди да натиснето клавиша „Сваляне”. Ако имате нужда от помощ, натиснете въпросителната в горния десен ъгъл."
|
||||
IDS_UPDATE_TITLE "Обновяване"
|
||||
IDS_UPDATE "Тази възможност все още не е готова."
|
||||
IDS_HELP_TITLE "Помощ"
|
||||
IDS_HELP "Изберете раздел отляво, след това изберете приложение и натиснете „Сваляне”. За да осъвремените сведенията за приложението, натиснете копчето до „Напред”."
|
||||
IDS_NO_APPS "За съжаление в този раздел все още няма приложения. Можете да помогнете и да добавите още приложения."
|
||||
IDS_CHOOSE_APP "Изберете приложение."
|
||||
IDS_CHOOSE_SUB "Изберете подраздел."
|
||||
IDS_CHOOSE_CATEGORY "Изберете раздел."
|
||||
IDS_CHOOSE_BOTH "Изберете подраздел или приложение."
|
||||
IDS_XMLERROR_1 "Xml файлът не е открит !"
|
||||
IDS_XMLERROR_2 "Разборът на XML файла е неуспешен!"
|
||||
IDS_DOWNLOAD_ERROR "Свалянето на файла невъзможно.\nПроверете връзката си с интернет."
|
||||
IDS_VERSION "Издание: "
|
||||
IDS_LICENCE "Разрешително: "
|
||||
IDS_MAINTAINER "Поддържащ: "
|
||||
IDS_APPS_TITLE "Приложения"
|
||||
IDS_CATS_TITLE "Раздели"
|
||||
IDS_CHOOSE_FOLDER "Изберете папката..."
|
||||
IDS_NOTCREATE_REGKEY "Неуспешно създаване на ключ в регистъра."
|
||||
IDS_DOWNLOAD_FOLDER "Сваляч"
|
||||
IDS_UNABLECREATE_FOLDER "Неуспешно създаване на папка с това име!"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
TTT_HELPBUTTON, "Помощ за сваляча"
|
||||
TTT_UPDATEBUTTON, "Все още не е готово"
|
||||
TTT_PROFBUTTON, "Позволява настройка на сваляча"
|
||||
END
|
|
@ -1,61 +0,0 @@
|
|||
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
|
||||
|
||||
IDD_DOWNLOAD DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Download..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Abbrechen", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Einstellungen"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Download Ordner:", -1, 6, 10, 140, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "W&ähle...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "&Installationsdateien nach dem Setup löschen", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Update Server:", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&OK", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "&Abbrechen", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "Download ! - ReactOS Downloader"
|
||||
IDS_WELCOME_TITLE "Willkommen im ReactOS Downloader"
|
||||
IDS_WELCOME "Bitte wählen Sie links eine Kategorie. Dies ist Version 1.1."
|
||||
IDS_NO_APP_TITLE "Keine Anwendung ausgewählt"
|
||||
IDS_NO_APP "Bitte wählen Sie eine Anwendung, bevor Sie die Download-Schaltfläche betätigen. Wenn Sie Hilfe benötigen, drücken Sie die Hilfe-Schaltfläche in der oberen rechten Ecke."
|
||||
IDS_UPDATE_TITLE "Update"
|
||||
IDS_UPDATE "Diese Funktion wurde noch nicht implementiert."
|
||||
IDS_HELP_TITLE "Hilfe"
|
||||
IDS_HELP "Wählen Sie links eine Kategorie, wählen Sie eine Anwendung und drücken Sie die Download-Schaltfläche. Um die Anwendungsinformationen zu aktualisieren, drücken Sie die Schaltfläche neben der Hilfe-Schaltfläche."
|
||||
IDS_NO_APPS "In dieser Kategorie sind bisher noch keine Anwendungen. Sie können helfen, indem Sie Anwendungen hinzufügen."
|
||||
IDS_CHOOSE_APP "Bitte wählen Sie eine Anwendung."
|
||||
IDS_CHOOSE_SUB "Bitte wählen Sie eine Unterkategorie."
|
||||
IDS_CHOOSE_CATEGORY "Bitte wählen Sie eine Kategorie."
|
||||
IDS_CHOOSE_BOTH "Bitte wählen Sie eine Unterkategorie oder eine Anwendung."
|
||||
IDS_XMLERROR_1 "XML Datei nicht gefunden!"
|
||||
IDS_XMLERROR_2 "XML Datei kann nicht verarbeitet werden!"
|
||||
IDS_DOWNLOAD_ERROR "Die Datei konnte nicht heruntergeladen werden.\nBitte prüfen sie, ob eine Verbindung zum Internet besteht."
|
||||
IDS_VERSION "Version: "
|
||||
IDS_LICENCE "Lizenz: "
|
||||
IDS_MAINTAINER "Maintainer: "
|
||||
IDS_APPS_TITLE "Anwendungen"
|
||||
IDS_CATS_TITLE "Kategorien"
|
||||
IDS_CHOOSE_FOLDER "Bitte wählen Sie den Ordner..."
|
||||
IDS_NOTCREATE_REGKEY "Registryschlüssel könnte nicht erstellt werden."
|
||||
IDS_DOWNLOAD_FOLDER "Downloader"
|
||||
IDS_UNABLECREATE_FOLDER "Es konnte kein Ordner mit diesem Namen erstellt werden!"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
IDS_INSTALL_DEP "%s wird benötigt um %s ausführen zu können. Soll %s jetzt installiert werden?"
|
||||
TTT_HELPBUTTON "Hilfe über den Downloader"
|
||||
TTT_UPDATEBUTTON "Noch nicht vorhanden"
|
||||
TTT_PROFBUTTON "Konfiguriert den Downloader"
|
||||
END
|
|
@ -1,61 +0,0 @@
|
|||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
IDD_DOWNLOAD DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Download..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Cancel", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Preferences"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Download folder:", -1, 6, 10, 140, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "C&hoose...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "&Delete installation files after setup", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Update server:", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&OK", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "&Cancel", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "Download ! - ReactOS Downloader"
|
||||
IDS_WELCOME_TITLE "Welcome to the ReactOS Downloader"
|
||||
IDS_WELCOME "Please choose a category on the left. This is version 1.1."
|
||||
IDS_NO_APP_TITLE "No application selected"
|
||||
IDS_NO_APP "Please select a Application before you click the download button, if you need assistance please click on the question mark button on the top right corner."
|
||||
IDS_UPDATE_TITLE "Update"
|
||||
IDS_UPDATE "Sorry this feature is not implemented yet."
|
||||
IDS_HELP_TITLE "Help"
|
||||
IDS_HELP "Choose a category on the left, then choose a application and click the download button. To update the application information click the button next to the help button."
|
||||
IDS_NO_APPS "Sorry, there no applications in this category yet. You can help and add more applications."
|
||||
IDS_CHOOSE_APP "Please choose an application."
|
||||
IDS_CHOOSE_SUB "Please choose a subcategory."
|
||||
IDS_CHOOSE_CATEGORY "Please choose a category."
|
||||
IDS_CHOOSE_BOTH "Please choose a subcategory or an application."
|
||||
IDS_XMLERROR_1 "Could not find the xml file !"
|
||||
IDS_XMLERROR_2 "Could not parse the xml file !"
|
||||
IDS_DOWNLOAD_ERROR "Unable to download the file.\nPlease check your internet connection."
|
||||
IDS_VERSION "Version: "
|
||||
IDS_LICENCE "Licence: "
|
||||
IDS_MAINTAINER "Maintainer: "
|
||||
IDS_APPS_TITLE "Applications"
|
||||
IDS_CATS_TITLE "Categories"
|
||||
IDS_CHOOSE_FOLDER "Please, choose the folder..."
|
||||
IDS_NOTCREATE_REGKEY "Could not create the registry key."
|
||||
IDS_DOWNLOAD_FOLDER "Downloader"
|
||||
IDS_UNABLECREATE_FOLDER "Unable to create a folder with this name!"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
IDS_INSTALL_DEP "%s is required to run %s. Should %s be installed now?"
|
||||
TTT_HELPBUTTON "Get help about the downloader"
|
||||
TTT_UPDATEBUTTON "Not yet available"
|
||||
TTT_PROFBUTTON "Let you configure the downloader"
|
||||
END
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
*Spanish Language resource file
|
||||
* Actualizado Javier Remacha 2007-12-01,2007-12-31
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
|
||||
|
||||
IDD_DOWNLOAD DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Descargar..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Cancelar", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Preferencias"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Carpeta de descarga:", -1, 6, 10, 140, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "&Seleccionar...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "&Borrar archivos de instalación tras la instalación", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Actualizar servidor:", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&Aceptar", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "&Cancelar", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "¡Descargar! - Descargador de ReactOS"
|
||||
IDS_WELCOME_TITLE "Bienvenido al descargador de ReactOS"
|
||||
IDS_WELCOME "Por favor selecciona una categoría de la izquierda. Esta es la versión 1.1."
|
||||
IDS_NO_APP_TITLE "Ninguna aplicación seleccionada"
|
||||
IDS_NO_APP "Por favor seleccione una Aplicación antes de pulsar el botón de Descarga, si necesita asistencia por favor pulsa el botón con la interrogación en la esquina superior derecha."
|
||||
IDS_UPDATE_TITLE "Actualizar"
|
||||
IDS_UPDATE "Perdón esta característica no a sido implementada todavía."
|
||||
IDS_HELP_TITLE "Ayuda"
|
||||
IDS_HELP "Selecciona una categoría de la izquierda, entonces selecciona una aplicación y pulsa el botón de descargar. Para actualizar la información de la aplicación pulsa el botón junto al botón de ayuda."
|
||||
IDS_NO_APPS "Perdón, aun no hay ninguna aplicación en esta categoría. Puedes ayudar y añadir más aplicaciones."
|
||||
IDS_CHOOSE_APP "Por favor selecciona una aplicación."
|
||||
IDS_CHOOSE_SUB "Por favor selecciona una subcategoría."
|
||||
IDS_CHOOSE_CATEGORY "Por favor selecciona una categoría."
|
||||
IDS_CHOOSE_BOTH "Por favor selecciona una subcategoria o una aplicación."
|
||||
IDS_XMLERROR_1 "¡No se a encontrado el archivo xml!"
|
||||
IDS_XMLERROR_2 "¡No se ha podido analizar el archivo xml!"
|
||||
IDS_DOWNLOAD_ERROR "Imposible descargar el archivo.\nPor favor verifica tu conexión a internet."
|
||||
IDS_VERSION "Versión: "
|
||||
IDS_LICENCE "Licencia: "
|
||||
IDS_MAINTAINER "Mantenido por: "
|
||||
IDS_APPS_TITLE "Aplicaciones"
|
||||
IDS_CATS_TITLE "Categorias"
|
||||
IDS_CHOOSE_FOLDER "Por favor, seleccione la carpeta..."
|
||||
IDS_NOTCREATE_REGKEY "No se puede crear la llave del registro."
|
||||
IDS_DOWNLOAD_FOLDER "Downloader"
|
||||
IDS_UNABLECREATE_FOLDER "¡Imposible crear una carpeta con este nombre!"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
IDS_INSTALL_DEP "%s en necesario para ejecutar %s. ¿Desea instalar %s ahora?"
|
||||
TTT_HELPBUTTON "Obtenga ayuda acerca de Downloader"
|
||||
TTT_UPDATEBUTTON "No disponible todavía"
|
||||
TTT_PROFBUTTON "Le permite configurar Downloader"
|
||||
END
|
|
@ -1,61 +0,0 @@
|
|||
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
|
||||
|
||||
IDD_DOWNLOAD DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Téléchargement..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Annuler", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Préférences"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Répertoire de téléchargement :", -1, 6, 10, 140, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "C&hoisir...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "Supprimer les fichiers après l'installation", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Serveur de mise-à-jour :", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&OK", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "Annuler", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "Télécharger ! - Téléchargeur de ReactOS"
|
||||
IDS_WELCOME_TITLE "Bienvenue dans le Téléchargeur de ReactOS"
|
||||
IDS_WELCOME "Veuillez choisir une catégorie sur la gauche. C'est la version 1.1."
|
||||
IDS_NO_APP_TITLE "Aucune application selectionnée"
|
||||
IDS_NO_APP "Veuillez sélectionner une application avant de cliquer sur le bouton Télécharger, si vous avez besoin d'aide, veuillez cliquer sur le point d'interrogation dans le coin supérieur droit."
|
||||
IDS_UPDATE_TITLE "Mise à jour"
|
||||
IDS_UPDATE "Désolé, cette fonctionnalité n'est pas encore implémentée."
|
||||
IDS_HELP_TITLE "Aide"
|
||||
IDS_HELP "Choisissez une catégorie sur la gauche, puis choisissez une application et cliquez sur le bouton Télécharger. Pour mettre à jour les informations sur l'application, cliquez sur le bouton à côté du bouton d'aide."
|
||||
IDS_NO_APPS "Désolé, il n'y a pas encore d'application dans cette catégorie. Vous pouvez contribuer et ajouter plus d'applications."
|
||||
IDS_CHOOSE_APP "Veuillez choisir une application."
|
||||
IDS_CHOOSE_SUB "Veuillez choisir une sous-catégorie."
|
||||
IDS_CHOOSE_CATEGORY "Veuillez choisir une catégorie."
|
||||
IDS_CHOOSE_BOTH "Veuillez choisir une sous-catégorie ou une application."
|
||||
IDS_XMLERROR_1 "Impossible de trouver le fichier xml !"
|
||||
IDS_XMLERROR_2 "Impossible d'analyser le fichier xml !"
|
||||
IDS_DOWNLOAD_ERROR "Impossible de télécharger le fichier.\nVeuillez vérifier votre connexion Internet."
|
||||
IDS_VERSION "Version: "
|
||||
IDS_LICENCE "Licence: "
|
||||
IDS_MAINTAINER "Maintainer: "
|
||||
IDS_APPS_TITLE "Applications"
|
||||
IDS_CATS_TITLE "Catégories"
|
||||
IDS_CHOOSE_FOLDER "Veuillez choisir le répertoire..."
|
||||
IDS_NOTCREATE_REGKEY "Échec lors de la création de la clé registre."
|
||||
IDS_DOWNLOAD_FOLDER "Downloader"
|
||||
IDS_UNABLECREATE_FOLDER "Échec lors du répertoire avec ce nom !"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
IDS_INSTALL_DEP "%s est nécessaire pour lancer %s. Voulez-vous installer %s maintenant ?"
|
||||
TTT_HELPBUTTON "Obtenez de l'aide à propros du téléchargeur"
|
||||
TTT_UPDATEBUTTON "Pas encore disponible"
|
||||
TTT_PROFBUTTON "Vous permet de configurer le téléchargeur"
|
||||
END
|
|
@ -1,61 +0,0 @@
|
|||
LANGUAGE LANG_INDONESIAN, SUBLANG_DEFAULT
|
||||
|
||||
IDD_DOWNLOAD DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Download..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Batal", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Proferences"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Download folder:", -1, 6, 10, 140, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "C&hoose...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "&Delete installation files after setup", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Update server:", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&OK", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "&Cancel", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "Download ! - ReactOS Downloader"
|
||||
IDS_WELCOME_TITLE "Selamat datang di ReactOS Downloader"
|
||||
IDS_WELCOME "Silahkan pilih kategori di sebelah kiri. Ini versi 1.1."
|
||||
IDS_NO_APP_TITLE "Tidak ada aplikasi yang dipilih"
|
||||
IDS_NO_APP "Silahkan pilih Aplikasi sebelum anda mengklik tombol download, jika anda membutuhkan asistensi silahkan klik pada tombol di sudut kanan atas."
|
||||
IDS_UPDATE_TITLE "Mutakhirkan"
|
||||
IDS_UPDATE "Maaf fitur ini belum diimplementasikan."
|
||||
IDS_HELP_TITLE "Bantuan"
|
||||
IDS_HELP "Pilih kategori di sisi kiri, lalu pilih aplikasi dan klik tombol download. Untuk memutakhirkan informasi aplikasi klik tombol disebelah tombol bantuan."
|
||||
IDS_NO_APPS "Maaf, belum ada aplikasi dalam kategori ini. Anda dapat membantu dan menambahkan aplikasi lebih banyak."
|
||||
IDS_CHOOSE_APP "Silahkan pilih aplikasi."
|
||||
IDS_CHOOSE_SUB "Silahkan pilih subkategori."
|
||||
IDS_CHOOSE_CATEGORY "Silahkan pilih kategori."
|
||||
IDS_CHOOSE_BOTH "Silahkan pilih subkategori atau aplikasi."
|
||||
IDS_XMLERROR_1 "Tidak dapat menemukan file xml !"
|
||||
IDS_XMLERROR_2 "Tidak dapat mengurai file xml !"
|
||||
IDS_DOWNLOAD_ERROR "Tidak bisa mendownload file.\nSilahkan periksa koneksi internet anda."
|
||||
IDS_VERSION "Versi: "
|
||||
IDS_LICENCE "Lisensi: "
|
||||
IDS_MAINTAINER "Pemelihara: "
|
||||
IDS_APPS_TITLE "Applications"
|
||||
IDS_CATS_TITLE "Categories"
|
||||
IDS_CHOOSE_FOLDER "Please, choose the folder..."
|
||||
IDS_NOTCREATE_REGKEY "Could not create the registry key."
|
||||
IDS_DOWNLOAD_FOLDER "Downloader"
|
||||
IDS_UNABLECREATE_FOLDER "Unable to create a folder with this name!"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
IDS_INSTALL_DEP "%s is required to run %s. Should %s be installed now?"
|
||||
TTT_HELPBUTTON "Get help about the downloader"
|
||||
TTT_UPDATEBUTTON "Not yet available"
|
||||
TTT_PROFBUTTON "Let you configure the downloader"
|
||||
END
|
|
@ -1,61 +0,0 @@
|
|||
LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
|
||||
|
||||
IDD_DOWNLOAD DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Scarica..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Annulla", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Preferenze"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Cartella dove scaricare:", -1, 6, 10, 140, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "&Scegliere...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "&Cancellare i file di installazione dopo il setup", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Server per gli aggiornamenti:", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&OK", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "&Annulla", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "Scarica ! - ReactOS Downloader"
|
||||
IDS_WELCOME_TITLE "Benvenuto al ReactOS Downloader"
|
||||
IDS_WELCOME "Scegli una categoria a sinistra. Questa è la versione 1.1."
|
||||
IDS_NO_APP_TITLE "Nessuna applicazione selezionata"
|
||||
IDS_NO_APP "Scegli una Applicazione prima di premere il bottone Scarica, se serve assistenza clicca sul punto di domanda nell'angolo in alto a destra."
|
||||
IDS_UPDATE_TITLE "Aggiorna"
|
||||
IDS_UPDATE "Funzione non ancora implementata."
|
||||
IDS_HELP_TITLE "Aiuto"
|
||||
IDS_HELP "Scegli una categoria a sinistra, poi scegli una applicazione e clicca il bottone download. Per aggiornare le informazioni sulla applicazione clicca il bottone accanto a quello di aiuto."
|
||||
IDS_NO_APPS "Non ci sono ancora applicazioni in questa categoria. Puoi aiutare aggiungendone altre."
|
||||
IDS_CHOOSE_APP "Scegli una applicazione."
|
||||
IDS_CHOOSE_SUB "Scegli una sottocategoria."
|
||||
IDS_CHOOSE_CATEGORY "Scegli una categoria."
|
||||
IDS_CHOOSE_BOTH "Scegli una sottocategoria o una applicazione."
|
||||
IDS_XMLERROR_1 "File xml non trovato !"
|
||||
IDS_XMLERROR_2 "Impossibile trattare il contenuto del file xml !"
|
||||
IDS_DOWNLOAD_ERROR "Scaricamento del file impossibile.\nVerificare la connessione a Internet."
|
||||
IDS_VERSION "Versione: "
|
||||
IDS_LICENCE "Licenza: "
|
||||
IDS_MAINTAINER "Manutentore: "
|
||||
IDS_APPS_TITLE "Applicazioni"
|
||||
IDS_CATS_TITLE "Categorie"
|
||||
IDS_CHOOSE_FOLDER "Scegliere una cartella..."
|
||||
IDS_NOTCREATE_REGKEY "Impossibile creare la chiave del registry."
|
||||
IDS_DOWNLOAD_FOLDER "Scarica"
|
||||
IDS_UNABLECREATE_FOLDER "Impossibile creare una cartella con questo nome!"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
IDS_INSTALL_DEP "%s è necessario per la esecuzione di %s. Si vuole procedere alla installazione di %s?"
|
||||
TTT_HELPBUTTON "Informazioni su ReactOS Downloader"
|
||||
TTT_UPDATEBUTTON "Non disponibile"
|
||||
TTT_PROFBUTTON "Permette la configurazione del downloader"
|
||||
END
|
|
@ -1,63 +0,0 @@
|
|||
/* Translation by Vytis "CMan" Girdþijauskas (cman@cman.us) */
|
||||
|
||||
LANGUAGE LANG_LITHUANIAN, SUBLANG_DEFAULT
|
||||
|
||||
IDD_DOWNLOAD DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Siunèiama..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Atðaukti", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Nuostatos"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Siuntø katalogas:", -1, 6, 10, 140, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "&Pasirinkti...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "&Naikinti diegimo bylas baigus diegimà", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Atnaujinimø serveris:", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&OK", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "&Atðaukti", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "Download ! - ReactOS atsiuntimø tvarkytuvë"
|
||||
IDS_WELCOME_TITLE "Jus sveikina ReactOS atsiuntimø tvarkytuvë"
|
||||
IDS_WELCOME "Praðome pasirinkti kategorijà kairëje. \nÈia yra versija 1.1."
|
||||
IDS_NO_APP_TITLE "Nepasirinkta programa"
|
||||
IDS_NO_APP "Praðome pasirinkti programà prieð paspaudþiant siuntimo mygtukà, jei jums reikalinga pagalba, praðome spausti ant klaustuko virðutiniame deðiniajame kampe."
|
||||
IDS_UPDATE_TITLE "Atnaujinti"
|
||||
IDS_UPDATE "Atsipraðome, bet ði funkcija dar nesukurta."
|
||||
IDS_HELP_TITLE "Pagalba"
|
||||
IDS_HELP "Pasirinkite kategorijà kairëje, tuomet pasirinkite programà ir spauskite siuntimo mygtukà. Norëdami atnaujinti programos informacijà, spaukite mygtukà, kuris yra ðalia nuostatø mygtuko."
|
||||
IDS_NO_APPS "Atsipraðome, bet ðioje kategorijoje programø dar nëra. Jûs galite padëti pridëdami daugiau programø."
|
||||
IDS_CHOOSE_APP "Praðome pasirinkti programà."
|
||||
IDS_CHOOSE_SUB "Praðome pasirinkti pokategorá."
|
||||
IDS_CHOOSE_CATEGORY "Praðome pasirinkti kategorijà."
|
||||
IDS_CHOOSE_BOTH "Praðome pasirinkti pokategorá arba programà."
|
||||
IDS_XMLERROR_1 "Nepavyko rasti xml bylos!"
|
||||
IDS_XMLERROR_2 "Nepavyko nuskaityti xml bylos!"
|
||||
IDS_DOWNLOAD_ERROR "Nepavyko parsiøsti bylos.\nPraðome patikrinti interneto ryðá."
|
||||
IDS_VERSION "Versija: "
|
||||
IDS_LICENCE "Licencija: "
|
||||
IDS_MAINTAINER "Palaikymas: "
|
||||
IDS_APPS_TITLE "Programos"
|
||||
IDS_CATS_TITLE "Kategorijos"
|
||||
IDS_CHOOSE_FOLDER "Praðome pasirinkti katalogà..."
|
||||
IDS_NOTCREATE_REGKEY "Nepavyko sukurti registro rakto."
|
||||
IDS_DOWNLOAD_FOLDER "Downloader"
|
||||
IDS_UNABLECREATE_FOLDER "Nepavyko sukurti katalogo su ðiuo vardu!"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
IDS_INSTALL_DEP "%s reikalingas paleisti %s. Diegti %s dabar?"
|
||||
TTT_HELPBUTTON "Pateikia informacijà apie naudojimàsi programa"
|
||||
TTT_UPDATEBUTTON "Dar nëra"
|
||||
TTT_PROFBUTTON "Leidþia konfiguruoti programà"
|
||||
END
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* translated by Caemyr - Olaf Siejka (Feb, 2008)
|
||||
* Use ReactOS forum PM or IRC to contact me
|
||||
* http://www.reactos.org
|
||||
* IRC: irc.freenode.net #reactos-pl;
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
|
||||
|
||||
IDD_DOWNLOAD DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Ściągaj..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Anuluj", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Ustawienia"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Katalog do ściągania:", -1, 6, 10, 140, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "&Wybierz...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "&Skasuj ściągnięte pliki po zainstalowaniu programu", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Uaktualnij:", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&OK", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "&Anuluj", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "Ściągnij ! - Menedżer pobierania dla ReactOS"
|
||||
IDS_WELCOME_TITLE "Witamy w Ściągnij dla ReactOS"
|
||||
IDS_WELCOME "Proszę wybrać kategorię po lewej. Wersja programu: 1.1."
|
||||
IDS_NO_APP_TITLE "Nie wybrano programu"
|
||||
IDS_NO_APP "Proszę wybrać program, przed kliknięciem w przycisk Ściągnij. W razie problemów kliknij w znak zapytania, w prawym górnym rogu okna."
|
||||
IDS_UPDATE_TITLE "Uaktualnij"
|
||||
IDS_UPDATE "Przepraszamy, ta opcja nie jest jeszcze dostępna."
|
||||
IDS_HELP_TITLE "Pomoc"
|
||||
IDS_HELP "Wybierz kategorię po lewej, następnie wybierz program i kliknij w przycisk Ściągnij. Aby uaktualnić listę programów, naciśnij przycisk obok przycisku Pomocy."
|
||||
IDS_NO_APPS "Przepraszamy, nie ma programów w tej kategorii. Możesz pomóc nam w wyborze nowych programów."
|
||||
IDS_CHOOSE_APP "Proszę wybrać program."
|
||||
IDS_CHOOSE_SUB "Proszę wybrać podkategorię."
|
||||
IDS_CHOOSE_CATEGORY "Proszę wybrać kategorię."
|
||||
IDS_CHOOSE_BOTH "Proszę wybrać podkategorię albo program."
|
||||
IDS_XMLERROR_1 "Plik XML nie został znaleziony !"
|
||||
IDS_XMLERROR_2 "Nie udało się przetworzyć pliku XML !"
|
||||
IDS_DOWNLOAD_ERROR "Sciąganie pliku nieudane.\nProszę sprawdzić połączenie z internetem."
|
||||
IDS_VERSION "Wersja: "
|
||||
IDS_LICENCE "Licenccja: "
|
||||
IDS_MAINTAINER "Opiekun: "
|
||||
IDS_APPS_TITLE "Programy"
|
||||
IDS_CATS_TITLE "Kategorie"
|
||||
IDS_CHOOSE_FOLDER "Proszę wybrać katalog..."
|
||||
IDS_NOTCREATE_REGKEY "Nie udało się utworzyć kluczy rejestru."
|
||||
IDS_DOWNLOAD_FOLDER "Pobrane"
|
||||
IDS_UNABLECREATE_FOLDER "Nie udało się stworzyć katalogu o tej nazwie!"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
IDS_INSTALL_DEP "%s jest wymagany do uruchomienia %s. Czy chcesz zainstalować %s w tej chwili?"
|
||||
TTT_HELPBUTTON "Pomoc Menedżera pobierania"
|
||||
TTT_UPDATEBUTTON "Niedostępne"
|
||||
TTT_PROFBUTTON "Ustawienia Menedżera pobierania"
|
||||
END
|
|
@ -1,63 +0,0 @@
|
|||
//Russian language file. (Dmitry Chapyshev, 2007.06.21)
|
||||
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
|
||||
IDD_DOWNLOAD DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Загрузка..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 17, SS_CENTER
|
||||
PUSHBUTTON "Отмена", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Настройки"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Папка для закачки:", -1, 6, 10, 140, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "&Выбрать...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "&Удалять установочные файлы после установки", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Сервер обновлений:", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&OK", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "О&тмена", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "Скачать! - Менеджер закачек ReactOS"
|
||||
IDS_WELCOME_TITLE "Добро пожаловать в Менеджер закачек ReactOS"
|
||||
IDS_WELCOME "Пожалуйста выберите категорию справа. Версия 1.1"
|
||||
IDS_NO_APP_TITLE "Приложение не выбрано"
|
||||
IDS_NO_APP "Пожалуйста, выберите приложение прежде, чем нажать кнопку загрузки. Если вам нужна справка, то нажмите кнопку со знаком вопроса в верхнем правом углу."
|
||||
IDS_UPDATE_TITLE "Обновить"
|
||||
IDS_UPDATE "Извините, данная возможность на данным момент недоступна."
|
||||
IDS_HELP_TITLE "Справка"
|
||||
IDS_HELP "Выберите категорию слева, затем выберите приложение и нажмите кнопку загрузки. Для получения информации об обновлениях нажмите кнопку рядом с кнопкой справки."
|
||||
IDS_NO_APPS "Извените, на данный момент в этой категории приложений нет, но вы можете помочь добавить их."
|
||||
IDS_CHOOSE_APP "Пожалуйста выберите приложение."
|
||||
IDS_CHOOSE_SUB "Пожалуйста выберите подкатегорию."
|
||||
IDS_CHOOSE_CATEGORY "Пожалуйста выберите категорию."
|
||||
IDS_CHOOSE_BOTH "Пожалуйста выберите подкатегорию или приложение."
|
||||
IDS_XMLERROR_1 "Не удалось найти xml-файл!"
|
||||
IDS_XMLERROR_2 "Не удалось обработать xml-файл!"
|
||||
IDS_DOWNLOAD_ERROR "Не удается загрузить файл.\nПожалуйста проверьте ваше подключение к интернет."
|
||||
IDS_VERSION "Версия: "
|
||||
IDS_LICENCE "Лицензия: "
|
||||
IDS_MAINTAINER "Производитель: "
|
||||
IDS_APPS_TITLE "Приложения"
|
||||
IDS_CATS_TITLE "Категории"
|
||||
IDS_CHOOSE_FOLDER "Пожалуйства выберите папку..."
|
||||
IDS_NOTCREATE_REGKEY "Не удалось создать ключ в реестре."
|
||||
IDS_DOWNLOAD_FOLDER "Downloader"
|
||||
IDS_UNABLECREATE_FOLDER "Не удалось создать папку с таким именем!"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
IDS_INSTALL_DEP "%s требуется для запуска %s. Установить %s?"
|
||||
TTT_HELPBUTTON "Показать справку программы"
|
||||
TTT_UPDATEBUTTON "Сейчас недоступно"
|
||||
TTT_PROFBUTTON "Выполнить настройку программы"
|
||||
END
|
|
@ -1,66 +0,0 @@
|
|||
/* TRANSLATOR: Mário Kaèmár /Mario Kacmar/ aka Kario (kario@szm.sk)
|
||||
* DATE OF TR: 21-01-2008
|
||||
*/
|
||||
|
||||
|
||||
LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT
|
||||
|
||||
IDD_DOWNLOAD DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "S<>ahujem ..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Zruši<C5A1>", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Nastavenia" //Preferencies
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Prieèinok s<>ahovania:", -1, 6, 10, 140, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "&Vybra<72> ...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "&Odstráni<6E> inštalaèné súbory po nainštalovaní", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Aktualizova<76> server:", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&OK", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "&Zruši<C5A1>", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "<22>ahaj! - Downloader systému ReactOS"
|
||||
IDS_WELCOME_TITLE "Vitajte v programe Downloader systému ReactOS"
|
||||
IDS_WELCOME "Vyberte, prosím, kategóriu na ¾avej strane. Toto je verzia 1.1."
|
||||
IDS_NO_APP_TITLE "Nie je vybraný žiadny program"
|
||||
IDS_NO_APP "Vyberte, prosím, program predtým než kliknete na tlaèidlo stiahnu<6E>. Ak potrebujete pomoc, kliknite, prosím, na tlaèidlo otáznika v pravom hornom rohu."
|
||||
IDS_UPDATE_TITLE "Aktualizova<76>"
|
||||
IDS_UPDATE "Prepáète, ale táto funkcia zatia¾ nie je implementovaná."
|
||||
IDS_HELP_TITLE "Pomoc"
|
||||
IDS_HELP "Vyberte kategóriu na ¾avej strane, potom vyberte program a kliknite na tlaèidlo stiahnu<6E>. Pre aktualizáciu informácii o programe kliknite na tlaèidlo ved¾a tlaèidla pomoc."
|
||||
IDS_NO_APPS "Prepáète, ale zatia¾ sa v tejto kategórii nenachádzajú žiadne programy. Môžete pomôc<C3B4> a prida<64> viac programov."
|
||||
IDS_CHOOSE_APP "Vyberte program, prosím."
|
||||
IDS_CHOOSE_SUB "Vyberte podkategóriu, prosím."
|
||||
IDS_CHOOSE_CATEGORY "Vyberte kategóriu, prosím."
|
||||
IDS_CHOOSE_BOTH "Vyberte podkategóriu alebo program, prosím."
|
||||
IDS_XMLERROR_1 "Nepodarilo sa nájs<6A> súbor xml!"
|
||||
IDS_XMLERROR_2 "Nepodarilo sa správne analyzova<76> súbor xml!"
|
||||
IDS_DOWNLOAD_ERROR "Nepodarilo sa stiahnu<6E> súbor.\nSkontrolujte, prosím, pripojenie do siete internet."
|
||||
IDS_VERSION "Verzia: "
|
||||
IDS_LICENCE "Licencia: "
|
||||
IDS_MAINTAINER "Údržbár: " //Maintainer
|
||||
IDS_APPS_TITLE "Programy"
|
||||
IDS_CATS_TITLE "Kategórie"
|
||||
IDS_CHOOSE_FOLDER "Vyberte, prosím, prieèinok ..."
|
||||
IDS_NOTCREATE_REGKEY "Nepodarilo sa vytvori<72> k¾úè registra."
|
||||
IDS_DOWNLOAD_FOLDER "Downloader"
|
||||
IDS_UNABLECREATE_FOLDER "Nie je možné vytvori<72> prieèinok s týmto názvom!"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
IDS_INSTALL_DEP "%s je potrebný pre spustenie %s. Má sa %s nainštalova<76> teraz?"
|
||||
TTT_HELPBUTTON "Získa<6B> nápoveï k programu downloader"
|
||||
TTT_UPDATEBUTTON "Zatia¾ nie je k dispozícií"
|
||||
TTT_PROFBUTTON "Dovolí Vám konfigurova<76> program downloader"
|
||||
END
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Downloader
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: rosapps/downloader/lang/uk-UA.rc
|
||||
* PURPOSE: Ukraianian Language File for Downloader
|
||||
* TRANSLATOR: Artem Reznikov
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
|
||||
|
||||
IDD_DOWNLOAD DIALOGEX LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Çàâàíòàæåííÿ..."
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Ñêàñóâàòè", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
END
|
||||
|
||||
IDD_PROF DIALOGEX 6, 6, 267, 110
|
||||
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Íàñòðîéêè"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
LTEXT "Ïàïêà äëÿ çàâàíòàæåííÿ:", -1, 6, 10, 140, 8
|
||||
EDITTEXT IDC_DOWNLOAD_FOLDER_EDIT, 6, 20, 205, 14, WS_VISIBLE | WS_TABSTOP
|
||||
PUSHBUTTON "&Âèáðàòè...", IDC_CHOOSE_BUTTON, 216, 20, 45, 14
|
||||
AUTOCHECKBOX "&Âèäàëÿòè íàñòàíîâí³ ôàéëè ï³ñëÿ óñòàíîâêè", IDC_DELINST_FILES_CHECKBOX, 8, 40, 210, 10, WS_GROUP
|
||||
LTEXT "Ñåðâåð îíîâëåíü:", -1, 6, 55, 140, 8
|
||||
EDITTEXT IDC_UPDATE_SERVER_EDIT, 6, 65, 255, 14, WS_VISIBLE | WS_TABSTOP
|
||||
DEFPUSHBUTTON "&OK", IDOK, 147, 90, 54, 15
|
||||
PUSHBUTTON "&Ñêàñóâàòè", IDCANCEL, 207, 90, 54, 15
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_WINDOW_TITLE "Çàâàíòàæèòè ! - Çàâàíòàæóâà÷ ReactOS"
|
||||
IDS_WELCOME_TITLE "Ëàñêàâî ïðîñèìî ó Çàâàíòàæóâà÷ ReactOS"
|
||||
IDS_WELCOME "Áóäü ëàñêà âèáåð³òü êàòåãîð³þ çë³âà. Öå âåðñ³ÿ 1.1."
|
||||
IDS_NO_APP_TITLE "Äîäàòîê íå âèáðàíèé"
|
||||
IDS_NO_APP "Áóäü ëàñêà, âèáåð³òü äîäàòîê ïåðø í³æ íàòèñíóòè êíîïêó çàâàíòàæåííÿ. ßêùî Âàì ïîòð³áíà äîïîìîãà, íàòèñí³òü êíîïêó ç³ çíàêîì ïèòàííÿ ó âåðõíüîìó ïðàâîìó êóòêó."
|
||||
IDS_UPDATE_TITLE "Îíîâèòè"
|
||||
IDS_UPDATE "Âèáà÷òå, äàíà ìîæëèâ³ñòü ùå íåäîñòóïíà."
|
||||
IDS_HELP_TITLE "Äîâ³äêà"
|
||||
IDS_HELP "Âèáåð³òü êàòåãîð³þ çë³âà, ïîò³ì âèáåð³òü äîäàòîê ³ íàòèñí³òü êíîïêó çàâàíòàæåííÿ. Äëÿ îòðèìàííÿ ³íôîðìàö³¿ ïðî îíîâëåííÿ íàòèñí³òü êíîïêó ïîðÿä ç êíîïêîþ äîâ³äêè."
|
||||
IDS_NO_APPS "Âèáà÷òå, â ö³é êàòåãî𳿠ùå íåìຠäîäàòê³â. Âè ìîæåòå äîïîìîãòè ³ äîäàòè á³ëüøå äîäàòê³â."
|
||||
IDS_CHOOSE_APP "Áóäü ëàñêà âèáåð³òü äîäàòîê."
|
||||
IDS_CHOOSE_SUB "Áóäü ëàñêà âèáåð³òü ï³äêàòåãîð³þ."
|
||||
IDS_CHOOSE_CATEGORY "Áóäü ëàñêà âèáåð³òü êàòåãîð³þ."
|
||||
IDS_CHOOSE_BOTH "Áóäü ëàñêà âèáåð³òü ï³äêàòåãîð³þ àáî äîäàòîê."
|
||||
IDS_XMLERROR_1 "Íå âäàëîñÿ çíàéòè ôàéë XML !"
|
||||
IDS_XMLERROR_2 "Íå âäàëîñÿ îáðîáèòè ôàéë XML !"
|
||||
IDS_DOWNLOAD_ERROR "Íåìîæëèâî çàâàíòàæèòè ôàéë.\nÁóäü ëàñêà ïåðåâ³ðòå âàøå ³íòåðíåò-ç'ºäíàííÿ."
|
||||
IDS_VERSION "Âåðñ³ÿ: "
|
||||
IDS_LICENCE "˳öåíç³ÿ: "
|
||||
IDS_MAINTAINER "Âèðîáíèê: "
|
||||
IDS_APPS_TITLE "Äîäàòêè"
|
||||
IDS_CATS_TITLE "Êàòåãîð³¿"
|
||||
IDS_CHOOSE_FOLDER "Áóäü ëàñêà âèáåð³òü ïàïêó..."
|
||||
IDS_NOTCREATE_REGKEY "Íå âäàëîñÿ ñòâîðèòè êëþ÷ ó ðåºñòð³."
|
||||
IDS_DOWNLOAD_FOLDER "Downloader"
|
||||
IDS_UNABLECREATE_FOLDER "Íå âäàëîñÿ ñòâîðèòè ïàïêó ç òàêèì ³ì'ÿì!"
|
||||
IDS_UPDATE_URL "http://svn.reactos.org"
|
||||
IDS_INSTALL_DEP "%s ïîòð³áíèé ùîá çàïóñòèòè %s. Âñòàíîâèòè %s çàðàç?"
|
||||
TTT_HELPBUTTON "Îòðèìàéòè äîïîìîãó ïðî çàâàíòàæóâà÷"
|
||||
TTT_UPDATEBUTTON "Ïîêè ùî íå äîñòóïíî"
|
||||
TTT_PROFBUTTON "Íàëàøòóâàòè çàâàíòàæóâà÷"
|
||||
END
|
|
@ -1,923 +0,0 @@
|
|||
/* PROJECT: ReactOS Downloader
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: base/applications/downloader/xml.c
|
||||
* PURPOSE: Main program
|
||||
* PROGRAMMERS: Maarten Bosma, Lester Kortenhoeven, Dmitry Chapyshev
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <richedit.h>
|
||||
#include <tchar.h>
|
||||
#include <stdio.h>
|
||||
#include <shlwapi.h>
|
||||
#include <shlobj.h>
|
||||
#include "resources.h"
|
||||
#include "structures.h"
|
||||
|
||||
HWND hwnd, hCategories, hApps, hDownloadButton, hUninstallButton, hUpdateButton, hHelpButton, hProfButton;
|
||||
HBITMAP hLogo, hUnderline;
|
||||
WCHAR* DescriptionHeadline = L"";
|
||||
WCHAR* DescriptionText = L"";
|
||||
WCHAR ApplicationText[700];
|
||||
|
||||
struct Category Root;
|
||||
struct Application* SelectedApplication;
|
||||
|
||||
INT_PTR CALLBACK DownloadProc (HWND, UINT, WPARAM, LPARAM);
|
||||
BOOL ProcessXML (const char* filename, struct Category* Root);
|
||||
VOID FreeTree (struct Category* Node);
|
||||
WCHAR Strings [STRING_COUNT][MAX_STRING_LENGHT];
|
||||
|
||||
|
||||
BOOL
|
||||
getUninstaller(WCHAR* RegName, WCHAR* Uninstaller) {
|
||||
|
||||
const DWORD ArraySize = 200;
|
||||
|
||||
HKEY hKey1;
|
||||
HKEY hKey2;
|
||||
DWORD Type = 0;
|
||||
DWORD Size = ArraySize;
|
||||
WCHAR Value[ArraySize];
|
||||
WCHAR KeyName[ArraySize];
|
||||
LONG i = 0;
|
||||
|
||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall",0,KEY_READ,&hKey1) == ERROR_SUCCESS) {
|
||||
while (RegEnumKeyExW(hKey1,i,KeyName,&Size,NULL,NULL,NULL,NULL) == ERROR_SUCCESS) {
|
||||
++i;
|
||||
RegOpenKeyExW(hKey1,KeyName,0,KEY_READ,&hKey2);
|
||||
Size = ArraySize;
|
||||
if (RegQueryValueExW(hKey2,L"DisplayName",0,&Type,(LPBYTE)Value,&Size) == ERROR_SUCCESS) {
|
||||
Size = ArraySize;
|
||||
if (StrCmpW(Value,RegName) == 0) {
|
||||
if (RegQueryValueExW(hKey2,L"UninstallString",0,&Type,(LPBYTE)Uninstaller,&Size) == ERROR_SUCCESS) {
|
||||
RegCloseKey(hKey2);
|
||||
RegCloseKey(hKey1);
|
||||
return TRUE;
|
||||
} else {
|
||||
RegCloseKey(hKey2);
|
||||
RegCloseKey(hKey1);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
RegCloseKey(hKey2);
|
||||
Size = ArraySize;
|
||||
}
|
||||
RegCloseKey(hKey1);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
ShowMessage (WCHAR* title, WCHAR* message)
|
||||
{
|
||||
DescriptionHeadline = title;
|
||||
DescriptionText = message;
|
||||
InvalidateRect(hwnd,NULL,TRUE);
|
||||
UpdateWindow(hwnd);
|
||||
}
|
||||
|
||||
void
|
||||
AddItems(HWND hwnd, struct Category* Category, struct Category* Parent)
|
||||
{
|
||||
TV_INSERTSTRUCTW Insert;
|
||||
|
||||
Insert.item.lParam = (UINT)Category;
|
||||
Insert.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE|TVIF_SELECTEDIMAGE;;
|
||||
Insert.item.pszText = Category->Name;
|
||||
Insert.item.cchTextMax = lstrlenW(Category->Name);
|
||||
Insert.item.iImage = Category->Icon;
|
||||
Insert.item.iSelectedImage = Category->Icon;
|
||||
Insert.hInsertAfter = TVI_LAST;
|
||||
Insert.hParent = Category->Parent ? Category->Parent->TreeviewItem : TVI_ROOT;
|
||||
|
||||
Category->TreeviewItem = (HTREEITEM)SendMessage(hwnd, TVM_INSERTITEM, 0, (LPARAM)&Insert);
|
||||
|
||||
if(Category->Next)
|
||||
AddItems (hwnd,Category->Next,Parent);
|
||||
|
||||
if(Category->Children)
|
||||
AddItems (hwnd,Category->Children,Category);
|
||||
}
|
||||
|
||||
void
|
||||
CategoryChoosen(HWND hwnd, struct Category* Category)
|
||||
{
|
||||
struct Application* CurrentApplication;
|
||||
TV_INSERTSTRUCTW Insert;
|
||||
SelectedApplication = NULL;
|
||||
|
||||
if(Category->Children && !Category->Apps)
|
||||
ShowMessage(Category->Name, Strings[IDS_CHOOSE_SUB]);
|
||||
else if(!Category->Children && Category->Apps)
|
||||
ShowMessage(Category->Name, Strings[IDS_CHOOSE_APP]);
|
||||
else if(Category->Children && Category->Apps)
|
||||
ShowMessage(Category->Name, Strings[IDS_CHOOSE_BOTH]);
|
||||
else
|
||||
ShowMessage(Category->Name, Strings[IDS_NO_APPS]);
|
||||
|
||||
(void)TreeView_DeleteItem(hwnd, TVI_ROOT);
|
||||
(void)TreeView_DeleteItem(hwnd, TVI_ROOT); // Delete twice to bypass bug in windows
|
||||
|
||||
Insert.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE;
|
||||
Insert.hInsertAfter = TVI_LAST;
|
||||
Insert.hParent = TVI_ROOT;
|
||||
|
||||
CurrentApplication = Category->Apps;
|
||||
|
||||
WCHAR Uninstaller[200];
|
||||
while(CurrentApplication)
|
||||
{
|
||||
Insert.item.lParam = (UINT)CurrentApplication;
|
||||
Insert.item.pszText = CurrentApplication->Name;
|
||||
Insert.item.cchTextMax = lstrlenW(CurrentApplication->Name);
|
||||
Insert.item.iImage = 10;
|
||||
if(StrCmpW(CurrentApplication->RegName,L"")) {
|
||||
if(getUninstaller(CurrentApplication->RegName, Uninstaller))
|
||||
Insert.item.iImage = 9;
|
||||
}
|
||||
SendMessage(hwnd, TVM_INSERTITEM, 0, (LPARAM)&Insert);
|
||||
CurrentApplication = CurrentApplication->Next;
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CreateToolTip(HWND hwndTool, HWND hDlg, WCHAR* pText)
|
||||
{
|
||||
if (!hwndTool || !hDlg || !pText)
|
||||
return FALSE;
|
||||
|
||||
HWND hwndTip = CreateWindowExW(0, TOOLTIPS_CLASS, NULL,
|
||||
WS_POPUP |TTS_ALWAYSTIP | TTS_BALLOON,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
hDlg, NULL,
|
||||
GetModuleHandle(NULL), NULL);
|
||||
if (!hwndTip)
|
||||
return FALSE;
|
||||
|
||||
TOOLINFO toolInfo = {0};
|
||||
toolInfo.cbSize = sizeof(toolInfo);
|
||||
toolInfo.hwnd = hDlg;
|
||||
toolInfo.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
|
||||
toolInfo.uId = (UINT_PTR)hwndTool;
|
||||
toolInfo.lpszText = pText;
|
||||
SendMessage(hwndTip, TTM_ADDTOOL, 0, (LPARAM)&toolInfo);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL
|
||||
SetupControls (HWND hwnd)
|
||||
{
|
||||
TV_INSERTSTRUCTW Insert = {0};
|
||||
HIMAGELIST hImageList;
|
||||
HINSTANCE hInstance = GetModuleHandle(NULL);
|
||||
WCHAR Cats[MAX_STRING_LENGHT], Apps[MAX_STRING_LENGHT];
|
||||
WCHAR Tooltip1[MAX_STRING_LENGHT], Tooltip2[MAX_STRING_LENGHT], Tooltip3[MAX_STRING_LENGHT];
|
||||
TCHAR Buf[MAX_PATH];
|
||||
char Tmp[MAX_PATH];
|
||||
int i;
|
||||
|
||||
// Getting downloader.xml path
|
||||
if(!GetSystemDirectory(Buf,sizeof(Buf)/sizeof(char))) return FALSE;
|
||||
lstrcat((LPTSTR)Buf, L"\\downloader.xml");
|
||||
for (i = 0; i < _tcslen(Buf) + 1; i++) Tmp[i] = Buf[i];
|
||||
|
||||
// Parse the XML file
|
||||
if (!ProcessXML(Tmp, &Root))
|
||||
return FALSE;
|
||||
|
||||
LoadStringW(hInstance, IDS_CATS_TITLE, Cats, MAX_STRING_LENGHT);
|
||||
LoadStringW(hInstance, IDS_APPS_TITLE, Apps, MAX_STRING_LENGHT);
|
||||
|
||||
// Set up the controls
|
||||
hCategories = CreateWindowExW(0, WC_TREEVIEWW, Cats,
|
||||
WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS,
|
||||
0, 0, 0, 0, hwnd, NULL, hInstance, NULL);
|
||||
|
||||
hApps = CreateWindowExW(0, WC_TREEVIEWW, Apps,
|
||||
WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS|TVS_SHOWSELALWAYS,
|
||||
0, 0, 0, 0, hwnd, NULL, hInstance, NULL);
|
||||
|
||||
hLogo = LoadBitmap(GetModuleHandle(NULL),
|
||||
MAKEINTRESOURCE(IDB_LOGO));
|
||||
hUnderline = LoadBitmap(GetModuleHandle(NULL),
|
||||
MAKEINTRESOURCE(IDB_UNDERLINE));
|
||||
|
||||
hHelpButton = CreateWindowW(L"Button", L"",
|
||||
WS_CHILD | WS_VISIBLE | BS_ICON,
|
||||
550, 10, 40, 40,
|
||||
hwnd, 0, hInstance, NULL);
|
||||
LoadString(hInstance, TTT_HELPBUTTON, Tooltip1, MAX_STRING_LENGHT);
|
||||
CreateToolTip(hHelpButton, hwnd, Tooltip1);
|
||||
|
||||
hUpdateButton = CreateWindowW(L"Button", L"",
|
||||
WS_CHILD | WS_VISIBLE | BS_ICON,
|
||||
450, 10, 40, 40,
|
||||
hwnd, 0, hInstance, NULL);
|
||||
LoadString(hInstance, TTT_UPDATEBUTTON, Tooltip2, MAX_STRING_LENGHT);
|
||||
CreateToolTip(hUpdateButton, hwnd, Tooltip2);
|
||||
|
||||
hProfButton = CreateWindowW(L"Button", L"",
|
||||
WS_CHILD | WS_VISIBLE | BS_ICON,
|
||||
500, 10, 40, 40,
|
||||
hwnd, 0, hInstance, NULL);
|
||||
LoadString(hInstance, TTT_PROFBUTTON, Tooltip3, MAX_STRING_LENGHT);
|
||||
CreateToolTip(hProfButton, hwnd, Tooltip3);
|
||||
|
||||
hDownloadButton = CreateWindowW(L"Button", L"",
|
||||
WS_CHILD | WS_VISIBLE | BS_BITMAP,
|
||||
330, 505, 140, 33,
|
||||
hwnd, 0, hInstance, NULL);
|
||||
|
||||
hUninstallButton = CreateWindowW(L"Button", L"",
|
||||
WS_CHILD | WS_VISIBLE | BS_BITMAP,
|
||||
260, 505, 140, 33,
|
||||
hwnd, 0, hInstance, NULL);
|
||||
|
||||
SendMessageW(hProfButton,
|
||||
BM_SETIMAGE,
|
||||
(WPARAM)IMAGE_ICON,
|
||||
(LPARAM)(HANDLE)LoadIcon(hInstance,MAKEINTRESOURCE(IDI_PROF)));
|
||||
SendMessageW(hHelpButton,
|
||||
BM_SETIMAGE,
|
||||
(WPARAM)IMAGE_ICON,
|
||||
(LPARAM)(HANDLE)LoadIcon(hInstance, MAKEINTRESOURCE(IDI_HELP)));
|
||||
SendMessageW(hUpdateButton,
|
||||
BM_SETIMAGE,
|
||||
(WPARAM)IMAGE_ICON,
|
||||
(LPARAM)(HANDLE)LoadIcon(hInstance, MAKEINTRESOURCE(IDI_UPDATE)));
|
||||
SendMessageW(hDownloadButton,
|
||||
BM_SETIMAGE,
|
||||
(WPARAM)IMAGE_BITMAP,
|
||||
(LPARAM)(HANDLE)LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_DOWNLOAD)));
|
||||
SendMessageW(hUninstallButton,
|
||||
BM_SETIMAGE,
|
||||
(WPARAM)IMAGE_BITMAP,
|
||||
(LPARAM)(HANDLE)LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_UNINSTALL)));
|
||||
ShowWindow(hUninstallButton, SW_HIDE);
|
||||
|
||||
// Set deflaut entry for hApps
|
||||
Insert.item.mask = TVIF_TEXT|TVIF_IMAGE;
|
||||
Insert.item.pszText = Strings[IDS_CHOOSE_CATEGORY];
|
||||
Insert.item.cchTextMax = lstrlenW(Strings[IDS_CHOOSE_CATEGORY]);
|
||||
Insert.item.iImage = 0;
|
||||
SendMessage(hApps, TVM_INSERTITEM, 0, (LPARAM)&Insert);
|
||||
|
||||
// Create Tree Icons
|
||||
hImageList = ImageList_Create(16, 16, ILC_COLORDDB, 1, 1);
|
||||
SendMessageW(hCategories, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)(HIMAGELIST)hImageList);
|
||||
SendMessageW(hApps, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)(HIMAGELIST)hImageList);
|
||||
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_0)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_1)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_2)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_3)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_4)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_5)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_6)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_7)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_8)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_9)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_10)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_11)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_12)), NULL);
|
||||
ImageList_Add(hImageList,
|
||||
LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TREEVIEW_ICON_13)), NULL);
|
||||
|
||||
// Fill the TreeViews
|
||||
AddItems (hCategories, Root.Children, NULL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
ResizeControl (HWND hwnd, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
// Make resizing a little easier
|
||||
MoveWindow(hwnd, x1, y1, x2-x1, y2-y1, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
DrawBitmap (HDC hdc, int x, int y, HBITMAP hBmp)
|
||||
{
|
||||
BITMAP bm;
|
||||
HDC hdcMem = CreateCompatibleDC(hdc);
|
||||
|
||||
SelectObject(hdcMem, hBmp);
|
||||
GetObject(hBmp, sizeof(bm), &bm);
|
||||
TransparentBlt(hdc, x, y, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, bm.bmWidth, bm.bmHeight, 0xFFFFFF);
|
||||
|
||||
DeleteDC(hdcMem);
|
||||
}
|
||||
|
||||
static void
|
||||
DrawDescription (HDC hdc, RECT DescriptionRect)
|
||||
{
|
||||
int i;
|
||||
HFONT Font;
|
||||
RECT Rect = {DescriptionRect.left+5, DescriptionRect.top+3, DescriptionRect.right-2, DescriptionRect.top+22};
|
||||
|
||||
// Backgroud
|
||||
Rectangle(hdc, DescriptionRect.left, DescriptionRect.top, DescriptionRect.right, DescriptionRect.bottom);
|
||||
|
||||
// Underline
|
||||
for (i=DescriptionRect.left+1;i<DescriptionRect.right-1;i++)
|
||||
DrawBitmap(hdc, i, DescriptionRect.top+22, hUnderline); // less code then stretching ;)
|
||||
|
||||
// Headline
|
||||
Font = CreateFont(-16 , 0, 0, 0, FW_EXTRABOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
|
||||
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, L"Arial");
|
||||
SelectObject(hdc, Font);
|
||||
DrawTextW(hdc, DescriptionHeadline, lstrlenW(DescriptionHeadline), &Rect, DT_SINGLELINE|DT_NOPREFIX);
|
||||
DeleteObject(Font);
|
||||
|
||||
// Description
|
||||
Font = CreateFont(-13 , 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET,
|
||||
OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FF_DONTCARE, L"Arial");
|
||||
SelectObject(hdc, Font);
|
||||
Rect.top += 50;
|
||||
Rect.bottom = DescriptionRect.bottom-2;
|
||||
DrawTextW(hdc, DescriptionText, lstrlenW(DescriptionText), &Rect, DT_WORDBREAK|DT_NOPREFIX); // ToDo: Call TabbedTextOut to draw a nice table
|
||||
DeleteObject(Font);
|
||||
|
||||
}
|
||||
|
||||
void showUninstaller() {
|
||||
int Split_Vertical = 200;
|
||||
RECT Rect;
|
||||
|
||||
GetClientRect(hwnd,&Rect);
|
||||
ShowWindow(hUninstallButton,SW_SHOW);
|
||||
MoveWindow(hDownloadButton,(Split_Vertical+Rect.right-Rect.left)/2,Rect.bottom-Rect.top-45,140,35,TRUE);;
|
||||
}
|
||||
|
||||
void hideUninstaller() {
|
||||
int Split_Vertical = 200;
|
||||
RECT Rect;
|
||||
|
||||
GetClientRect(hwnd,&Rect);
|
||||
ShowWindow(hUninstallButton,SW_HIDE);
|
||||
MoveWindow(hDownloadButton,(Split_Vertical+Rect.right-Rect.left)/2-70,Rect.bottom-Rect.top-45,140,35,TRUE);
|
||||
}
|
||||
|
||||
void startUninstaller(WCHAR* Uninstaller) {
|
||||
STARTUPINFOW si;
|
||||
PROCESS_INFORMATION pi;
|
||||
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
CreateProcessW(NULL,Uninstaller,NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);
|
||||
CloseHandle(pi.hThread);
|
||||
// WaitForSingleObject(pi.hProcess, INFINITE); // If you want to wait for the Unistaller
|
||||
CloseHandle(pi.hProcess);
|
||||
hideUninstaller();
|
||||
}
|
||||
|
||||
BOOL
|
||||
SaveSettings(HWND hwnd)
|
||||
{
|
||||
HKEY hKey;
|
||||
TCHAR szBuf[MAX_PATH];
|
||||
|
||||
if (RegOpenKey(HKEY_LOCAL_MACHINE,
|
||||
TEXT("Software\\ReactOS\\Downloader"),
|
||||
&hKey) != ERROR_SUCCESS)
|
||||
return FALSE;
|
||||
|
||||
GetDlgItemText(hwnd, IDC_DOWNLOAD_FOLDER_EDIT, szBuf, sizeof(szBuf) / sizeof(TCHAR));
|
||||
if (GetFileAttributes(szBuf) == 0xFFFFFFFF)
|
||||
if (!CreateDirectory((LPCTSTR)szBuf,NULL))
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), IDS_UNABLECREATE_FOLDER, szBuf, sizeof(szBuf) / sizeof(TCHAR));
|
||||
MessageBox(hwnd, (LPCTSTR)szBuf, NULL, MB_ICONSTOP);
|
||||
return FALSE;
|
||||
}
|
||||
if (RegSetValueEx(hKey,
|
||||
L"DownloadFolder",
|
||||
0,
|
||||
REG_SZ,
|
||||
(LPBYTE)szBuf,
|
||||
(DWORD)(sizeof(szBuf) / sizeof(TCHAR))))
|
||||
return FALSE;
|
||||
|
||||
GetDlgItemText(hwnd, IDC_UPDATE_SERVER_EDIT, szBuf, sizeof(szBuf) / sizeof(TCHAR));
|
||||
if (RegSetValueEx(hKey,
|
||||
L"UpdateServer",
|
||||
0,
|
||||
REG_SZ,
|
||||
(LPBYTE)szBuf,
|
||||
(DWORD)(sizeof(szBuf) / sizeof(TCHAR))))
|
||||
return FALSE;
|
||||
|
||||
DWORD dwValue;
|
||||
if (SendDlgItemMessage(hwnd, IDC_DELINST_FILES_CHECKBOX, BM_GETCHECK, 0, 0) == BST_CHECKED)
|
||||
dwValue = 0x1;
|
||||
else
|
||||
dwValue = 0x0;
|
||||
if (RegSetValueEx(hKey,
|
||||
L"DeleteInstaller",
|
||||
0,
|
||||
REG_DWORD,
|
||||
(LPBYTE)&dwValue,
|
||||
sizeof(DWORD)))
|
||||
return FALSE;
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL
|
||||
InitProfDlg(HWND hwnd)
|
||||
{
|
||||
HKEY hKey;
|
||||
TCHAR Buf[MAX_PATH];
|
||||
DWORD dwDisp, dwSize;
|
||||
|
||||
if (RegOpenKey(HKEY_LOCAL_MACHINE,
|
||||
TEXT("Software\\ReactOS\\Downloader"),
|
||||
&hKey) != ERROR_SUCCESS)
|
||||
{
|
||||
if (RegCreateKeyEx(HKEY_LOCAL_MACHINE, L"Software\\ReactOS\\Downloader",
|
||||
0, NULL, REG_OPTION_NON_VOLATILE,
|
||||
KEY_WRITE, NULL, &hKey, &dwDisp))
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), IDS_NOTCREATE_REGKEY, Buf, sizeof(Buf) / sizeof(TCHAR));
|
||||
MessageBox(hwnd, (LPCTSTR)Buf, NULL, MB_ICONSTOP);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
dwSize = MAX_PATH;
|
||||
if (RegQueryValueEx(hKey,
|
||||
L"DownloadFolder",
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)&Buf,
|
||||
&dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
SetDlgItemText(hwnd, IDC_DOWNLOAD_FOLDER_EDIT, Buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!GetWindowsDirectory(Buf, sizeof(Buf) / sizeof(TCHAR))) return FALSE;
|
||||
|
||||
TCHAR DPath[256];
|
||||
int i;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (i == 3)
|
||||
{
|
||||
DPath[i] = '\0';
|
||||
break;
|
||||
}
|
||||
DPath[i] = Buf[i];
|
||||
}
|
||||
LoadString(GetModuleHandle(NULL), IDS_DOWNLOAD_FOLDER, Buf, sizeof(Buf) / sizeof(TCHAR));
|
||||
lstrcat((LPTSTR)DPath, Buf);
|
||||
if (RegSetValueEx(hKey,
|
||||
L"DownloadFolder",
|
||||
0,
|
||||
REG_SZ,
|
||||
(LPBYTE)DPath,
|
||||
(DWORD)(sizeof(DPath) / sizeof(TCHAR))))
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
if (GetFileAttributes(DPath) == 0xFFFFFFFF)
|
||||
if (!CreateDirectory((LPCTSTR)DPath,NULL)) return FALSE;
|
||||
SetDlgItemText(hwnd, IDC_DOWNLOAD_FOLDER_EDIT, DPath);
|
||||
}
|
||||
}
|
||||
|
||||
dwSize = MAX_PATH;
|
||||
if (RegQueryValueEx(hKey,
|
||||
L"UpdateServer",
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)&Buf,
|
||||
&dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
SetDlgItemText(hwnd, IDC_UPDATE_SERVER_EDIT, Buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), IDS_UPDATE_URL, Buf, sizeof(Buf) / sizeof(TCHAR));
|
||||
if (RegSetValueEx(hKey,
|
||||
L"UpdateServer",
|
||||
0,
|
||||
REG_SZ,
|
||||
(LPBYTE)Buf,
|
||||
(DWORD)(sizeof(Buf) / sizeof(TCHAR))))
|
||||
return FALSE;
|
||||
else
|
||||
{
|
||||
SetDlgItemText(hwnd, IDC_UPDATE_SERVER_EDIT, Buf);
|
||||
}
|
||||
}
|
||||
|
||||
DWORD dwValue, dwType = REG_DWORD;
|
||||
dwSize = sizeof(DWORD);
|
||||
if (RegQueryValueEx(hKey,
|
||||
L"DeleteInstaller",
|
||||
NULL,
|
||||
&dwType,
|
||||
(LPBYTE)&dwValue,
|
||||
&dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
if (dwValue == 0x1)
|
||||
SendDlgItemMessage(hwnd, IDC_DELINST_FILES_CHECKBOX, BM_SETCHECK, 1, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
dwValue = 0x0;
|
||||
if (RegSetValueEx(hKey,
|
||||
L"DeleteInstaller",
|
||||
0,
|
||||
REG_DWORD,
|
||||
(LPBYTE)&dwValue,
|
||||
sizeof(DWORD)))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL
|
||||
ChooseFolder(HWND hwnd)
|
||||
{
|
||||
BROWSEINFO fi;
|
||||
LPCITEMIDLIST lpItemList;
|
||||
TCHAR szPath[MAX_PATH],Buf[256];
|
||||
|
||||
ZeroMemory(&fi, sizeof(BROWSEINFO));
|
||||
fi.hwndOwner = hwnd;
|
||||
LoadString(GetModuleHandle(NULL), IDS_CHOOSE_FOLDER, Buf, sizeof(Buf) / sizeof(TCHAR));
|
||||
fi.lpszTitle = (LPCTSTR)Buf;
|
||||
fi.ulFlags = BIF_DONTGOBELOWDOMAIN | BIF_RETURNONLYFSDIRS | BIF_BROWSEFORCOMPUTER | BIF_NEWDIALOGSTYLE;
|
||||
fi.lpfn = NULL;
|
||||
fi.lParam = -1;
|
||||
fi.iImage = 0;
|
||||
|
||||
if(!(lpItemList = SHBrowseForFolder(&fi))) return FALSE;
|
||||
SHGetPathFromIDList(lpItemList, szPath);
|
||||
|
||||
if (_tcslen(szPath) == 0) return FALSE;
|
||||
SetDlgItemText(hwnd, IDC_DOWNLOAD_FOLDER_EDIT, szPath);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
INT_PTR CALLBACK
|
||||
ProfDlgProc(HWND hDlg,
|
||||
UINT message,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
static HICON hIcon;
|
||||
UNREFERENCED_PARAMETER(lParam);
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
hIcon = LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_MAIN),IMAGE_ICON,16,16,0);
|
||||
SendMessage(hDlg,WM_SETICON,ICON_SMALL,(LPARAM)hIcon);
|
||||
InitProfDlg(hDlg);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (wParam)
|
||||
{
|
||||
case IDC_CHOOSE_BUTTON:
|
||||
ChooseFolder(hDlg);
|
||||
break;
|
||||
case IDOK:
|
||||
{
|
||||
SaveSettings(hDlg);
|
||||
DestroyIcon(hIcon);
|
||||
EndDialog(hDlg,LOWORD(wParam));
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case IDCANCEL:
|
||||
{
|
||||
DestroyIcon(hIcon);
|
||||
EndDialog(hDlg,LOWORD(wParam));
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL IsApplicationInstalled(struct Application* App)
|
||||
{
|
||||
WCHAR Uninstaller[200];
|
||||
if(StrCmpW(App->RegName, L"")) {
|
||||
if(getUninstaller(App->RegName, Uninstaller)) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
struct Application* GetDependency(const WCHAR* Dependency)
|
||||
{
|
||||
struct Category* Category = Root.Children;
|
||||
|
||||
while (Category->Next)
|
||||
{
|
||||
while (Category->Apps)
|
||||
{
|
||||
if(StrCmpW(Category->Apps->RegName, Dependency) == 0)
|
||||
return Category->Apps;
|
||||
Category->Apps = Category->Apps->Next;
|
||||
}
|
||||
Category = Category->Next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LRESULT CALLBACK
|
||||
WndProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static RECT DescriptionRect;
|
||||
struct Application* AppToInstall;
|
||||
WCHAR InstallDep[260];
|
||||
WCHAR InstallDepBuffer[260];
|
||||
WCHAR Title[260];
|
||||
|
||||
switch (Message)
|
||||
{
|
||||
case WM_CREATE:
|
||||
{
|
||||
if(!SetupControls(hwnd))
|
||||
return -1;
|
||||
ShowMessage(Strings[IDS_WELCOME_TITLE], Strings[IDS_WELCOME]);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_PAINT:
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc = BeginPaint(hwnd, &ps);
|
||||
HDC BackbufferHdc = CreateCompatibleDC(hdc);
|
||||
HBITMAP BackbufferBmp = CreateCompatibleBitmap(hdc, ps.rcPaint.right, ps.rcPaint.bottom);
|
||||
SelectObject(BackbufferHdc, BackbufferBmp);
|
||||
|
||||
FillRect(BackbufferHdc, &ps.rcPaint, CreateSolidBrush(RGB(235,235,235)));
|
||||
DrawBitmap(BackbufferHdc, 10, 12, hLogo);
|
||||
DrawDescription(BackbufferHdc, DescriptionRect);
|
||||
|
||||
BitBlt(hdc, 0, 0, ps.rcPaint.right, ps.rcPaint.bottom, BackbufferHdc, 0, 0, SRCCOPY);
|
||||
DeleteObject(BackbufferBmp);
|
||||
DeleteDC(BackbufferHdc);
|
||||
EndPaint(hwnd, &ps);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
if(HIWORD(wParam) == BN_CLICKED)
|
||||
{
|
||||
if (lParam == (LPARAM)hProfButton)
|
||||
{
|
||||
DialogBox(GetModuleHandle(NULL),
|
||||
MAKEINTRESOURCE(IDD_PROF),
|
||||
hwnd,
|
||||
ProfDlgProc);
|
||||
}
|
||||
if (lParam == (LPARAM)hDownloadButton)
|
||||
{
|
||||
if(SelectedApplication)
|
||||
{
|
||||
/* install dependencies */
|
||||
if(StrCmpW(SelectedApplication->Depends, L""))
|
||||
{
|
||||
AppToInstall = SelectedApplication;
|
||||
SelectedApplication = GetDependency(SelectedApplication->Depends);
|
||||
if (SelectedApplication)
|
||||
if (!IsApplicationInstalled(SelectedApplication))
|
||||
{
|
||||
LoadString(GetModuleHandle(NULL), IDS_INSTALL_DEP, InstallDep, sizeof(InstallDep) / sizeof(WCHAR));
|
||||
LoadString(GetModuleHandle(NULL), IDS_WINDOW_TITLE, Title, sizeof(Title) / sizeof(WCHAR));
|
||||
_snwprintf(InstallDepBuffer, sizeof(InstallDepBuffer) / sizeof(WCHAR), InstallDep, SelectedApplication->Name, AppToInstall->Name, SelectedApplication->Name);
|
||||
if (MessageBox(hwnd, InstallDepBuffer, Title, MB_YESNO | MB_ICONINFORMATION) == IDYES)
|
||||
{
|
||||
DialogBoxW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_DOWNLOAD), 0, DownloadProc);
|
||||
}
|
||||
}
|
||||
SelectedApplication = AppToInstall;
|
||||
}
|
||||
|
||||
/* download and install the app */
|
||||
DialogBoxW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_DOWNLOAD), 0, DownloadProc);
|
||||
|
||||
/* install req. hacks to get it working */
|
||||
if(StrCmpW(SelectedApplication->PostInstallAction, L""))
|
||||
{
|
||||
AppToInstall = SelectedApplication;
|
||||
CopyMemory(SelectedApplication->Location, SelectedApplication->PostInstallAction, sizeof(SelectedApplication->Location));
|
||||
DialogBoxW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_DOWNLOAD), 0, DownloadProc);
|
||||
SelectedApplication = AppToInstall;
|
||||
}
|
||||
}
|
||||
else
|
||||
ShowMessage(Strings[IDS_NO_APP_TITLE], Strings[IDS_NO_APP]);
|
||||
}
|
||||
else if (lParam == (LPARAM)hUninstallButton)
|
||||
{
|
||||
if(SelectedApplication)
|
||||
{
|
||||
WCHAR Uninstaller[200];
|
||||
if(StrCmpW(SelectedApplication->RegName, L"")) {
|
||||
if(getUninstaller(SelectedApplication->RegName, Uninstaller))
|
||||
startUninstaller(Uninstaller);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (lParam == (LPARAM)hUpdateButton)
|
||||
{
|
||||
ShowMessage(Strings[IDS_UPDATE_TITLE], Strings[IDS_UPDATE]);
|
||||
}
|
||||
else if (lParam == (LPARAM)hHelpButton)
|
||||
{
|
||||
ShowMessage(Strings[IDS_HELP_TITLE], Strings[IDS_HELP]);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_NOTIFY:
|
||||
{
|
||||
LPNMHDR data = (LPNMHDR)lParam;
|
||||
if(data->code == TVN_SELCHANGED)
|
||||
{
|
||||
BOOL bShowUninstaller = FALSE;
|
||||
if(data->hwndFrom == hCategories)
|
||||
{
|
||||
struct Category* Category = (struct Category*) ((LPNMTREEVIEW)lParam)->itemNew.lParam;
|
||||
CategoryChoosen (hApps, Category);
|
||||
}
|
||||
else if(data->hwndFrom == hApps)
|
||||
{
|
||||
SelectedApplication = (struct Application*) ((LPNMTREEVIEW)lParam)->itemNew.lParam;
|
||||
if(SelectedApplication)
|
||||
{
|
||||
ApplicationText[0]=L'\0';
|
||||
if(StrCmpW(SelectedApplication->Version, L"")) {
|
||||
StrCatW(ApplicationText, Strings[IDS_VERSION]);
|
||||
StrCatW(ApplicationText, SelectedApplication->Version);
|
||||
StrCatW(ApplicationText, L"\n");
|
||||
}
|
||||
if(StrCmpW(SelectedApplication->Licence, L"")) {
|
||||
StrCatW(ApplicationText, Strings[IDS_LICENCE]);
|
||||
StrCatW(ApplicationText, SelectedApplication->Licence);
|
||||
StrCatW(ApplicationText, L"\n");
|
||||
}
|
||||
if(StrCmpW(SelectedApplication->Maintainer, L"")) {
|
||||
StrCatW(ApplicationText, Strings[IDS_MAINTAINER]);
|
||||
StrCatW(ApplicationText, SelectedApplication->Maintainer);
|
||||
StrCatW(ApplicationText, L"\n");
|
||||
}
|
||||
if(StrCmpW(SelectedApplication->Licence, L"") || StrCmpW(SelectedApplication->Version, L"") || StrCmpW(SelectedApplication->Maintainer, L""))
|
||||
StrCatW(ApplicationText, L"\n");
|
||||
StrCatW(ApplicationText, SelectedApplication->Description);
|
||||
ShowMessage(SelectedApplication->Name, ApplicationText);
|
||||
WCHAR Uninstaller[200];
|
||||
if(StrCmpW(SelectedApplication->RegName, L"")) {
|
||||
if(getUninstaller(SelectedApplication->RegName, Uninstaller)) {
|
||||
bShowUninstaller = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bShowUninstaller)
|
||||
showUninstaller();
|
||||
else
|
||||
hideUninstaller();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SIZING:
|
||||
{
|
||||
LPRECT pRect = (LPRECT)lParam;
|
||||
if (pRect->right-pRect->left < 520)
|
||||
pRect->right = pRect->left + 520;
|
||||
|
||||
if (pRect->bottom-pRect->top < 300)
|
||||
pRect->bottom = pRect->top + 300;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_SIZE:
|
||||
{
|
||||
int Split_Hozizontal = (HIWORD(lParam)-(45+60))/2 + 60;
|
||||
int Split_Vertical = 200;
|
||||
|
||||
ResizeControl(hCategories, 10, 60, Split_Vertical, HIWORD(lParam)-10);
|
||||
ResizeControl(hApps, Split_Vertical+5, 60, LOWORD(lParam)-10, Split_Hozizontal);
|
||||
RECT Rect = {Split_Vertical+5, Split_Hozizontal+5, LOWORD(lParam)-10, HIWORD(lParam)-50};
|
||||
DescriptionRect = Rect;
|
||||
|
||||
MoveWindow(hHelpButton, LOWORD(lParam)-50, 10, 40, 40, TRUE);
|
||||
MoveWindow(hUpdateButton, LOWORD(lParam)-150, 10, 40, 40, TRUE);
|
||||
MoveWindow(hProfButton, LOWORD(lParam)-100, 10, 40, 40, TRUE);
|
||||
if(IsWindowVisible(hUninstallButton))
|
||||
MoveWindow(hDownloadButton, (Split_Vertical+LOWORD(lParam))/2, HIWORD(lParam)-45, 140, 35, TRUE);
|
||||
else
|
||||
MoveWindow(hDownloadButton, (Split_Vertical+LOWORD(lParam))/2-70, HIWORD(lParam)-45, 140, 35, TRUE);
|
||||
MoveWindow(hUninstallButton, (Split_Vertical+LOWORD(lParam))/2-140, HIWORD(lParam)-45, 140, 35, TRUE);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
{
|
||||
DeleteObject(hLogo);
|
||||
if(Root.Children)
|
||||
FreeTree(Root.Children);
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return DefWindowProc (hwnd, Message, wParam, lParam);
|
||||
}
|
||||
|
||||
INT WINAPI
|
||||
wWinMain (HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInst,
|
||||
LPTSTR lpCmdLine,
|
||||
INT nCmdShow)
|
||||
{
|
||||
int i;
|
||||
WNDCLASSEXW WndClass = {0};
|
||||
MSG msg;
|
||||
|
||||
InitCommonControls();
|
||||
|
||||
// Load strings
|
||||
for(i=0; i<STRING_COUNT; i++)
|
||||
LoadStringW(hInstance, i, Strings[i], MAX_STRING_LENGHT); // if you know a better method please tell me.
|
||||
|
||||
// Create the window
|
||||
WndClass.cbSize = sizeof(WNDCLASSEX);
|
||||
WndClass.lpszClassName = L"Downloader";
|
||||
WndClass.lpfnWndProc = WndProc;
|
||||
WndClass.hInstance = hInstance;
|
||||
WndClass.style = CS_HREDRAW | CS_VREDRAW;
|
||||
WndClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MAIN));
|
||||
WndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
|
||||
RegisterClassExW(&WndClass);
|
||||
|
||||
hwnd = CreateWindowW(L"Downloader",
|
||||
Strings[IDS_WINDOW_TITLE],
|
||||
WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
720, 550,
|
||||
NULL, NULL,
|
||||
hInstance,
|
||||
NULL);
|
||||
|
||||
// Show it
|
||||
ShowWindow(hwnd, SW_SHOW);
|
||||
UpdateWindow(hwnd);
|
||||
|
||||
// Message Loop
|
||||
while(GetMessage(&msg,NULL,0,0))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
HKEY hKey;
|
||||
DWORD dwVal = 1;
|
||||
DWORD dwSize = MAX_PATH;
|
||||
DWORD lpdwDisposition = 0;
|
||||
CHAR szBuf[MAX_PATH];
|
||||
|
||||
printf("%s", "Setting Diablo 2 commandline parameters to -w -glide...");
|
||||
|
||||
if (RegCreateKeyExA (HKEY_CURRENT_USER,
|
||||
"SOFTWARE\\Blizzard Entertainment\\Diablo II Shareware",
|
||||
0,
|
||||
NULL,
|
||||
0,
|
||||
KEY_ALL_ACCESS,
|
||||
NULL,
|
||||
&hKey,
|
||||
&lpdwDisposition));
|
||||
{
|
||||
strcpy(szBuf, "-w -glide");
|
||||
|
||||
RegSetValueExA(hKey, "UseCmdLine", 0, REG_DWORD, (LPCSTR)&dwVal, sizeof(dwVal));
|
||||
RegSetValueExA(hKey, "CmdLine", 0, REG_SZ, (LPCSTR)szBuf, strlen(szBuf)+1);
|
||||
|
||||
RegCloseKey(hKey);
|
||||
printf("%s", "done.");
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/* Icons */
|
||||
#define IDI_MAIN 0x0
|
||||
#define IDI_UPDATE 5000
|
||||
#define IDI_HELP 5001
|
||||
#define IDI_PROF 5002
|
||||
/* Bitmaps */
|
||||
#define IDB_UNDERLINE 0x100
|
||||
#define IDB_LOGO 0x101
|
||||
#define IDB_DOWNLOAD 0x102
|
||||
#define IDB_UNINSTALL 0x103
|
||||
#define IDB_TREEVIEW_ICON_0 0x900
|
||||
#define IDB_TREEVIEW_ICON_1 0x901
|
||||
#define IDB_TREEVIEW_ICON_2 0x902
|
||||
#define IDB_TREEVIEW_ICON_3 0x903
|
||||
#define IDB_TREEVIEW_ICON_4 0x904
|
||||
#define IDB_TREEVIEW_ICON_5 0x905
|
||||
#define IDB_TREEVIEW_ICON_6 0x906
|
||||
#define IDB_TREEVIEW_ICON_7 0x907
|
||||
#define IDB_TREEVIEW_ICON_8 0x908
|
||||
#define IDB_TREEVIEW_ICON_9 0x909
|
||||
#define IDB_TREEVIEW_ICON_10 0x910
|
||||
#define IDB_TREEVIEW_ICON_11 0x911
|
||||
#define IDB_TREEVIEW_ICON_12 0x912
|
||||
#define IDB_TREEVIEW_ICON_13 0x913
|
||||
/* Dialogs */
|
||||
#define IDD_DOWNLOAD 0x100
|
||||
#define IDD_PROF 6000
|
||||
/* Controls */
|
||||
#define IDC_PROGRESS 0x1000
|
||||
#define IDC_STATUS 0x1001
|
||||
#define IDC_REMOVE 0x1002
|
||||
#define IDC_DOWNLOAD_FOLDER_EDIT 0x1003
|
||||
#define IDC_CHOOSE_BUTTON 0x1004
|
||||
#define IDC_UPDATE_SERVER_EDIT 0x1005
|
||||
#define IDC_DELINST_FILES_CHECKBOX 0x1006
|
||||
/* Strings */
|
||||
#define IDS_WINDOW_TITLE 0
|
||||
#define IDS_WELCOME_TITLE 1
|
||||
#define IDS_WELCOME 2
|
||||
#define IDS_NO_APP_TITLE 3
|
||||
#define IDS_NO_APP 4
|
||||
#define IDS_UPDATE_TITLE 5
|
||||
#define IDS_UPDATE 6
|
||||
#define IDS_HELP_TITLE 7
|
||||
#define IDS_HELP 8
|
||||
#define IDS_NO_APPS 9
|
||||
#define IDS_CHOOSE_APP 10
|
||||
#define IDS_CHOOSE_SUB 11
|
||||
#define IDS_CHOOSE_CATEGORY 12
|
||||
#define IDS_CHOOSE_BOTH 13
|
||||
#define IDS_XMLERROR_1 14
|
||||
#define IDS_XMLERROR_2 15
|
||||
#define IDS_DOWNLOAD_ERROR 16
|
||||
#define IDS_VERSION 17
|
||||
#define IDS_LICENCE 18
|
||||
#define IDS_MAINTAINER 19
|
||||
#define IDS_APPS_TITLE 20
|
||||
#define IDS_CATS_TITLE 21
|
||||
#define IDS_CHOOSE_FOLDER 22
|
||||
#define IDS_NOTCREATE_REGKEY 23
|
||||
#define IDS_DOWNLOAD_FOLDER 24
|
||||
#define IDS_UNABLECREATE_FOLDER 25
|
||||
#define IDS_UPDATE_URL 26
|
||||
#define IDS_INSTALL_DEP 27
|
||||
/* Tool tips */
|
||||
#define TTT_HELPBUTTON 50
|
||||
#define TTT_UPDATEBUTTON 51
|
||||
#define TTT_PROFBUTTON 52
|
||||
/* Other */
|
||||
#define STRING_COUNT 20
|
||||
#define MAX_STRING_LENGHT 0x100
|
Binary file not shown.
Before Width: | Height: | Size: 822 B |
Binary file not shown.
Before Width: | Height: | Size: 822 B |
Binary file not shown.
Before Width: | Height: | Size: 824 B |
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue