diff --git a/config/SZBE69_B8/objects.json b/config/SZBE69_B8/objects.json index 2473534f4..4f958ae57 100644 --- a/config/SZBE69_B8/objects.json +++ b/config/SZBE69_B8/objects.json @@ -2177,46 +2177,46 @@ "mw_version": "Wii/1.3", "cflags": "sdk/ec", "objects": { - "sdk/ec/src/ec_api.cpp": "MISSING", - "sdk/ec/src/ec_asyncOp.cpp": "MISSING", + "sdk/ec/src/ec_api.cpp": "NonMatching", + "sdk/ec/src/ec_asyncOp.cpp": "NonMatching", "sdk/ec/src/ec_base64.cpp": "Equivalent", - "sdk/ec/src/ec_checkECard.cpp": "MISSING", - "sdk/ec/src/ec_checkReg.cpp": "MISSING", - "sdk/ec/src/ec_chkDevStat.cpp": "MISSING", - "sdk/ec/src/ec_chkDownload_bw.cpp": "MISSING", - - "sdk/ec/src/ec_connect.cpp": "MISSING", - "sdk/ec/src/ec_content.cpp": "MISSING", - "sdk/ec/src/ec_csup.cpp": "MISSING", - "sdk/ec/src/ec_deleteContents.cpp": "MISSING", - "sdk/ec/src/ec_dk.cpp": "MISSING", - "sdk/ec/src/ec_downloadContents.cpp": "MISSING", - "sdk/ec/src/ec_file_bw.cpp": "MISSING", - "sdk/ec/src/ec_getContentsResReq.cpp": "MISSING", - "sdk/ec/src/ec_getTitle.cpp": "MISSING", - "sdk/ec/src/ec_getTitleResReq.cpp": "MISSING", - "sdk/ec/src/ec_http_bw.cpp": "MISSING", - - "sdk/ec/src/ec_list.cpp": "MISSING", - "sdk/ec/src/ec_listCatalog.cpp": "MISSING", - "sdk/ec/src/ec_listContentDownloadInfos.cpp": "MISSING", - "sdk/ec/src/ec_listContentSetGroups.cpp": "MISSING", - "sdk/ec/src/ec_listContentSets.cpp": "MISSING", - "sdk/ec/src/ec_listECardItems.cpp": "MISSING", - "sdk/ec/src/ec_listPurchaseHistory.cpp": "MISSING", - "sdk/ec/src/ec_listServiceItems.cpp": "MISSING", - "sdk/ec/src/ec_listTitleContents.cpp": "MISSING", - "sdk/ec/src/ec_listTitles.cpp": "MISSING", + "sdk/ec/src/ec_checkECard.cpp": "NonMatching", + "sdk/ec/src/ec_checkReg.cpp": "NonMatching", + "sdk/ec/src/ec_chkDevStat.cpp": "NonMatching", + "sdk/ec/src/ec_chkDownload_bw.cpp": "NonMatching", + + "sdk/ec/src/ec_connect.cpp": "NonMatching", + "sdk/ec/src/ec_content.cpp": "NonMatching", + "sdk/ec/src/ec_csup.cpp": "Matching", + "sdk/ec/src/ec_deleteContents.cpp": "NonMatching", + "sdk/ec/src/ec_dk.cpp": "NonMatching", + "sdk/ec/src/ec_downloadContents.cpp": "NonMatching", + "sdk/ec/src/ec_file_bw.cpp": "NonMatching", + "sdk/ec/src/ec_getContentsResReq.cpp": "NonMatching", + "sdk/ec/src/ec_getTitle.cpp": "NonMatching", + "sdk/ec/src/ec_getTitleResReq.cpp": "NonMatching", + "sdk/ec/src/ec_http_bw.cpp": "NonMatching", + + "sdk/ec/src/ec_list.cpp": "NonMatching", + "sdk/ec/src/ec_listCatalog.cpp": "NonMatching", + "sdk/ec/src/ec_listContentDownloadInfos.cpp": "NonMatching", + "sdk/ec/src/ec_listContentSetGroups.cpp": "NonMatching", + "sdk/ec/src/ec_listContentSets.cpp": "NonMatching", + "sdk/ec/src/ec_listECardItems.cpp": "NonMatching", + "sdk/ec/src/ec_listPurchaseHistory.cpp": "NonMatching", + "sdk/ec/src/ec_listServiceItems.cpp": "NonMatching", + "sdk/ec/src/ec_listTitleContents.cpp": "NonMatching", + "sdk/ec/src/ec_listTitles.cpp": "NonMatching", "sdk/ec/src/ec_md5.cpp": "Matching", "sdk/ec/src/ec_mem.cpp": "Matching", - "sdk/ec/src/ec_misc.cpp": "MISSING", - "sdk/ec/src/ec_purchaseTitle.cpp": "MISSING", - "sdk/ec/src/ec_register.cpp": "MISSING", - "sdk/ec/src/ec_shoplog_bw.cpp": "MISSING", - "sdk/ec/src/ec_soap.cpp": "MISSING", + "sdk/ec/src/ec_misc.cpp": "NonMatching", + "sdk/ec/src/ec_purchaseTitle.cpp": "NonMatching", + "sdk/ec/src/ec_register.cpp": "NonMatching", + "sdk/ec/src/ec_shoplog_bw.cpp": "NonMatching", + "sdk/ec/src/ec_soap.cpp": "NonMatching", "sdk/ec/src/ec_string.cpp": "NonMatching", - "sdk/ec/src/ec_sysconfig_bw.cpp": "MISSING" + "sdk/ec/src/ec_sysconfig_bw.cpp": "NonMatching" } }, "sdk/ec_c": { diff --git a/src/sdk/PowerPC_EABI_Support/MSL/MSL_C++/string b/src/sdk/PowerPC_EABI_Support/MSL/MSL_C++/string index 6bcdd985c..03e84567f 100644 --- a/src/sdk/PowerPC_EABI_Support/MSL/MSL_C++/string +++ b/src/sdk/PowerPC_EABI_Support/MSL/MSL_C++/string @@ -228,7 +228,7 @@ namespace std { do_replace(cur_size, 0, src, src + size, tag); } - + inline char *data() const; void append(const CharT *str) { // required to be here to match; probably an inline missing random_access_iterator_tag tag; @@ -471,4 +471,4 @@ namespace std { getline(basic_istream &is, basic_string &str); } -#endif +#endif \ No newline at end of file diff --git a/src/sdk/PowerPC_EABI_Support/MSL/MSL_C++/vector b/src/sdk/PowerPC_EABI_Support/MSL/MSL_C++/vector index e2b25bf08..3fa0c7341 100644 --- a/src/sdk/PowerPC_EABI_Support/MSL/MSL_C++/vector +++ b/src/sdk/PowerPC_EABI_Support/MSL/MSL_C++/vector @@ -219,4 +219,4 @@ namespace std { } -#endif +#endif \ No newline at end of file diff --git a/src/sdk/PowerPC_EABI_Support/MSL/MSL_C/stdlib.h b/src/sdk/PowerPC_EABI_Support/MSL/MSL_C/stdlib.h index 6921db707..f4fda9f69 100644 --- a/src/sdk/PowerPC_EABI_Support/MSL/MSL_C/stdlib.h +++ b/src/sdk/PowerPC_EABI_Support/MSL/MSL_C/stdlib.h @@ -27,6 +27,8 @@ void *bsearch( int (*comp)(const void *, const void *) ); +long strtol(const char *str, char **_end, int base); + int system(const char *command); char *getenv(const char *name); diff --git a/src/sdk/PowerPC_EABI_Support/MSL/MSL_C/string.h b/src/sdk/PowerPC_EABI_Support/MSL/MSL_C/string.h index d6b58339f..8482a5c54 100644 --- a/src/sdk/PowerPC_EABI_Support/MSL/MSL_C/string.h +++ b/src/sdk/PowerPC_EABI_Support/MSL/MSL_C/string.h @@ -22,6 +22,8 @@ size_t strxfrm(char *RESTRICT dest, const char *RESTRICT src, size_t count); size_t strlen(const char *str); + + int strcmp(const char *lhs, const char *rhs); int strncmp(const char *lhs, const char *rhs, size_t count); char *strchr(const char *str, int ch); diff --git a/src/sdk/ec/asyncOp.h b/src/sdk/ec/asyncOp.h new file mode 100644 index 000000000..04b223d69 --- /dev/null +++ b/src/sdk/ec/asyncOp.h @@ -0,0 +1,211 @@ +#ifndef EC_ASYNCOP_H +#define EC_ASYNCOP_H + +#include +#include +#include +#include + +void *asyncOpThreadFunc(void *arg); + +namespace ec { + class ECNamValStr : public ECString { + public: + ECString field0xc; + ECNamValStr(); + ~ECNamValStr(); + }; +} + +struct ECAsyncOpArg { + int field0x0; + int *field0x4; + ECString *field0x8; + unsigned long field0xc; + int field0x10; + int field0x14; + int field0x18; + int field0x1c; + int field0x20; + int field0x24; + int field0x28; + int field0x2c; + int field0x30; + ec::ECBufHeapMeta *bufHeap; //0x34 + void *field0x38; +}; + +struct AsyncOpThread : public _SHRThread { + int field0x2c; +}; + +class ECObj { + public: + void operator delete(void *); +}; + +class ECAsyncOp : public ECObj { +public: + //ECAsyncOpEnv *env; + long field0x4; //0x4 + ECString method; //0x8 + long field0x14; //0x14 + int field0x18; //0x18 + int field0x1c; + ECResult status; //0x20 + int field0x24; + int field0x28; //0x28 + u8 pad5[0x4]; + unsigned long field0x30; + unsigned long downloadSize; + int field0x38; + u8 pad6[0x4]; + char field0x3c; + u8 pad7[0x77]; + char field0xbb; + int field0xbc; + char &__vt; + u8 padf[0x3]; + int field0xc4; + int field0xc8; + int *field0xcc; + ECString *field0xd0; + int field0xd4; + int field0xd8; + int field0xdc; + int field0xe0; + int field0xe4; + int field0xe8; + int field0xec; + int field0xf0; + int field0xf4; + ec::ECBufHeapMeta *field0xf8; + void *pvVar; //0xfc + ec::ECBufHeapMeta field0x100; + const char *field0x108; + unsigned long field0x10c; + int field0x110; + int field0x114; + int field0x118; + int field0x11c; + const char *field0x120; + void setErrMsg(const char* msg); + void setErrInfo(const char*, const char*); + void setErrInfo(long, const char*); + void setTotalSize(unsigned long); + void incDownloadedSize(unsigned long); + ECResult init(long param1, ECAsyncOpArg *asyncOpArg); + void setFinalStatus(long param1); + void dump(); + ~ECAsyncOp(); +}; + +class ECAsyncOpEnv { + public: + int field0x0; + AsyncOpThread *opThread; + _SHRThread *opThread1; + int field0xc; + ECString ecsUrl; + ECString iasUrl; + ECString casUrl; + ECString ccsUrl; + ECString ucsUrl; + unsigned int points; + bool field0x50; //got points? + u8 pad1[0x14]; + ECString field0x68; + ECString field0x74; + int field0x80; + int field0x84; + int field0x88; + int field0x8c; + int field0x90; + int field0xbc; + u8 pad2[0x28]; + ECString field0xc0; + ECString field0xcc; + ECString field0xd8; + ECString field0xe4; + ECString field0xf0; + ECString field0xfc; + ECString field0x108; + ECString field0x114; + ECString field0x120; + ECString field0x12c; + ECString field0x138; + ECString field0x144; + u8 pad3[0x28]; + int field0x150; + int field0x154; + int field0x158; + int field0x15c; + int field0x160; + u8 pad4[0x4]; + int field0x164; + u8 padd[0xc]; + bool field0x170; + bool field0x171; + bool field0x172; + bool field0x173; + int field0x174; + ECString field0x184; + u8 pad5[0xc]; + ECVector *vector1; + u8 currTitleId[0x8]; + ECString field0x1b0; + ECString field0x1bc; + u8 pad7[0x8]; + ECString field0x1d0; + u8 pad8[0x48]; + ECString field0x224; + ECString field0x230; + ECString field0x23c; + bool field0x25a; + bool field0x25b; + u8 pad9[0x10]; + ECString field0x260; + ECAsyncOpEnv(); + ~ECAsyncOpEnv(); + ECResult init(); + ECResult shutDown(); + void lock(); + void unlock(); + void lockProgress(); + void unlockProgress(); + void dispatchOp(ECAsyncOp *op); + void post(ECAsyncOp *op); + void start(ECAsyncOp *op, ECAsyncOpArg *arg); + void clearOpCaches(); + void getDeviceInfo(); + void getKeyPairStatus(); + void setDeviceToken(const char *token); + void setDeviceToken(ECString &token); + void setNamedValue(const char *name, const char *value); + int saveConfig(); + void getConfig(); + void getDevId(); + void getDevCert(); + void getCRL(bool unk); + bool checkParentalControlPassword(const char *unk1, long code); + void getParentalControlInfo(); + void getCountry(); + void getRegion(); + void getLanguage(); + void getSerialNumber(); + void getFileSystemStatus(); + void getWifiMac(char *unk); + void getBluetoothMac(char *unk); + int getFreeChannelAppCount(); + int setWebSvcUrls(const char* ecsUrl, const char* iasUrl, const char* casUrl); + int setContentUrls(const char* ccsUrl, const char* ucsUrl); + void setErrInfo(const char*, const char*); +}; + +namespace ec { + ECAsyncOpEnv op; +} + + + +#endif // EC_ASYNCOP_H diff --git a/src/sdk/ec/content.h b/src/sdk/ec/content.h new file mode 100644 index 000000000..c59c231be --- /dev/null +++ b/src/sdk/ec/content.h @@ -0,0 +1,49 @@ +#ifndef EC_CONTENT_H +#define EC_CONTENT_H + +#include +#include +#include + + +namespace ec { + ECResult downloadUcsFule(const ECAsyncOpEnv &, const ECString &, char *, unsigned char *, unsigned long &); + class Buffer { + ~Buffer(); + }; + template + class Content { + u8 pad[0xf]; + //ECString has a size of 0xc + ECString str1; //0x10 + ECString str2; //0x1c + ECString str3; //0x28 + u8 pad1[0x4]; + ECString str4; //0x38 + ECString str5; //0x44 + ECString str6; //0x50 + ~Content(); + void get(); + }; + struct ECTmdView {}; + struct ECWhichContents {}; + struct ECTitleContentsResources {}; + ECResult getTmd(const ECAsyncOpEnv &, const ECString &, unsigned short *, unsigned char *&, unsigned long &, unsigned char *&, unsigned long &); + ECResult importTmd(const ECAsyncOpEnv &, unsigned char *, unsigned long, unsigned char *, unsigned long, unsigned char *, unsigned long); + ECResult getTitleContentsResources(const ECAsyncOpEnv&, const ECTmdView&, unsigned char*, unsigned long, ECWhichContents, ECWhichContents, unsigned short*, unsigned long, bool*, bool*, unsigned short*, unsigned long*, unsigned short*, unsigned long*, unsigned long*, ECTitleContentsResources*, ECTitleContentsResources*); + ECResult importContents(const ECAsyncOpEnv&, const ECTmdView&, unsigned char*, unsigned long, unsigned char*, unsigned long, unsigned char*, unsigned long, unsigned short*, unsigned long); + ECResult importContent(const ECAsyncOpEnv&, unsigned long long, unsigned long, unsigned long, unsigned char*, unsigned long); + class ImportBuf { + ~ImportBuf(); + void close(); + void write(const char*, unsigned long); + }; + ECResult importTickets(const ECAsyncOpEnv&, const ECVector&, const ECString&, const void*, unsigned long); + ECResult importTicket(const ECAsyncOpEnv&, const void*, const void*, unsigned long, const void*, unsigned long); + ECResult importCommonTicket(const ECAsyncOpEnv&, const ECString&, unsigned char*, unsigned long&); + ECResult downloadSysTitle(const ECAsyncOpEnv&, unsigned long long, unsigned long); + + +} + +#endif \ No newline at end of file diff --git a/src/sdk/ec/csup.h b/src/sdk/ec/csup.h new file mode 100644 index 000000000..292582954 --- /dev/null +++ b/src/sdk/ec/csup.h @@ -0,0 +1,76 @@ +#include + +enum ECOperation { + EC_OP_Invalid = 0, + EC_OP_PurchaseTitle = 1, + EC_OP_Unused1 = 2, + EC_OP_SyncTickets = 3, + EC_OP_RefreshCachedBalance = 4, + EC_OP_PurchasePoints = 5, + EC_OP_GetTitle = 6, + EC_OP_CheckRegistration = 7, + EC_OP_Register = 8, + EC_OP_Unregister = 9, + EC_OP_Transfer = 10, + EC_OP_DeleteOwnership = 11, + EC_OP_PurchaseGiftTitle = 12, + EC_OP_AcceptGiftTitle = 13, + EC_OP_CheckDeviceStatus = 14, + EC_OP_SyncRegistration = 15, + EC_OP_Connect = 16, + EC_OP_DownloadContents = 17, + EC_OP_Subscribe = 18, + EC_OP_GetChallenge = 19, + EC_OP_UpdateStatus = 20, + EC_OP_ListTitles = 21, + EC_OP_ListContentSets = 22, + EC_OP_ListSubscriptionPricings = 23, + EC_OP_ListPointsPricings = 24, + EC_OP_ListECardItems = 25, + EC_OP_ListTitleContents = 26, +}; +enum ECOpPhase { + EC_PHASE_NoPhase = 0, + EC_PHASE_Starting = 1, + EC_PHASE_Done = 2, + EC_PHASE_PurchasingTitle = 3, + EC_PHASE_Unused1 = 4, + EC_PHASE_DownloadingContent = 5, + EC_PHASE_GettingTicketsFromServer = 6, + EC_PHASE_GettingPointsBalance = 7, + EC_PHASE_PurchasingPoints = 8, + EC_PHASE_CheckingRegistrationStatus = 9, + EC_PHASE_Registering = 10, + EC_PHASE_Unregistering = 11, + EC_PHASE_Transfer = 12, + EC_PHASE_DeletingOwnership = 13, + EC_PHASE_AcceptingGiftTitle = 14, + EC_PHASE_GettingDeviceStatus = 15, + EC_PHASE_SyncingRegistration = 16, + EC_PHASE_Connecting = 17, + EC_PHASE_UpdatingStatus = 18, + EC_PHASE_ListingTitles = 19, + EC_PHASE_ListingContentSets = 20, + EC_PHASE_ListingSubscriptionPricings = 21, + EC_PHASE_ListingPointsPricings = 22, + EC_PHASE_ListingECardItems = 23, + EC_PHASE_GettingECardBalance = 24, + EC_PHASE_Subscribing = 25, + EC_PHASE_GettingChallenge = 26, + EC_PHASE_ListingTitleContents = 27, +}; +struct ECProgress { + // total size: 0x9C + ECResult status; // offset 0x0, size 0x4 + enum ECOperation operation; // offset 0x4, size 0x4 + enum ECOpPhase phase; // offset 0x8, size 0x4 + long isCancelRequested; // offset 0xC, size 0x4 + unsigned long totalSize; // offset 0x10, size 0x4 + unsigned long downloadedSize; // offset 0x14, size 0x4 + long errCode; // offset 0x18, size 0x4 + char errInfo[128]; // offset 0x1C, size 0x80 +}; + +namespace ec { + unsigned long getExternalErrCode(ECProgress *progress); +} \ No newline at end of file diff --git a/src/sdk/ec/log.h b/src/sdk/ec/log.h index 55cfaa181..5ecd06d6d 100644 --- a/src/sdk/ec/log.h +++ b/src/sdk/ec/log.h @@ -13,7 +13,8 @@ enum ECLogLevel { }; namespace ec { - + long lovBufLevel; + long logLevel; void logmsg(long level, const char* format, ...); ECResult setLogLevel(long level); diff --git a/src/sdk/ec/result.h b/src/sdk/ec/result.h index a9deaf910..5f3e748f8 100644 --- a/src/sdk/ec/result.h +++ b/src/sdk/ec/result.h @@ -6,7 +6,58 @@ enum ECResult { ECResult_Failure = -1, - ECResult_InvalidBufHeap = -4004, + ECResult_ECFail = -4001, /* Generic error */ + ECResult_NotSupported = -4002, /* Feature not implemented */ + ECResult_InsufficientResource = -4003, + ECResult_InvalidBufHeap = -4004, + ECResult_NoMemory = -4005, + ECResult_NotFound = -4006, + ECResult_NotBusy = -4007, /* no active async operation */ + ECResult_Busy = -4008, + ECResult_NotDone = -4009, + + ECResult_NetNotAvailable = -4013, /* Internet access not available */ + ECResult_WebServiceError = -4015, /* Server reports a problem */ + ECResult_InvalidECard = -4017, /* Invalid eCard */ + ECResult_Overflow = -4018, /* Output too big for buf provided */ + /* Should never see EC_E~~RROR_OVERFLOW */ + ECResult_ContentRecvErr = -4019, /* Error getting content from server */ + ECResult_ContentSizeMismatch = -4020, /* Downloaded content size doesn't match tmd */ + + ECResult_WebServiceResError = -4034, /* invalid web service response */ + ECResult_TicketImportErr = -4035, /* problem importing ticket */ + ECResult_TMDImportErr = -4036, /* problem importing title */ + ECResult_ContentImportErr = -4037, /* problem importing title content */ + ECResult_Canceled = -4038, /* an extended operation was canceled */ + ECResult_AlreadyInitialized = -4039, /* one time only action was previously done */ + ECResult_Init = -4041, /* library has not been initialized */ + ECResult_NotRegistered = -4042, /* device is not registered */ + ECResult_RecvWSErr = -4043, /* recv error on web service response */ + ECResult_NotActive = -4044, /* expected operation is not active op */ + ECResult_FileRead = -4045, + ECResult_FileWrite = -4046, + ECResult_TitleNotOwned = -4050, /* Title is not owned */ + ECResult_BadHeap = -4051, /* Bad heap */ + ECResult_HeaderParseErr = -4052, /* Could not parse http header */ + ECResult_ConfigErr = -4053, /* Invalid configuration (e.g. url is invalid) */ + ECResult_CancelFailed = -4054, /* Could not cancel asynchronous operaton */ + ECResult_UserINodes = -4055, /* Operation would exceed max user inodes */ + ECResult_UserBlocks = -4056, /* Operation would exceed max user blocks */ + ECResult_SystemINodes = -4057, /* Operation would exceed max sys inodes */ + ECResult_SystemBlocks = -4058, /* Operation would exceed max sys blocks */ + ECResult_NoDeviceCode = -4065, /* Operation requires device code */ + ECResult_NeedTicketSync = -4066, /* Operation requres ticket sync */ + ECResult_NeedECConnect = -4069, /* Operation requires EC_Connect() */ + ECResult_NoTMD = -4070, /* Title TMD is not on device */ + ECResult_NeedFirmwareUpdate = -4071, /* Title requires updated firmware */ + ECResult_PCPassIncorrect = -4074, /* Parental control password doesn't match */ + ECResult_NoPC = -4075, /* Parental control is not enabled */ + ECResult_NeedEULA = -4076, /* Customer has not agreed to EULA */ + ECResult_AgeRestricted = -4077, /* Opration requires parental control password */ + ECResult_PointsRestricted = -4078, /* Opration requires parental control password */ + ECResult_TitleOwned = -4079, /* Attempt purchase already owned item */ + ECResult_InsufficientFunds = -4081, /* Not enough funds to purchase the item */ + }; #define EC_SUCCESS(expr) ((expr) >= 0) diff --git a/src/sdk/ec/src/ec_content.cpp b/src/sdk/ec/src/ec_content.cpp new file mode 100644 index 000000000..ada66b57e --- /dev/null +++ b/src/sdk/ec/src/ec_content.cpp @@ -0,0 +1,61 @@ +/*#include + + +ECResult ec::downloadUcsFule(const ECAsyncOpEnv &env, const ECString &str, char *param3, unsigned char *param4, unsigned long ¶m5) { + char *pcVar5; + unsigned long uVar6; + unsigned long locala8; + AsyncOpThread *localb0; + unsigned long locala4; + ECResult status; + locala8 = param5; + localb0 = env.opThread + 0x2c; + locala4 = 0; + status = ECResult_Success; + if (!param4 || locala8 == 0) { + status = ECResult_InvalidBufHeap; + } + pcVar5 = (char *)status; + if (status == ECResult_Success) { + + } + return status; +} + + +ec::Buffer::~Buffer() {} + +ec::Content::~Content() {} + + +void ECAsyncOp::setErrInfo(long param1, const char *msg) { + char buffer [32]; + if (param1 != 0) { + snprintf(buffer, 0x20, "%d", param1); + setErrInfo(buffer, msg); + } else { + setErrMsg(msg); + + } + return; +} + +ec::ImportBuf::~ImportBuf() { close(); } + +ec::Content::~Content() {} + +ECResult ec::getTmd(const ECAsyncOpEnv &env, const ECString &str, unsigned short *param3, unsigned char *¶m4, unsigned long ¶m5, unsigned char *¶m6, unsigned long ¶m7) { + char *buffer; + if (param3) { + snprintf(buffer, 0xd, ".%u", param3); + } +} + + + + + + + + +*/ diff --git a/src/sdk/ec/src/ec_csup.cpp b/src/sdk/ec/src/ec_csup.cpp new file mode 100644 index 000000000..88a1f2a86 --- /dev/null +++ b/src/sdk/ec/src/ec_csup.cpp @@ -0,0 +1,59 @@ +#include + +int EC_GetCustomerSupportCode(int p1) { + int code; + if (p1 >= 0) { + code = 0; + } else { + code = 200000; + if (-p1 <= 9999) { + code = code - p1; + } + } + return code; +} + +namespace ec { + unsigned long getExternalErrCode(ECProgress *progress) { + ECResult status = progress->status; + long errCode = progress->errCode; + if (ECResult_WebServiceResError < status) { + if (status != ECResult_WebServiceError) { + if (status < ECResult_WebServiceError) { + if (status == ECResult_InvalidECard) goto label1; + } else if (status == ECResult_NotDone || (-4010 < status && ECResult_Failure < status)) { + errCode = 0; + goto label3; + } + goto label2; + } + goto label1; + } + if (status == ECResult_TitleOwned) goto label1; + if (status < ECResult_TitleOwned) { + if (status == ECResult_InsufficientFunds) goto label1; + } else if (status == ECResult_AgeRestricted) goto label1; + if (status == ECResult_NotRegistered) { + if (errCode <= 0) goto label2; +label1: + if (errCode <= 0) goto someLabel; + errCode = errCode + 205000; + if (206999 < errCode) errCode = 205000; + goto label3; + } +label2: + if ((status == ECResult_ContentRecvErr || status == ECResult_ECFail || status == ECResult_RecvWSErr) && errCode < 0) { + errCode = 200000 - errCode; + if (204999 < errCode) errCode = 200000; + goto label3; + } +someLabel: + if (status < ECResult_Success && (errCode = 200000 - status, 204999 < errCode)) { + errCode = 200000; + } +label3: + if (errCode == 0) return 0; + if (9998 >= errCode - 200001U) return -(errCode - 200000); + return -10000; + }; +} \ No newline at end of file diff --git a/src/sdk/ec/string.h b/src/sdk/ec/string.h index 27a9aac3b..1e9e712d3 100644 --- a/src/sdk/ec/string.h +++ b/src/sdk/ec/string.h @@ -19,6 +19,7 @@ namespace ec { ECOstringstream& operator<<(long value); ECOstringstream& operator<<(unsigned long long value); ECOstringstream& operator<<(long long value); + ECOstringstream& operator<<(int value); ECString str() { return m_Buffer; }