diff --git a/readme.md b/readme.md index 3be02e0..a00243e 100644 --- a/readme.md +++ b/readme.md @@ -1,12 +1,17 @@ - Sys Req: Visual C++ 2010 redist https://www.microsoft.com/en-us/download/details.aspx?id=14632 -and openssl ![Screen1](/screens/Untitled%201.jpg) +![Screen1](/screens/Untitled%202.jpg) +![Screen1](/screens/Untitled%208.jpg) ## about mines block that starts blockchain. - all options are in `MainFrm.h` -## build: +where are these tools were used? +https://github.com/DMDcoin/Diamond/blob/a1a7f6b8a3bad0df8fd8ddb9ead0347b1fa440f4/src/chainparams.cpp#L125 +i.e. +## build: +Req: `.lib` out of openssl build + nmake holds well on non-2010 - ms visual studio 2010 (C++) 32/64-bit : conf manager/change active solution platform diff --git a/screens/Untitled 1.jpg b/screens/Untitled 1.jpg index 04d9106..c32f9fd 100644 Binary files a/screens/Untitled 1.jpg and b/screens/Untitled 1.jpg differ diff --git a/screens/Untitled 2.jpg b/screens/Untitled 2.jpg new file mode 100644 index 0000000..913009f Binary files /dev/null and b/screens/Untitled 2.jpg differ diff --git a/screens/Untitled 8.jpg b/screens/Untitled 8.jpg new file mode 100644 index 0000000..2e980e6 Binary files /dev/null and b/screens/Untitled 8.jpg differ diff --git a/tool3/MainFrm.cpp b/tool3/MainFrm.cpp index 4a4d1b1..30eaba6 100644 --- a/tool3/MainFrm.cpp +++ b/tool3/MainFrm.cpp @@ -9,6 +9,7 @@ #include "MainFrm.h" #include #include +#include "mount.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -22,6 +23,7 @@ BEGIN_MESSAGE_MAP(CMainFrame, CWnd) ON_WM_CREATE() ON_BN_CLICKED(2133,tr) ON_BN_CLICKED(233,w) + ON_BN_CLICKED(2233,uw) ON_WM_DESTROY() ON_WM_CLOSE() END_MESSAGE_MAP() @@ -49,16 +51,18 @@ CMainFrame::~CMainFrame() // CMainFrame message handlers - +mount *mount_tx; HWND hc,hz; CButton *bh; CButton *q; CStatic *b7[3]; HANDLE cl; +CButton *finA; int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { + mount_tx=NULL; cl=CreateEvent(NULL,1,0,NULL); if (CWnd::OnCreate(lpCreateStruct) == -1) return -1; @@ -69,20 +73,22 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) b7[2]=new CStatic(); q=new CButton(); CBitmap wq[2]; + finA=new CButton(); wq[0].LoadBitmap(IDB_BITMAP1); wq[1].LoadBitmap(IDB_BITMAP4); wchar_t w[140]; - bh->Create(L"start",BS_BITMAP|WS_CHILD|WS_VISIBLE,CRect(50,50,170,100),this,2133); + bh->Create(L"start",BS_BITMAP|WS_CHILD|WS_VISIBLE|WS_DISABLED,CRect(50,50,170,100),this,2133); bh->SetBitmap(wq[0]); q->Create(L"stop",BS_BITMAP|WS_CHILD|WS_VISIBLE|WS_DISABLED,CRect(50+170,50,170+170,100),this,233); q->SetBitmap(wq[1]); b7[0]->Create(L"to go :",WS_CHILD|WS_VISIBLE|SS_WHITEFRAME|SS_SIMPLE,CRect(3,290,473,320),this); b7[1]->Create(L"to go :",WS_CHILD|WS_VISIBLE|SS_WHITEFRAME|SS_SIMPLE,CRect(3,290-70,473,320-70),this); b7[2]->Create(L"to go :",WS_CHILD|WS_VISIBLE|SS_WHITEFRAME|SS_SIMPLE,CRect(3,290-35,473,320-35),this); - hc=CreateWindowEx(WS_EX_NOPARENTNOTIFY, MSFTEDIT_CLASS,NULL, + finA->Create(L"init",BS_TEXT|WS_CHILD|WS_VISIBLE,CRect(0+280,20+292,59+280,48+292),this,2233); + hc=CreateWindowEx(WS_EX_NOPARENTNOTIFY, MSFTEDIT_CLASS,NULL, ES_MULTILINE|ES_AUTOVSCROLL| WS_VISIBLE | WS_CHILD |WS_TABSTOP|WS_VSCROLL, 1, 350, 450, 201, this->m_hWnd, NULL, h, NULL); HFONT newFont = CreateFont(22, 0, 0, 0,0 , FALSE, FALSE, FALSE, DEFAULT_CHARSET, @@ -170,14 +176,17 @@ VOID c(VOID *x) SETTEXTEX fw; fw.flags=4; fw.codepage=1200; - Transaction *transaction; + + Transaction *transaction; unsigned char hash1[32]; uint32_t timestamp_len = 0, scriptSig_len = 0, pubkey_len = 0, pubkeyScript_len = 0; - pubkey_len = strlen(pubkey) / 2; // One byte is represented as two hex characters, thus we divide by two to get real length. - timestamp_len = strlen(timestamp); + pubkey_len = wcslen(mount_tx->m_pubkey) / 2; // One byte is represented as two hex characters, thus we divide by two to get real length. + timestamp_len = wcslen(mount_tx->m_timestamp); + CW2A timestamp((LPCWSTR)mount_tx->m_timestamp); + CW2A pubkey((LPCWSTR)mount_tx->m_pubkey); - transaction = InitTransaction(); + transaction = InitTransaction(); scriptSig_len = timestamp_len; // Encode pubkey to binary and prepend pubkey size, then append the OP_CHECKSIG byte @@ -193,27 +202,27 @@ VOID c(VOID *x) // This is basically how I believe the size of the nBits is calculated - if (nBits < 0x100) + if (mount_tx->m_nb < 0x100) { transaction->scriptSig[scriptSig_pos++] = 0x01; - transaction->scriptSig[scriptSig_pos++] = (uint8_t)nBits; + transaction->scriptSig[scriptSig_pos++] = (uint8_t)mount_tx->m_nb; } - else if(nBits < 0x10000) + else if(mount_tx->m_nb < 0x10000) { transaction->scriptSig[scriptSig_pos++] = 0x02; - memcpy(transaction->scriptSig+scriptSig_pos, &nBits, 2); + memcpy(transaction->scriptSig+scriptSig_pos, &mount_tx->m_nb, 2); scriptSig_pos+=2; } - else if(nBits < 0x1000000) + else if(mount_tx->m_nb < 0x1000000) { transaction->scriptSig[scriptSig_pos++] = 0x03; - memcpy(transaction->scriptSig+scriptSig_pos, &nBits, 3); + memcpy(transaction->scriptSig+scriptSig_pos, &mount_tx->m_nb, 3); scriptSig_pos+=3; } - else //else if(nBits < 4294967296LL) + else //else if(mount_tx->m_nb < 4294967296) { transaction->scriptSig[scriptSig_pos++] = 0x04; - memcpy(transaction->scriptSig+scriptSig_pos, &nBits, 4); + memcpy(transaction->scriptSig+scriptSig_pos, &mount_tx->m_nb, 4); scriptSig_pos+=4; } //below works only if structure alignment turned off . @@ -224,12 +233,10 @@ VOID c(VOID *x) // It should essentially mean PUSH 1 byte on the stack which in this case is 0x04 or just 4 transaction->scriptSig[scriptSig_pos++] = 0x01; transaction->scriptSig[scriptSig_pos++] = 0x04; - transaction->scriptSig[scriptSig_pos++] = (uint8_t)scriptSig_len; - scriptSig_len += scriptSig_pos; transaction->scriptSig = (uint8_t*)realloc(transaction->scriptSig, scriptSig_len); - memcpy(transaction->scriptSig+scriptSig_pos, (const unsigned char *)timestamp, timestamp_len); + memcpy(transaction->scriptSig+scriptSig_pos, timestamp, timestamp_len); uint32_t serializedLen = 4 // tx version @@ -281,7 +288,7 @@ VOID c(VOID *x) PostMessage(hc, WM_VSCROLL, SB_BOTTOM, 0); unsigned char block_hash1[32]; - blockheader block_header={/* drift */ 1 , {} , {} , unixtime == 0 ? time(NULL) + c : unixtime + c, nBits , startNonce }; + blockheader block_header={/* drift */ 1 , {} , {} , mount_tx->m_ut == 0 ? time(NULL) + c : mount_tx->m_ut + c, mount_tx->m_nb , mount_tx->m_nonce }; blockhash block_hashf; unsigned char* block_headerp=(unsigned char*)&block_header; unsigned char* block_hashfp=(unsigned char*)&block_hashf; @@ -377,7 +384,8 @@ void CMainFrame::OnDestroy() delete b7[1]; delete b7[2]; // delete rew; - + delete finA; + if(mount_tx) delete mount_tx; // TODO: Add your message handler code here } @@ -407,3 +415,11 @@ void CMainFrame::OnClose() } } +void CMainFrame::uw() +{ + mount_tx=new mount(NULL); + int c=mount_tx->DoModal(); + if(c!=IDOK) { delete mount_tx ; mount_tx = NULL; bh->EnableWindow(0); return;} + bh->EnableWindow(); + +} \ No newline at end of file diff --git a/tool3/MainFrm.h b/tool3/MainFrm.h index f6c0ab9..ad6dcd1 100644 --- a/tool3/MainFrm.h +++ b/tool3/MainFrm.h @@ -1,8 +1,8 @@ -const uint32_t nBits = 486604799; -const uint32_t startNonce=0; //= 2083236893; -const uint32_t unixtime=0; //= 1231006505; -const char timestamp[]="The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"; -const char pubkey[131]="04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f"; +//const uint32_t nBits = 486604799; +//const uint32_t startNonce=0; //= 2083236893; +//const uint32_t unixtime=0; //= 1231006505; +//const char timestamp[]="The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"; +//const char pubkey[131]="04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f"; // MainFrm.h : interface of the CMainFrame class @@ -52,6 +52,7 @@ class CMainFrame : public CWnd afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void tr(); afx_msg void w(); + afx_msg void uw(); afx_msg void OnDestroy(); protected: public: diff --git a/tool3/ReadMe.txt b/tool3/ReadMe.txt index 07cbec7..061d9ba 100644 --- a/tool3/ReadMe.txt +++ b/tool3/ReadMe.txt @@ -41,7 +41,14 @@ For the main frame window: MainFrm.h, MainFrm.cpp These files contain the frame class CMainFrame, which is derived from - CFrameWnd and controls all SDI frame features. + CFrameWnd + +also + +tool3.h: +structures to represent all that. defines're there so to make it compatible with hash functions. transaction structure +doesn't need that.same define statements there to ensure that nothing more is in memory so first : it can be copied as memory block wo care (not a big deal) , +second : if structure has alignment you can copy it as block too but it gives nothing in this case. ///////////////////////////////////////////////////////////////////////////// diff --git a/tool3/mount.cpp b/tool3/mount.cpp new file mode 100644 index 0000000..31cdf90 --- /dev/null +++ b/tool3/mount.cpp @@ -0,0 +1,59 @@ +// mount.cpp : implementation file +// + +#include "stdafx.h" +#include "tool3.h" +#include "mount.h" +#include "afxdialogex.h" + + +// mount dialog + +IMPLEMENT_DYNAMIC(mount, CDialogEx) + +mount::mount(CWnd* pParent /*=NULL*/) + : CDialogEx(mount::IDD, pParent) +{ + m_nonce = 0; + m_ut = 0; + m_nb = 0; + m_timestamp = _T(""); + m_pubkey = _T(""); +} + +mount::~mount() +{ +} + +void mount::OnFinalRelease() +{ + // When the last reference for an automation object is released + // OnFinalRelease is called. The base class will automatically + // deletes the object. Add additional cleanup required for your + // object before calling the base class. + + CDialogEx::OnFinalRelease(); +} + +void mount::DoDataExchange(CDataExchange* pDX) +{ + CDialogEx::DoDataExchange(pDX); + DDX_Text(pDX, IDC_EDIT5, m_nonce); + DDX_Text(pDX, IDC_EDIT4, m_ut); + DDX_Text(pDX, IDC_EDIT3, m_nb); + DDX_Text(pDX, IDC_EDIT2, m_timestamp); + DDV_MaxChars(pDX, m_timestamp, 254); + DDX_Text(pDX, IDC_EDIT1, m_pubkey); + DDV_MaxChars(pDX, m_pubkey, 130); +} + +BEGIN_MESSAGE_MAP(mount, CDialogEx) + ON_BN_CLICKED(IDC_BUTTON1, &mount::OnBnClickedButton1) +END_MESSAGE_MAP() + +// mount message handlers + +void mount::OnBnClickedButton1() +{ + this->OnOK(); +} diff --git a/tool3/mount.h b/tool3/mount.h new file mode 100644 index 0000000..8718333 --- /dev/null +++ b/tool3/mount.h @@ -0,0 +1,30 @@ +#pragma once + + +// mount dialog + +class mount : public CDialogEx +{ + DECLARE_DYNAMIC(mount) + +public: + mount(CWnd* pParent = NULL); // standard constructor + virtual ~mount(); + + virtual void OnFinalRelease(); + +// Dialog Data + enum { IDD = IDD_DIALOGBAR }; + +protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + + DECLARE_MESSAGE_MAP() +public: + UINT m_nonce; + afx_msg void OnBnClickedButton1(); + UINT m_ut; + UINT m_nb; + CString m_timestamp; + CString m_pubkey; +}; diff --git a/tool3/resource.h b/tool3/resource.h index e3672b7..c46d83f 100644 Binary files a/tool3/resource.h and b/tool3/resource.h differ diff --git a/tool3/stdafx.h b/tool3/stdafx.h index d81be56..ea05a8c 100644 --- a/tool3/stdafx.h +++ b/tool3/stdafx.h @@ -27,6 +27,7 @@ #ifndef _AFX_NO_AFXCMN_SUPPORT #include // MFC support for Windows Common Controls #endif // _AFX_NO_AFXCMN_SUPPORT +#include //#include // MFC support for ribbons and control bars #ifdef _MSC_VER diff --git a/tool3/tool3.h b/tool3/tool3.h index c10e597..527bbbc 100644 --- a/tool3/tool3.h +++ b/tool3/tool3.h @@ -10,6 +10,10 @@ #include "resource.h" // main symbols +/*structures to represent all that. defines're there so to make it compatible with hash functions. transaction structure +doesn't need that.same define statements there to ensure that nothing more is in memory so first : it can be copied as memory block wo care (not a big deal) , +second : if structure has alignment you can copy it as block too but it gives nothing in this case.*/ + struct Transaction{ #ifdef _MSC_VER #pragma pack(1) diff --git a/tool3/tool3.rc b/tool3/tool3.rc index 3f9b49e..87ff7d9 100644 Binary files a/tool3/tool3.rc and b/tool3/tool3.rc differ diff --git a/tool3/tool3.vcxproj b/tool3/tool3.vcxproj index 7b891dc..3b4a26c 100644 --- a/tool3/tool3.vcxproj +++ b/tool3/tool3.vcxproj @@ -198,11 +198,14 @@ + + + @@ -212,6 +215,7 @@ false + Create Create diff --git a/tool3/tool3.vcxproj.filters b/tool3/tool3.vcxproj.filters index d9abdd8..1124fc3 100644 --- a/tool3/tool3.vcxproj.filters +++ b/tool3/tool3.vcxproj.filters @@ -22,6 +22,12 @@ Resource Files + + Resource Files + + + Resource Files + @@ -39,6 +45,9 @@ Header Files + + Header Files + @@ -50,6 +59,9 @@ Source Files + + Source Files + diff --git a/x64/Release/libcrypto-1_1-x64.dll b/x64/Release/libcrypto-1_1-x64.dll new file mode 100644 index 0000000..7c8c77f Binary files /dev/null and b/x64/Release/libcrypto-1_1-x64.dll differ diff --git a/x64/Release/tool3.exe b/x64/Release/tool3.exe index 713bb43..5171b56 100644 Binary files a/x64/Release/tool3.exe and b/x64/Release/tool3.exe differ