diff --git a/tool3_2048/.vs/tool3/v16/.suo b/tool3_2048/.vs/tool3/v16/.suo new file mode 100644 index 0000000..41f2b0b Binary files /dev/null and b/tool3_2048/.vs/tool3/v16/.suo differ diff --git a/tool3_2048/LICENSE b/tool3_2048/LICENSE new file mode 100644 index 0000000..9e66854 --- /dev/null +++ b/tool3_2048/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Alexey Neudatchin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tool3_2048/tool3.sln b/tool3_2048/tool3.sln new file mode 100644 index 0000000..3a4a035 --- /dev/null +++ b/tool3_2048/tool3.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tool3", "tool3\tool3.vcxproj", "{5AAACF95-B7BD-4C26-B1B4-6B97629C2883}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5AAACF95-B7BD-4C26-B1B4-6B97629C2883}.Debug|Win32.ActiveCfg = Debug|Win32 + {5AAACF95-B7BD-4C26-B1B4-6B97629C2883}.Debug|Win32.Build.0 = Debug|Win32 + {5AAACF95-B7BD-4C26-B1B4-6B97629C2883}.Debug|x64.ActiveCfg = Debug|x64 + {5AAACF95-B7BD-4C26-B1B4-6B97629C2883}.Debug|x64.Build.0 = Debug|x64 + {5AAACF95-B7BD-4C26-B1B4-6B97629C2883}.Release|Win32.ActiveCfg = Release|Win32 + {5AAACF95-B7BD-4C26-B1B4-6B97629C2883}.Release|Win32.Build.0 = Release|Win32 + {5AAACF95-B7BD-4C26-B1B4-6B97629C2883}.Release|x64.ActiveCfg = Release|x64 + {5AAACF95-B7BD-4C26-B1B4-6B97629C2883}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tool3_2048/tool3/MainFrm.cpp b/tool3_2048/tool3/MainFrm.cpp new file mode 100644 index 0000000..d5d4f26 --- /dev/null +++ b/tool3_2048/tool3/MainFrm.cpp @@ -0,0 +1,375 @@ + +// MainFrm.cpp : implementation of the CMainFrame class +// + +#include "stdafx.h" +#include "tool3.h" +#include +#include "MainFrm.h" +#include +#include "base58_2048.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +const std::string bin2hex(const unsigned char* p, size_t length) { + std::stringstream f; + f << std::hex << std::setfill('0'); + for (int i = 0; i < length; i++) f << std::setw(2) << (int)p[i]; + return f.str(); +} + +size_t hex2bin(unsigned char* p, const char* hexstr, const size_t length) { + size_t wcount = 0; + while (wcount++ < length) { //last condition cause np if check fails on middle one.thats coz of short-circuit evaluation + long long b = sscanf(hexstr, "%2hhx", p++); //7x slower than tables but doesnt metter + if (b < 1) break; + hexstr = hexstr + 2; + } + return --wcount; // error check here is a waste +} + + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + +// CMainFrame + +IMPLEMENT_DYNAMIC(CMainFrame, CWnd) + +BEGIN_MESSAGE_MAP(CMainFrame, CWnd) + ON_WM_CREATE() + ON_BN_CLICKED(2133,tr) + ON_BN_CLICKED(233,w) + ON_WM_DESTROY() + // WM_ret stays undefined that moment so . + ON_MESSAGE(WM_CTLCOLORSTATIC, &CMainFrame::OnCtlcolorstatic) +END_MESSAGE_MAP() + +// CMainFrame construction/destruction + +CMainFrame::CMainFrame() +{ + // TODO: add member initialization code here +} + +CMainFrame::~CMainFrame() +{ +} + +// CMainFrame message handler +HWND hc; +CButton *bh; +CButton *q; +CButton *sx; +CButton *tx; +CButton *hux; +CButton *tux; +CStatic *b7; + +DWORD CALLBACK E(DWORD_PTR dw, LPBYTE pb, LONG cb, LONG *pcb) +{ + std::wstringstream *fr = (std::wstringstream *)dw; + fr->write((wchar_t *)pb, int(cb/2)); + *pcb = cb; + return 0; +} + +std::map< state , std::wstring> braze; + +int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) +{ + + + if (CWnd::OnCreate(lpCreateStruct) == -1) + return -1; + bh = new CButton(); + b7=new CStatic(); + + q = new CButton(); + sx = new CButton(); + tx = new CButton(); + hux = new CButton(); + tux = new CButton(); + + CBitmap wq[2]; + + wq[0].LoadBitmap(IDB_BITMAP1); + wq[1].LoadBitmap(IDB_BITMAP4); + + + + braze[q_quit]= L"quit"; + braze[q_gundrop]= L"gundrop"; + braze[q_stay] = L"stay"; + braze[q_stop]= L"q_stop"; + braze[q_torque] = L"torque"; + + + bh->Create(L"start",BS_BITMAP|WS_CHILD|WS_VISIBLE,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]); + sx->Create(L"compressor",BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE|WS_GROUP,CRect(0+10,20+292,98+10,48+292),this,73); + tx->Create(L"decompressor",BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE,CRect(0+111,20+292,118+111,48+292),this,173); + hux->Create(L"-hex32_24",BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE|WS_GROUP,CRect(0+240,20+292,95+240,48+292),this,7987); + tux->Create(L"-wif24",BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE,CRect(0+337,20+292,97+341,48+292),this,543); + b7->Create(L"",WS_CHILD|WS_VISIBLE|SS_WHITEFRAME|SS_SIMPLE,CRect(40,240,423,270),this); + + + hc = CreateWindowEx(WS_EX_NOPARENTNOTIFY, MSFTEDIT_CLASS,L"", + 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, + OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_NATURAL_QUALITY, + DEFAULT_PITCH | FF_DECORATIVE, L"Lucida Console"); + + ::PostMessage(b7->m_hWnd, WM_SETFONT, (WPARAM)newFont, (LPARAM)0); + ::PostMessage(hc,WM_SETFONT,(WPARAM)newFont,(LPARAM)0); + return 0; +} +state bren = q_stay; +int cr,f,terminator; +std::string er; + +void CMainFrame::tr() // bh->Create(L"start",BS_BITMAP|WS_CHILD|WS_VISIBLE|c,CRect(50,50,170,100),this,2133); +{ + std::wstringstream fr; + int argc = 2; + char* argv[2]; + + EDITSTREAM es = {}; + if(trigger) + { + es.dwCookie = (DWORD_PTR) &fr; + es.pfnCallback = E; + ::SendMessage(hc, EM_STREAMOUT, SF_TEXT|SF_UNICODE, (LPARAM)&es); + ZeroMemory(remmi,1218*2); + fr.read(remmi,747); + // trigger = 0; + } + char wfae[1218] = {}; + wcstombs(wfae, remmi, 747); + er = wfae; + + if (this->IsDlgButtonChecked(73)) + { + std::stringstream bt(er); + if(this->IsDlgButtonChecked(7987)) + argc = 3, argv[1] = "-hex32_24"; + if(this->IsDlgButtonChecked(543)) + argc = 3, argv[1] = "-wif24"; + + std::vector b; + do + { + std::string last; + bt >> last; + if (bt.fail()) break; + b.insert(b.cend(), last); + } while (bt.bad() == false); + + + std::string harbour; + std::pair f = transfer2048_to_b58(b, harbour); + if (f.first == 0) + { + return; + } + + if (argc == 2) + { + wchar_t c[1218] = {}; + mbstowcs(c, harbour.c_str(), 747); + SETTEXTEX fw = { 4, 1200 }; + ::SendMessage(hc, EM_SETTEXTEX, (WPARAM)&fw, (LPARAM)(LPCWSTR)c); + } + if ((argc == 2 == false) && std::string(argv[1]) == "-wif24") + { + if (b.size() > 24) + { + b7->SetWindowTextW(L"do not mess with it"); + return; + } + + auto c = b58decode(harbour); + if (c.second.size() == 32 == false) + { + b7->SetWindowTextW(L"do not mess with it"); + return; + } + + std::string wb_final_compressed; + + wb_final_compressed.insert(wb_final_compressed.cbegin(), (char)0x80); + wb_final_compressed.insert(1, c.second); + wb_final_compressed.insert(wb_final_compressed.cend(), (char)0x01); + + unsigned char h_compressed[250] = {}; + unsigned char hf_compressed[250] = {}; + SHA256((unsigned char*)wb_final_compressed.c_str(), wb_final_compressed.size(), h_compressed); + SHA256(h_compressed, 32, hf_compressed); + + wb_final_compressed.insert(wb_final_compressed.size(), std::string((char*)hf_compressed, 4)); + + auto t_compressed = b58encode(wb_final_compressed); + + std::string wb_final; + wb_final.insert(wb_final.cbegin(), (char)0x80); + wb_final.insert(1, c.second); + + unsigned char h[250] = {}; + unsigned char hf[250] = {}; + SHA256((unsigned char*)wb_final.c_str(), wb_final.size(), h); + SHA256(h, 32, hf); + wb_final.insert(wb_final.size(), std::string((char*)hf, 4)); + + auto t = b58encode(wb_final); + std::string whydah = t.second; + std::string mill = whydah + '\n' + t_compressed.second; + wchar_t cb[1218] = {}; + mbstowcs(cb, mill.c_str(), 747); + SETTEXTEX fw = { 4, 1200 }; + ::SendMessage(hc, EM_SETTEXTEX, (WPARAM)&fw, (LPARAM)(LPCWSTR)cb); + + } + if ((argc == 2 == false) && std::string(argv[1]) == "-hex32_24") + { + if (b.size() > 24) + { + b7->SetWindowTextW(L"do not mess with it"); + return; + + } + + auto c = b58decode(harbour); + if (c.second.size() == 32 == false) + { + b7->SetWindowTextW(L"do not mess with it"); + return; + + } + + std::string draw = bin2hex((unsigned char*)c.second.c_str(), 32); + wchar_t cb[1218] = {}; + mbstowcs(cb, draw.c_str(), 747); + SETTEXTEX fw = { 4, 1200 }; + ::SendMessage(hc, EM_SETTEXTEX, (WPARAM)&fw, (LPARAM)(LPCWSTR)cb); + + } + return; + + } + if (this->IsDlgButtonChecked(173)) + { + std::string a = er; + if(this->IsDlgButtonChecked(7987)) + argc = 3, argv[1] = "-hex32_24"; + if(this->IsDlgButtonChecked(543)) + argc = 3, argv[1] = "-wif24"; + + if ((argc == 2 == false) && std::string(argv[1]) == "-hex32_24") + { + unsigned char bc[250] = {}; + + size_t zx = hex2bin(bc, a.c_str(), 32); + + if (zx == 32 == false) + { + b7->SetWindowTextW(L"do not mess with it"); + return; + + } + + auto t = b58encode(std::string((char *)bc, 32 )); + a = t.second; + } + + if ((argc == 2 == false) && std::string(argv[1]) == "-wif24") + { + auto c = b58decode(a); + if (c.second.size() == 37 == false && c.second.size() == 38 == false) + { + b7->SetWindowTextW(L"do not mess with it"); + return; + + } + + auto t = b58encode(std::string(c.second.c_str() + 1, 32 )); + a = t.second; + } + + std::vector farstone; + + std::pair tyr = b58_to_2048(a, farstone); + if (tyr.first == 0) + { + b7->SetWindowTextW(L"High-bit set on invalid digit"); + return; + + } + if (tyr.first == -1) + { + b7->SetWindowTextW(L"Invalid base58 digit"); + return; + + } + + if (argc == 3 && farstone.size() > 24) + { + b7->SetWindowTextW(L"leading zeroes, will not work"); + return; + } + std::stringstream ht; + + for (auto c:farstone) + ht << std::endl << c << std::endl; + ht << std::endl; + + wchar_t cb[1218] = {}; + mbstowcs(cb, ht.str().c_str(), 747); + SETTEXTEX fw = { 4, 1200 }; + ::SendMessage(hc, EM_SETTEXTEX, (WPARAM)&fw, (LPARAM)(LPCWSTR)cb); + return ; + } +// ::PostMessage(hc, WM_VSCROLL, SB_BOTTOM, 0); + +} + +void CMainFrame::w() // q->Create(L"stop",BS_BITMAP|WS_CHILD|WS_VISIBLE|WS_DISABLED,CRect(50+170,50,170+170,100),this,233); +{ + +} + + + +HBRUSH hbrBkgnd; +void CMainFrame::OnDestroy() +{ + CWnd::OnDestroy(); + delete bh; + delete q; + DeleteObject(hbrBkgnd); +} + + + + +afx_msg LRESULT CMainFrame::OnCtlcolorstatic(WPARAM wParam, LPARAM lParam) +{ + HDC hdcStatic = (HDC)wParam; + SetTextColor(hdcStatic, RGB(2, 5, 55)); + SetBkColor(hdcStatic, RGB(255, 255, 255)); + if (hbrBkgnd == NULL) hbrBkgnd = CreateSolidBrush(RGB(255, 255, 255)); + return (INT_PTR)hbrBkgnd; +} diff --git a/tool3_2048/tool3/MainFrm.h b/tool3_2048/tool3/MainFrm.h new file mode 100644 index 0000000..3b65afe --- /dev/null +++ b/tool3_2048/tool3/MainFrm.h @@ -0,0 +1,54 @@ + +// MainFrm.h : interface of the CMainFrame class +// + +#pragma once +extern DWORD WM_ret; + + +class CMainFrame : public CWnd +{ + +public: + CMainFrame(); +protected: + DECLARE_DYNAMIC(CMainFrame) + +// Attributes +public: +private: + wchar_t remmi[1618]; + CWinThread *rew; + CWinThread *rewh; + int trigger=17; + +// Operations +public: + +// Overrides +public: + +// Implementation +public: + virtual ~CMainFrame(); + + + +// Generated message map functions +protected: + + DECLARE_MESSAGE_MAP() + +public: + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void tr(); + afx_msg void w(); + afx_msg void OnDestroy(); +protected: + +public: +protected: + afx_msg LRESULT OnCtlcolorstatic(WPARAM wParam, LPARAM lParam); +}; +extern HINSTANCE h; + diff --git a/tool3_2048/tool3/ReadMe.txt b/tool3_2048/tool3/ReadMe.txt new file mode 100644 index 0000000..23eb8ac --- /dev/null +++ b/tool3_2048/tool3/ReadMe.txt @@ -0,0 +1,73 @@ +================================================================================ + MICROSOFT FOUNDATION CLASS LIBRARY : tool3 Project Overview +=============================================================================== + +tool3.vcxproj + This is the main project file for VC++ projects generated using an application wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + application wizard. + +tool3.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +tool3.h + This is the main header file for the application. It includes other + project specific headers (including Resource.h) and declares the + Ctool3App application class. + +tool3.cpp + This is the main application source file that contains the application + class Ctool3App. + +tool3.rc + This is a listing of all of the Microsoft Windows resources that the + program uses. This file can be directly edited in Microsoft + Visual C++. Your project resources are in 1033. + +res\tool3.rc2 + This file contains resources that are not edited by Microsoft + Visual C++. You should place all resources not editable by + the resource editor in this file. + +///////////////////////////////////////////////////////////////////////////// + +For the main frame window: + The project includes a standard MFC interface. + +, MainFrm.cpp + These files contain the frame class CMainFrame, which is derived from + CFrameWnd and controls all SDI frame features. + +///////////////////////////////////////////////////////////////////////////// + + +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named tool3.pch and a precompiled types file named StdAfx.obj. + +Resource.h + This is the standard header file, which defines new resource IDs. + Microsoft Visual C++ reads and updates this file. + +///////////////////////////////////////////////////////////////////////////// + +Other notes: + +The application wizard uses "TODO:" to indicate parts of the source code you +should add to or customize. + +If your application uses MFC in a shared DLL, you will need +to redistribute the MFC DLLs. If your application is in a language +other than the operating system's locale, you will also have to +redistribute the corresponding localized resources MFC100XXX.DLL. +For more information on both of these topics, please see the section on +redistributing Visual C++ applications in MSDN documentation. + +///////////////////////////////////////////////////////////////////////////// diff --git a/tool3_2048/tool3/base58_2048.cpp b/tool3_2048/tool3/base58_2048.cpp new file mode 100644 index 0000000..9401cbd --- /dev/null +++ b/tool3_2048/tool3/base58_2048.cpp @@ -0,0 +1,274 @@ +#include "stdafx.h" +#include "base58_2048.h" +#include +#include +#include +#include + + +static const int8_t b58digits_map[128] = { + -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, + -1,-1,-1,-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,-1,-1,-1, + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8,-1,-1,-1,-1,-1,-1, + -1, 9,10,11,12,13,14,15, 16,-1,17,18,19,20,21,-1, + 22,23,24,25,26,27,28,29, 30,31,32,-1,-1,-1,-1,-1, + -1,33,34,35,36,37,38,39, 40,41,42,43,-1,44,45,46, + 47,48,49,50,51,52,53,54, 55,56,57,-1,-1,-1,-1,-1, +}; + +struct offstring +{ + static const std::vector disclaimer; +}; + +static const char b58digits_ordered[59] = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; + +std::pair b58_to_2048(std::string a /* in */, std::vector& bx /* out */) +{ + BIGNUM* balance_eth_ex = BN_new(); + BIGNUM* balance_eth_exm = BN_new(); + BIGNUM* balance_eth_remmi = BN_new(); + BIGNUM* balance_eth_h = BN_new(); + unsigned char fx = 58; + BIGNUM* balance_eth_f = BN_lebin2bn(&fx, 1, NULL); + unsigned short standon = 2048; + BIGNUM* balance_eth_lake = BN_lebin2bn((unsigned char*)&standon, 2, NULL); + + BN_CTX* bz = BN_CTX_new(); + BN_zero(balance_eth_ex); + int zerocount = 0; + while (*a.cbegin() == '1') + { + zerocount++; + a.erase(0, 1); + } + + + for (int k = 0; k < a.length(); k++) + { + if (a[k] & 0x80) + { + BN_free(balance_eth_ex); + BN_free(balance_eth_exm); + BN_free(balance_eth_remmi); + BN_free(balance_eth_h); + BN_free(balance_eth_f); + BN_free(balance_eth_lake); + BN_CTX_free(bz); + bx = std::vector(); + return std::pair(0, 0); + } + if (b58digits_map[a[k]] == -1) + { + BN_free(balance_eth_ex); + BN_free(balance_eth_exm); + BN_free(balance_eth_remmi); + BN_free(balance_eth_h); + BN_free(balance_eth_f); + BN_free(balance_eth_lake); + BN_CTX_free(bz); + bx = std::vector(); + return std::pair(-1, 0); + } + + unsigned char pi = b58digits_map[a[k]]; + + BIGNUM* balance_eth_exmk = BN_lebin2bn(&pi, 1, NULL); + + BN_mul(balance_eth_exm, balance_eth_ex, balance_eth_f, bz); + + BN_add(balance_eth_ex, balance_eth_exm, balance_eth_exmk); + BN_free(balance_eth_exmk); + } + + bool w = false; + unsigned short t = 0; + std::vector farstone; + while (w == false) + { + BN_div(balance_eth_ex, balance_eth_remmi, balance_eth_ex, balance_eth_lake, bz); + BN_bn2lebinpad(balance_eth_remmi, (unsigned char*)&t, 2); + farstone.insert(farstone.cbegin(), offstring::disclaimer[t]); + w = BN_is_zero(balance_eth_ex); + } + + for (int b = 0; b < zerocount; b++) + farstone.insert(farstone.cbegin(), offstring::disclaimer[0]); + BN_free(balance_eth_ex); + BN_free(balance_eth_exm); + BN_free(balance_eth_remmi); + BN_free(balance_eth_h); + BN_free(balance_eth_f); + BN_free(balance_eth_lake); + BN_CTX_free(bz); + bx = farstone; + return std::pair((int)(!false), zerocount); + +} + +std::pair transfer2048_to_b58(std::vector bt, std::string& ax) +{ + unsigned char fx = 58; + BIGNUM* balance_eth_f = BN_lebin2bn(&fx, 1, NULL); + unsigned short wa = 2048; + BIGNUM* balance_eth_lake = BN_lebin2bn((unsigned char*)&wa, 2, NULL); + + BN_CTX* bz = BN_CTX_new(); + + bool w = false; + + BIGNUM* balance_eth_ex_e = BN_new(); + BIGNUM* balance_eth_exm_e = BN_new(); + BIGNUM* balance_eth_remmi_e = BN_new(); + BIGNUM* balance_eth_h_e = BN_new(); + + BN_zero(balance_eth_ex_e); + BN_one(balance_eth_h_e); + int zerocount = 0; + + while (std::find(offstring::disclaimer.cbegin(), offstring::disclaimer.cend(), *bt.cbegin()) == offstring::disclaimer.cbegin()) + { + zerocount++; + bt.erase(bt.cbegin()); + } + + for (int kwe = bt.size() - 1; kwe + 1 > 0; kwe--) + { + auto rexx = std::find(offstring::disclaimer.cbegin(), offstring::disclaimer.cend(), bt[kwe]); + + if (rexx == offstring::disclaimer.cend()) + { + BN_free(balance_eth_ex_e); + BN_free(balance_eth_exm_e); + BN_free(balance_eth_remmi_e); + BN_free(balance_eth_h_e); + BN_free(balance_eth_f); + BN_free(balance_eth_lake); + BN_CTX_free(bz); + ax = std::string ();; + return std::pair(0, 0); + } + + unsigned int exp = std::distance(offstring::disclaimer.cbegin(), rexx); + BIGNUM* balance_eth_exmk_e = BN_lebin2bn((unsigned char*)&exp, 4, NULL); + BN_mul(balance_eth_exm_e, balance_eth_h_e, balance_eth_exmk_e, bz); + BN_add(balance_eth_ex_e, balance_eth_ex_e, balance_eth_exm_e); + BN_mul(balance_eth_h_e, balance_eth_h_e, balance_eth_lake, bz); + BN_free(balance_eth_exmk_e); + } + int cw = 0; + unsigned short tr_e = 0; + + std::string harbour; + + while (w == false) + { + BN_div(balance_eth_ex_e, balance_eth_remmi_e, balance_eth_ex_e, balance_eth_f, bz); + BN_bn2lebinpad(balance_eth_remmi_e, (unsigned char*)&tr_e, 2); + harbour = harbour + b58digits_ordered[tr_e]; + + w = BN_is_zero(balance_eth_ex_e); + } + std::reverse((unsigned char*)&harbour[0], (unsigned char*)&harbour[0] + harbour.size()); + + for (int h = 0; h < zerocount; h++) + harbour.insert(harbour.cbegin(), '1'); + BN_free(balance_eth_ex_e); + BN_free(balance_eth_exm_e); + BN_free(balance_eth_remmi_e); + BN_free(balance_eth_h_e); + BN_free(balance_eth_f); + BN_free(balance_eth_lake); + BN_CTX_free(bz); + ax = harbour; + return std::pair((int)(!false), zerocount); + +} + +const std::vector offstring::disclaimer = { "abandon" , "ability" , "able" , "about" , "above" , "absent" , "absorb" , "abstract" , "absurd" , "abuse" , "access" , "accident" , "account" , "accuse" , "achieve" , "acid" , "acoustic" , "acquire" , +"across" , "act" , "action" , "actor" , "actress" , "actual" , "adapt" , "add" , "addict" , "address" , "adjust" , "admit" , "adult" , "advance" , "advice" , "aerobic" , "affair" , "afford" , "afraid" , "again" , "age" , "agent" , "agree" , "ahead" , +"aim" , "air" , "airport" , "aisle" , "alarm" , "album" , "alcohol" , "alert" , "alien" , "all" , "alley" , "allow" , "almost" , "alone" , "alpha" , "already" , "also" , "alter" , "always" , "amateur" , "amazing" , "among" , "amount" , "amused" , +"analyst" , "anchor" , "ancient" , "anger" , "angle" , "angry" , "animal" , "ankle" , "announce" , "annual" , "another" , "answer" , "antenna" , "antique" , "anxiety" , "any" , "apart" , "apology" , "appear" , "apple" , "approve" , "april" , "arch" , +"arctic" , "area" , "arena" , "argue" , "arm" , "armed" , "armor" , "army" , "around" , "arrange" , "arrest" , "arrive" , "arrow" , "art" , "artefact" , "artist" , "artwork" , "ask" , "aspect" , "assault" , "asset" , "assist" , "assume" , "asthma" , +"athlete" , "atom" , "attack" , "attend" , "attitude" , "attract" , "auction" , "audit" , "august" , "aunt" , "author" , "auto" , "autumn" , "average" , "avocado" , "avoid" , "awake" , "aware" , "away" , "awesome" , "awful" , "awkward" , "axis" , +"baby" , "bachelor" , "bacon" , "badge" , "bag" , "balance" , "balcony" , "ball" , "bamboo" , "banana" , "banner" , "bar" , "barely" , "bargain" , "barrel" , "base" , "basic" , "basket" , "battle" , "beach" , "bean" , "beauty" , "because" , "become" , +"beef" , "before" , "begin" , "behave" , "behind" , "believe" , "below" , "belt" , "bench" , "benefit" , "best" , "betray" , "better" , "between" , "beyond" , "bicycle" , "bid" , "bike" , "bind" , "biology" , "bird" , "birth" , "bitter" , "black" , +"blade" , "blame" , "blanket" , "blast" , "bleak" , "bless" , "blind" , "blood" , "blossom" , "blouse" , "blue" , "blur" , "blush" , "board" , "boat" , "body" , "boil" , "bomb" , "bone" , "bonus" , "book" , "boost" , "border" , "boring" , "borrow" , +"boss" , "bottom" , "bounce" , "box" , "boy" , "bracket" , "brain" , "brand" , "brass" , "brave" , "bread" , "breeze" , "brick" , "bridge" , "brief" , "bright" , "bring" , "brisk" , "broccoli" , "broken" , "bronze" , "broom" , "brother" , "brown" , +"brush" , "bubble" , "buddy" , "budget" , "buffalo" , "build" , "bulb" , "bulk" , "bullet" , "bundle" , "bunker" , "burden" , "burger" , "burst" , "bus" , "business" , "busy" , "butter" , "buyer" , "buzz" , "cabbage" , "cabin" , "cable" , "cactus" , +"cage" , "cake" , "call" , "calm" , "camera" , "camp" , "can" , "canal" , "cancel" , "candy" , "cannon" , "canoe" , "canvas" , "canyon" , "capable" , "capital" , "captain" , "car" , "carbon" , "card" , "cargo" , "carpet" , "carry" , "cart" , "case" , +"cash" , "casino" , "castle" , "casual" , "cat" , "catalog" , "catch" , "category" , "cattle" , "caught" , "cause" , "caution" , "cave" , "ceiling" , "celery" , "cement" , "census" , "century" , "cereal" , "certain" , "chair" , "chalk" , "champion" , +"change" , "chaos" , "chapter" , "charge" , "chase" , "chat" , "cheap" , "check" , "cheese" , "chef" , "cherry" , "chest" , "chicken" , "chief" , "child" , "chimney" , "choice" , "choose" , "chronic" , "chuckle" , "chunk" , "churn" , "cigar" , +"cinnamon" , "circle" , "citizen" , "city" , "civil" , "claim" , "clap" , "clarify" , "claw" , "clay" , "clean" , "clerk" , "clever" , "click" , "client" , "cliff" , "climb" , "clinic" , "clip" , "clock" , "clog" , "close" , "cloth" , "cloud" , +"clown" , "club" , "clump" , "cluster" , "clutch" , "coach" , "coast" , "coconut" , "code" , "coffee" , "coil" , "coin" , "collect" , "color" , "column" , "combine" , "come" , "comfort" , "comic" , "common" , "company" , "concert" , "conduct" , +"confirm" , "congress" , "connect" , "consider" , "control" , "convince" , "cook" , "cool" , "copper" , "copy" , "coral" , "core" , "corn" , "correct" , "cost" , "cotton" , "couch" , "country" , "couple" , "course" , "cousin" , "cover" , "coyote" , +"crack" , "cradle" , "craft" , "cram" , "crane" , "crash" , "crater" , "crawl" , "crazy" , "cream" , "credit" , "creek" , "crew" , "cricket" , "crime" , "crisp" , "critic" , "crop" , "cross" , "crouch" , "crowd" , "crucial" , "cruel" , "cruise" , +"crumble" , "crunch" , "crush" , "cry" , "crystal" , "cube" , "culture" , "cup" , "cupboard" , "curious" , "current" , "curtain" , "curve" , "cushion" , "custom" , "cute" , "cycle" , "dad" , "damage" , "damp" , "dance" , "danger" , "daring" , "dash" , +"daughter" , "dawn" , "day" , "deal" , "debate" , "debris" , "decade" , "december" , "decide" , "decline" , "decorate" , "decrease" , "deer" , "defense" , "define" , "defy" , "degree" , "delay" , "deliver" , "demand" , "demise" , "denial" , "dentist" , +"deny" , "depart" , "depend" , "deposit" , "depth" , "deputy" , "derive" , "describe" , "desert" , "design" , "desk" , "despair" , "destroy" , "detail" , "detect" , "develop" , "device" , "devote" , "diagram" , "dial" , "diamond" , "diary" , "dice" , +"diesel" , "diet" , "differ" , "digital" , "dignity" , "dilemma" , "dinner" , "dinosaur" , "direct" , "dirt" , "disagree" , "discover" , "disease" , "dish" , "dismiss" , "disorder" , "display" , "distance" , "divert" , "divide" , "divorce" , "dizzy" , +"doctor" , "document" , "dog" , "doll" , "dolphin" , "domain" , "donate" , "donkey" , "donor" , "door" , "dose" , "double" , "dove" , "draft" , "dragon" , "drama" , "drastic" , "draw" , "dream" , "dress" , "drift" , "drill" , "drink" , "drip" , "drive" , +"drop" , "drum" , "dry" , "duck" , "dumb" , "dune" , "during" , "dust" , "dutch" , "duty" , "dwarf" , "dynamic" , "eager" , "eagle" , "early" , "earn" , "earth" , "easily" , "east" , "easy" , "echo" , "ecology" , "economy" , "edge" , "edit" , "educate" , +"effort" , "egg" , "eight" , "either" , "elbow" , "elder" , "electric" , "elegant" , "element" , "elephant" , "elevator" , "elite" , "else" , "embark" , "embody" , "embrace" , "emerge" , "emotion" , "employ" , "empower" , "empty" , "enable" , "enact" , +"end" , "endless" , "endorse" , "enemy" , "energy" , "enforce" , "engage" , "engine" , "enhance" , "enjoy" , "enlist" , "enough" , "enrich" , "enroll" , "ensure" , "enter" , "entire" , "entry" , "envelope" , "episode" , "equal" , "equip" , "era" , +"erase" , "erode" , "erosion" , "error" , "erupt" , "escape" , "essay" , "essence" , "estate" , "eternal" , "ethics" , "evidence" , "evil" , "evoke" , "evolve" , "exact" , "example" , "excess" , "exchange" , "excite" , "exclude" , "excuse" , "execute" , +"exercise" , "exhaust" , "exhibit" , "exile" , "exist" , "exit" , "exotic" , "expand" , "expect" , "expire" , "explain" , "expose" , "express" , "extend" , "extra" , "eye" , "eyebrow" , "fabric" , "face" , "faculty" , "fade" , "faint" , "faith" , +"fall" , "false" , "fame" , "family" , "famous" , "fan" , "fancy" , "fantasy" , "farm" , "fashion" , "fat" , "fatal" , "father" , "fatigue" , "fault" , "favorite" , "feature" , "february" , "federal" , "fee" , "feed" , "feel" , "female" , "fence" , +"festival" , "fetch" , "fever" , "few" , "fiber" , "fiction" , "field" , "figure" , "file" , "film" , "filter" , "final" , "find" , "fine" , "finger" , "finish" , "fire" , "firm" , "first" , "fiscal" , "fish" , "fit" , "fitness" , "fix" , "flag" , +"flame" , "flash" , "flat" , "flavor" , "flee" , "flight" , "flip" , "float" , "flock" , "floor" , "flower" , "fluid" , "flush" , "fly" , "foam" , "focus" , "fog" , "foil" , "fold" , "follow" , "food" , "foot" , "force" , "forest" , "forget" , +"fork" , "fortune" , "forum" , "forward" , "fossil" , "foster" , "found" , "fox" , "fragile" , "frame" , "frequent" , "fresh" , "friend" , "fringe" , "frog" , "front" , "frost" , "frown" , "frozen" , "fruit" , "fuel" , "fun" , "funny" , "furnace" , +"fury" , "future" , "gadget" , "gain" , "galaxy" , "gallery" , "game" , "gap" , "garage" , "garbage" , "garden" , "garlic" , "garment" , "gas" , "gasp" , "gate" , "gather" , "gauge" , "gaze" , "general" , "genius" , "genre" , "gentle" , "genuine" , +"gesture" , "ghost" , "giant" , "gift" , "giggle" , "ginger" , "giraffe" , "girl" , "give" , "glad" , "glance" , "glare" , "glass" , "glide" , "glimpse" , "globe" , "gloom" , "glory" , "glove" , "glow" , "glue" , "goat" , "goddess" , "gold" , "good" , +"goose" , "gorilla" , "gospel" , "gossip" , "govern" , "gown" , "grab" , "grace" , "grain" , "grant" , "grape" , "grass" , "gravity" , "great" , "green" , "grid" , "grief" , "grit" , "grocery" , "group" , "grow" , "grunt" , "guard" , "guess" , "guide" , +"guilt" , "guitar" , "gun" , "gym" , "habit" , "hair" , "half" , "hammer" , "hamster" , "hand" , "happy" , "harbor" , "hard" , "harsh" , "harvest" , "hat" , "have" , "hawk" , "hazard" , "head" , "health" , "heart" , "heavy" , "hedgehog" , "height" , +"hello" , "helmet" , "help" , "hen" , "hero" , "hidden" , "high" , "hill" , "hint" , "hip" , "hire" , "history" , "hobby" , "hockey" , "hold" , "hole" , "holiday" , "hollow" , "home" , "honey" , "hood" , "hope" , "horn" , "horror" , "horse" , "hospital" , +"host" , "hotel" , "hour" , "hover" , "hub" , "huge" , "human" , "humble" , "humor" , "hundred" , "hungry" , "hunt" , "hurdle" , "hurry" , "hurt" , "husband" , "hybrid" , "ice" , "icon" , "idea" , "identify" , "idle" , "ignore" , "ill" , "illegal" , +"illness" , "image" , "imitate" , "immense" , "immune" , "impact" , "impose" , "improve" , "impulse" , "inch" , "include" , "income" , "increase" , "index" , "indicate" , "indoor" , "industry" , "infant" , "inflict" , "inform" , "inhale" , "inherit" , +"initial" , "inject" , "injury" , "inmate" , "inner" , "innocent" , "input" , "inquiry" , "insane" , "insect" , "inside" , "inspire" , "install" , "intact" , "interest" , "into" , "invest" , "invite" , "involve" , "iron" , "island" , "isolate" , +"issue" , "item" , "ivory" , "jacket" , "jaguar" , "jar" , "jazz" , "jealous" , "jeans" , "jelly" , "jewel" , "job" , "join" , "joke" , "journey" , "joy" , "judge" , "juice" , "jump" , "jungle" , "junior" , "junk" , "just" , "kangaroo" , "keen" , +"keep" , "ketchup" , "key" , "kick" , "kid" , "kidney" , "kind" , "kingdom" , "kiss" , "kit" , "kitchen" , "kite" , "kitten" , "kiwi" , "knee" , "knife" , "knock" , "know" , "lab" , "label" , "labor" , "ladder" , "lady" , "lake" , "lamp" , "language" , +"laptop" , "large" , "later" , "latin" , "laugh" , "laundry" , "lava" , "law" , "lawn" , "lawsuit" , "layer" , "lazy" , "leader" , "leaf" , "learn" , "leave" , "lecture" , "left" , "leg" , "legal" , "legend" , "leisure" , "lemon" , "lend" , "length" , +"lens" , "leopard" , "lesson" , "letter" , "level" , "liar" , "liberty" , "library" , "license" , "life" , "lift" , "light" , "like" , "limb" , "limit" , "link" , "lion" , "liquid" , "list" , "little" , "live" , "lizard" , "load" , "loan" , "lobster" , +"local" , "lock" , "logic" , "lonely" , "long" , "loop" , "lottery" , "loud" , "lounge" , "love" , "loyal" , "lucky" , "luggage" , "lumber" , "lunar" , "lunch" , "luxury" , "lyrics" , "machine" , "mad" , "magic" , "magnet" , "maid" , "mail" , "main" , +"major" , "make" , "mammal" , "man" , "manage" , "mandate" , "mango" , "mansion" , "manual" , "maple" , "marble" , "march" , "margin" , "marine" , "market" , "marriage" , "mask" , "mass" , "master" , "match" , "material" , "math" , "matrix" , "matter" , +"maximum" , "maze" , "meadow" , "mean" , "measure" , "meat" , "mechanic" , "medal" , "media" , "melody" , "melt" , "member" , "memory" , "mention" , "menu" , "mercy" , "merge" , "merit" , "merry" , "mesh" , "message" , "metal" , "method" , "middle" , +"midnight" , "milk" , "million" , "mimic" , "mind" , "minimum" , "minor" , "minute" , "miracle" , "mirror" , "misery" , "miss" , "mistake" , "mix" , "mixed" , "mixture" , "mobile" , "model" , "modify" , "mom" , "moment" , "monitor" , "monkey" , +"monster" , "month" , "moon" , "moral" , "more" , "morning" , "mosquito" , "mother" , "motion" , "motor" , "mountain" , "mouse" , "move" , "movie" , "much" , "muffin" , "mule" , "multiply" , "muscle" , "museum" , "mushroom" , "music" , "must" , +"mutual" , "myself" , "mystery" , "myth" , "naive" , "name" , "napkin" , "narrow" , "nasty" , "nation" , "nature" , "near" , "neck" , "need" , "negative" , "neglect" , "neither" , "nephew" , "nerve" , "nest" , "net" , "network" , "neutral" , +"never" , "news" , "next" , "nice" , "night" , "noble" , "noise" , "nominee" , "noodle" , "normal" , "north" , "nose" , "notable" , "note" , "nothing" , "notice" , "novel" , "now" , "nuclear" , "number" , "nurse" , "nut" , "oak" , "obey" , +"object" , "oblige" , "obscure" , "observe" , "obtain" , "obvious" , "occur" , "ocean" , "october" , "odor" , "off" , "offer" , "office" , "often" , "oil" , "okay" , "old" , "olive" , "olympic" , "omit" , "once" , "one" , "onion" , "online" , +"only" , "open" , "opera" , "opinion" , "oppose" , "option" , "orange" , "orbit" , "orchard" , "order" , "ordinary" , "organ" , "orient" , "original" , "orphan" , "ostrich" , "other" , "outdoor" , "outer" , "output" , "outside" , "oval" , "oven" , +"over" , "own" , "owner" , "oxygen" , "oyster" , "ozone" , "pact" , "paddle" , "page" , "pair" , "palace" , "palm" , "panda" , "panel" , "panic" , "panther" , "paper" , "parade" , "parent" , "park" , "parrot" , "party" , "pass" , "patch" , "path" , +"patient" , "patrol" , "pattern" , "pause" , "pave" , "payment" , "peace" , "peanut" , "pear" , "peasant" , "pelican" , "pen" , "penalty" , "pencil" , "people" , "pepper" , "perfect" , "permit" , "person" , "pet" , "phone" , "photo" , "phrase" , +"physical" , "piano" , "picnic" , "picture" , "piece" , "pig" , "pigeon" , "pill" , "pilot" , "pink" , "pioneer" , "pipe" , "pistol" , "pitch" , "pizza" , "place" , "planet" , "plastic" , "plate" , "play" , "please" , "pledge" , "pluck" , "plug" , +"plunge" , "poem" , "poet" , "point" , "polar" , "pole" , "police" , "pond" , "pony" , "pool" , "popular" , "portion" , "position" , "possible" , "post" , "potato" , "pottery" , "poverty" , "powder" , "power" , "practice" , "praise" , "predict" , +"prefer" , "prepare" , "present" , "pretty" , "prevent" , "price" , "pride" , "primary" , "print" , "priority" , "prison" , "private" , "prize" , "problem" , "process" , "produce" , "profit" , "program" , "project" , "promote" , "proof" , "property" , +"prosper" , "protect" , "proud" , "provide" , "public" , "pudding" , "pull" , "pulp" , "pulse" , "pumpkin" , "punch" , "pupil" , "puppy" , "purchase" , "purity" , "purpose" , "purse" , "push" , "put" , "puzzle" , "pyramid" , "quality" , "quantum" , +"quarter" , "question" , "quick" , "quit" , "quiz" , "quote" , "rabbit" , "raccoon" , "race" , "rack" , "radar" , "radio" , "rail" , "rain" , "raise" , "rally" , "ramp" , "ranch" , "random" , "range" , "rapid" , "rare" , "rate" , "rather" , "raven" , +"raw" , "razor" , "ready" , "real" , "reason" , "rebel" , "rebuild" , "recall" , "receive" , "recipe" , "record" , "recycle" , "reduce" , "reflect" , "reform" , "refuse" , "region" , "regret" , "regular" , "reject" , "relax" , "release" , "relief" , +"rely" , "remain" , "remember" , "remind" , "remove" , "render" , "renew" , "rent" , "reopen" , "repair" , "repeat" , "replace" , "report" , "require" , "rescue" , "resemble" , "resist" , "resource" , "response" , "result" , "retire" , "retreat" , +"return" , "reunion" , "reveal" , "review" , "reward" , "rhythm" , "rib" , "ribbon" , "rice" , "rich" , "ride" , "ridge" , "rifle" , "right" , "rigid" , "ring" , "riot" , "ripple" , "risk" , "ritual" , "rival" , "river" , "road" , "roast" , "robot" , +"robust" , "rocket" , "romance" , "roof" , "rookie" , "room" , "rose" , "rotate" , "rough" , "round" , "route" , "royal" , "rubber" , "rude" , "rug" , "rule" , "run" , "runway" , "rural" , "sad" , "saddle" , "sadness" , "safe" , "sail" , "salad" , +"salmon" , "salon" , "salt" , "salute" , "same" , "sample" , "sand" , "satisfy" , "satoshi" , "sauce" , "sausage" , "save" , "say" , "scale" , "scan" , "scare" , "scatter" , "scene" , "scheme" , "school" , "science" , "scissors" , "scorpion" , "scout" , +"scrap" , "screen" , "script" , "scrub" , "sea" , "search" , "season" , "seat" , "second" , "secret" , "section" , "security" , "seed" , "seek" , "segment" , "select" , "sell" , "seminar" , "senior" , "sense" , "sentence" , "series" , "service" , +"session" , "settle" , "setup" , "seven" , "shadow" , "shaft" , "shallow" , "share" , "shed" , "shell" , "sheriff" , "shield" , "shift" , "shine" , "ship" , "shiver" , "shock" , "shoe" , "shoot" , "shop" , "short" , "shoulder" , "shove" , "shrimp" , +"shrug" , "shuffle" , "shy" , "sibling" , "sick" , "side" , "siege" , "sight" , "sign" , "silent" , "silk" , "silly" , "silver" , "similar" , "simple" , "since" , "sing" , "siren" , "sister" , "situate" , "six" , "size" , "skate" , "sketch" , "ski" , +"skill" , "skin" , "skirt" , "skull" , "slab" , "slam" , "sleep" , "slender" , "slice" , "slide" , "slight" , "slim" , "slogan" , "slot" , "slow" , "slush" , "small" , "smart" , "smile" , "smoke" , "smooth" , "snack" , "snake" , "snap" , "sniff" , +"snow" , "soap" , "soccer" , "social" , "sock" , "soda" , "soft" , "solar" , "soldier" , "solid" , "solution" , "solve" , "someone" , "song" , "soon" , "sorry" , "sort" , "soul" , "sound" , "soup" , "source" , "south" , "space" , "spare" , "spatial" , +"spawn" , "speak" , "special" , "speed" , "spell" , "spend" , "sphere" , "spice" , "spider" , "spike" , "spin" , "spirit" , "split" , "spoil" , "sponsor" , "spoon" , "sport" , "spot" , "spray" , "spread" , "spring" , "spy" , "square" , "squeeze" , +"squirrel" , "stable" , "stadium" , "staff" , "stage" , "stairs" , "stamp" , "stand" , "start" , "state" , "stay" , "steak" , "steel" , "stem" , "step" , "stereo" , "stick" , "still" , "sting" , "stock" , "stomach" , "stone" , "stool" , "story" , +"stove" , "strategy" , "street" , "strike" , "strong" , "struggle" , "student" , "stuff" , "stumble" , "style" , "subject" , "submit" , "subway" , "success" , "such" , "sudden" , "suffer" , "sugar" , "suggest" , "suit" , "summer" , "sun" , "sunny" , +"sunset" , "super" , "supply" , "supreme" , "sure" , "surface" , "surge" , "surprise" , "surround" , "survey" , "suspect" , "sustain" , "swallow" , "swamp" , "swap" , "swarm" , "swear" , "sweet" , "swift" , "swim" , "swing" , "switch" , "sword" , +"symbol" , "symptom" , "syrup" , "system" , "table" , "tackle" , "tag" , "tail" , "talent" , "talk" , "tank" , "tape" , "target" , "task" , "taste" , "tattoo" , "taxi" , "teach" , "team" , "tell" , "ten" , "tenant" , "tennis" , "tent" , "term" , +"test" , "text" , "thank" , "that" , "theme" , "then" , "theory" , "there" , "they" , "thing" , "this" , "thought" , "three" , "thrive" , "throw" , "thumb" , "thunder" , "ticket" , "tide" , "tiger" , "tilt" , "timber" , "time" , "tiny" , "tip" , +"tired" , "tissue" , "title" , "toast" , "tobacco" , "today" , "toddler" , "toe" , "together" , "toilet" , "token" , "tomato" , "tomorrow" , "tone" , "tongue" , "tonight" , "tool" , "tooth" , "top" , "topic" , "topple" , "torch" , "tornado" , +"tortoise" , "toss" , "total" , "tourist" , "toward" , "tower" , "town" , "toy" , "track" , "trade" , "traffic" , "tragic" , "train" , "transfer" , "trap" , "trash" , "travel" , "tray" , "treat" , "tree" , "trend" , "trial" , "tribe" , "trick" , +"trigger" , "trim" , "trip" , "trophy" , "trouble" , "truck" , "true" , "truly" , "trumpet" , "trust" , "truth" , "try" , "tube" , "tuition" , "tumble" , "tuna" , "tunnel" , "turkey" , "turn" , "turtle" , "twelve" , "twenty" , "twice" , "twin" , +"twist" , "two" , "type" , "typical" , "ugly" , "umbrella" , "unable" , "unaware" , "uncle" , "uncover" , "under" , "undo" , "unfair" , "unfold" , "unhappy" , "uniform" , "unique" , "unit" , "universe" , "unknown" , "unlock" , "until" , "unusual" , +"unveil" , "update" , "upgrade" , "uphold" , "upon" , "upper" , "upset" , "urban" , "urge" , "usage" , "use" , "used" , "useful" , "useless" , "usual" , "utility" , "vacant" , "vacuum" , "vague" , "valid" , "valley" , "valve" , "van" , "vanish" , +"vapor" , "various" , "vast" , "vault" , "vehicle" , "velvet" , "vendor" , "venture" , "venue" , "verb" , "verify" , "version" , "very" , "vessel" , "veteran" , "viable" , "vibrant" , "vicious" , "victory" , "video" , "view" , "village" , "vintage" , +"violin" , "virtual" , "virus" , "visa" , "visit" , "visual" , "vital" , "vivid" , "vocal" , "voice" , "void" , "volcano" , "volume" , "vote" , "voyage" , "wage" , "wagon" , "wait" , "walk" , "wall" , "walnut" , "want" , "warfare" , "warm" , "warrior" , +"wash" , "wasp" , "waste" , "water" , "wave" , "way" , "wealth" , "weapon" , "wear" , "weasel" , "weather" , "web" , "wedding" , "weekend" , "weird" , "welcome" , "west" , "wet" , "whale" , "what" , "wheat" , "wheel" , "when" , "where" , "whip" , "whisper" , +"wide" , "width" , "wife" , "wild" , "will" , "win" , "window" , "wine" , "wing" , "wink" , "winner" , "winter" , "wire" , "wisdom" , "wise" , "wish" , "witness" , "wolf" , "woman" , "wonder" , "wood" , "wool" , "word" , "work" , "world" , "worry" , "worth" , +"wrap" , "wreck" , "wrestle" , "wrist" , "write" , "wrong" , "yard" , "year" , "yellow" , "you" , "young" , "youth" , "zebra" , "zero" , "zone" , "zoo" }; \ No newline at end of file diff --git a/tool3_2048/tool3/base58_2048.h b/tool3_2048/tool3/base58_2048.h new file mode 100644 index 0000000..dee4177 --- /dev/null +++ b/tool3_2048/tool3/base58_2048.h @@ -0,0 +1,12 @@ +// CMakeProject1.h : Include file for standard system include files, +// or project specific include files. + +#pragma once +#include +#include + +std::pair b58_to_2048(std::string a, std::vector& b); + +std::pair transfer2048_to_b58(std::vector tw, std::string& bt); + +// TODO: Reference additional headers your program requires here. diff --git a/tool3_2048/tool3/res/9.bmp b/tool3_2048/tool3/res/9.bmp new file mode 100644 index 0000000..29f9de7 Binary files /dev/null and b/tool3_2048/tool3/res/9.bmp differ diff --git a/tool3_2048/tool3/res/hyg.bmp b/tool3_2048/tool3/res/hyg.bmp new file mode 100644 index 0000000..3e7df48 Binary files /dev/null and b/tool3_2048/tool3/res/hyg.bmp differ diff --git a/tool3_2048/tool3/res/tool3.ico b/tool3_2048/tool3/res/tool3.ico new file mode 100644 index 0000000..d56fbcd Binary files /dev/null and b/tool3_2048/tool3/res/tool3.ico differ diff --git a/tool3_2048/tool3/res/tool3.rc2 b/tool3_2048/tool3/res/tool3.rc2 new file mode 100644 index 0000000..bcdb346 Binary files /dev/null and b/tool3_2048/tool3/res/tool3.rc2 differ diff --git a/tool3_2048/tool3/resource.h b/tool3_2048/tool3/resource.h new file mode 100644 index 0000000..e3672b7 Binary files /dev/null and b/tool3_2048/tool3/resource.h differ diff --git a/tool3_2048/tool3/stdafx.cpp b/tool3_2048/tool3/stdafx.cpp new file mode 100644 index 0000000..e1182cc --- /dev/null +++ b/tool3_2048/tool3/stdafx.cpp @@ -0,0 +1,8 @@ + +// stdafx.cpp : source file that includes just the standard includes +// tool3.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + + diff --git a/tool3_2048/tool3/stdafx.h b/tool3_2048/tool3/stdafx.h new file mode 100644 index 0000000..619ee34 --- /dev/null +++ b/tool3_2048/tool3/stdafx.h @@ -0,0 +1,41 @@ + +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#pragma once +#pragma fenv_access(on) + +#include +#ifndef VC_EXTRALEAN +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers +#endif +#include "targetver.h" + +// turns off MFC's hiding of some common and often safely ignored warning messages +#define _AFX_ALL_WARNINGS + +#include // MFC core and standard components +#include // MFC extensions + + +#ifndef _AFX_NO_OLE_SUPPORT +#include // MFC support for Internet Explorer 4 Common Controls +#endif +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + + + + +#ifdef _UNICODE +#if defined _M_IX86 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") +#elif defined _M_X64 +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") +#else +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") +#endif +#endif + diff --git a/tool3_2048/tool3/targetver.h b/tool3_2048/tool3/targetver.h new file mode 100644 index 0000000..2b5721a --- /dev/null +++ b/tool3_2048/tool3/targetver.h @@ -0,0 +1,9 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +//#include + diff --git a/tool3_2048/tool3/tool3.cpp b/tool3_2048/tool3/tool3.cpp new file mode 100644 index 0000000..3ef40c9 --- /dev/null +++ b/tool3_2048/tool3/tool3.cpp @@ -0,0 +1,104 @@ + +// tool3.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "afxwinappex.h" +#include "afxdialogex.h" +#include "tool3.h" +#include "MainFrm.h" + + + +#ifdef _DEBUG +#define new DEBUG_NEW +#endif + + +// Ctool3App + + + + +BEGIN_MESSAGE_MAP(Ctool3App, CWinApp) + +END_MESSAGE_MAP() + + +// Ctool3App construction + +Ctool3App::Ctool3App() +{ + SetAppID(_T("tool3.AppID.NoVersion")); + +} + +// The one and only Ctool3App object + +Ctool3App theApp; + +// Ctool3App initialization +CMainFrame* pFrame; +HINSTANCE h; +HANDLE b; +BOOL Ctool3App::InitInstance() +{ + + CWinApp::InitInstance(); + h=this->m_hInstance; + + // Parse command line for standard shell commands, DDE, file open + CCommandLineInfo cmdInfo; + ParseCommandLine(cmdInfo); + + EnableTaskbarInteraction(FALSE); + + b = LoadLibrary(L"MSFTEDIT.DLL"); //richedit + + SetRegistryKey(_T("Local AppWizard-Generated Applications")); + +; + //mfc window dry base + pFrame = new CMainFrame; + if (!pFrame) + return FALSE; + m_pMainWnd = pFrame; + WNDCLASSEX w = {}; + + w.hbrBackground=(HBRUSH)(COLOR_WINDOW+1); + w.lpszClassName=L"t"; + w.style=CS_BYTEALIGNWINDOW|CS_HREDRAW|CS_VREDRAW; + w.hCursor=this->LoadStandardCursor(IDC_ARROW); + w.lpfnWndProc = AfxWndProc; + w.lpszMenuName = NULL; + w.hInstance = this->m_hInstance; + w.cbSize=sizeof(WNDCLASSEX); + + RegisterClassEx(&w); + + pFrame->CreateEx( WS_EX_APPWINDOW|WS_EX_COMPOSITED,L"t",L"tool3",WS_OVERLAPPEDWINDOW,CRect(20,0,478,592),NULL,0); + // The one and only window has been initialized, so show and update it + pFrame->ShowWindow(SW_SHOW); + // call DragAcceptFiles only if there's a suffix + // In an SDI app, this should occur after ProcessShellCommand + return TRUE; +} + +int Ctool3App::ExitInstance() +{ + FreeLibrary((HMODULE)b); + delete pFrame; + return CWinApp::ExitInstance(); +} + +// Ctool3App message handlers + + + +// Ctool3App message handlers + + + + + + diff --git a/tool3_2048/tool3/tool3.h b/tool3_2048/tool3/tool3.h new file mode 100644 index 0000000..d5b9b99 --- /dev/null +++ b/tool3_2048/tool3/tool3.h @@ -0,0 +1,62 @@ +enum state +{ + q_quit, + q_synced, + q_gundrop, + q_stop, + q_stay, + q_torque +}; +_declspec(align(16)) struct triggerblock +{ + _declspec(align(16)) double q; + _declspec(align(16)) long long block[3]; + _declspec(align(16)) long long b; + _declspec(align(16)) long long t; + _declspec(align(16)) tm *c; + _declspec(align(16)) tm *p; + _declspec(align(16)) BYTE ptrigger; + _declspec(align(16)) BYTE faulttrigger; + _declspec(align(16)) float outofthis; + _declspec(align(16)) double x; + _declspec(align(16)) long double F; + _declspec(align(16)) short finishup; + _declspec(align(16)) short endgame; + _declspec(align(16)) double f; + _declspec(align(16)) BYTE E; +}; + +// tool3.h : main header file for the tool3 application +// +#pragma once + +#ifndef __AFXWIN_H__ + #error "include 'stdafx.h' before including this file for PCH" +#endif + +#include "resource.h" // main symbols + + +// Ctool3App: +// See tool3.cpp for the implementation of this class +// + +class Ctool3App : public CWinApp +{ +public: + Ctool3App(); + + +// Overrides +public: + virtual BOOL InitInstance(); + virtual int ExitInstance(); + +// Implementation + +public: + + DECLARE_MESSAGE_MAP() +}; + +extern Ctool3App theApp; diff --git a/tool3_2048/tool3/tool3.rc b/tool3_2048/tool3/tool3.rc new file mode 100644 index 0000000..3f9b49e Binary files /dev/null and b/tool3_2048/tool3/tool3.rc differ diff --git a/tool3_2048/tool3/tool3.vcxproj b/tool3_2048/tool3/tool3.vcxproj new file mode 100644 index 0000000..c9c4f9f --- /dev/null +++ b/tool3_2048/tool3/tool3.vcxproj @@ -0,0 +1,242 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {5AAACF95-B7BD-4C26-B1B4-6B97629C2883} + tool3 + MFCProj + + + + Application + true + Unicode + Dynamic + v142 + + + Application + true + Unicode + Dynamic + v142 + + + Application + false + false + Unicode + Dynamic + Dynamic + v142 + + + Application + false + false + Unicode + Dynamic + Dynamic + v142 + + + + + + + + + + + + + + + + + + + true + + + true + + + true + + + true + + + + Use + Level3 + Disabled + WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) + + + Windows + true + + + false + true + _DEBUG;%(PreprocessorDefinitions) + + + 0x0409 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Use + Level3 + Disabled + WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) + + + Windows + true + + + false + _DEBUG;%(PreprocessorDefinitions) + + + 0x0409 + _DEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + ProgramDatabase + Speed + StreamingSIMDExtensions2 + Default + false + false + None + false + + + Windows + false + false + true + NoErrorReport + MachineX86 + false + Default + + + false + true + NDEBUG;%(PreprocessorDefinitions) + + + 0x0409 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions) + ProgramDatabase + Speed + StreamingSIMDExtensions2 + Default + false + false + None + false + $(SolutionDir)..\New folder\include;%(AdditionalIncludeDirectories) + + + Windows + false + false + true + NoErrorReport + Default + $(SolutionDir)..\New folder;%(AdditionalLibraryDirectories) + libcrypto.lib;%(AdditionalDependencies) + + + false + NDEBUG;%(PreprocessorDefinitions) + + + 0x0409 + NDEBUG;%(PreprocessorDefinitions) + $(IntDir);%(AdditionalIncludeDirectories) + + + + + + + + + + + + + + + + + + false + + + Create + Create + Create + Create + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tool3_2048/tool3/tool3.vcxproj.filters b/tool3_2048/tool3/tool3.vcxproj.filters new file mode 100644 index 0000000..204c239 --- /dev/null +++ b/tool3_2048/tool3/tool3.vcxproj.filters @@ -0,0 +1,62 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + Resource Files + + + Resource Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/tool3_2048/tool3/tool3.vcxproj.user b/tool3_2048/tool3/tool3.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/tool3_2048/tool3/tool3.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/tool3_2048/x64/Release/libcrypto.dll b/tool3_2048/x64/Release/libcrypto.dll new file mode 100644 index 0000000..c760d36 Binary files /dev/null and b/tool3_2048/x64/Release/libcrypto.dll differ diff --git a/tool3_2048/x64/Release/tool3.exe b/tool3_2048/x64/Release/tool3.exe new file mode 100644 index 0000000..50d6749 Binary files /dev/null and b/tool3_2048/x64/Release/tool3.exe differ