Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // This file was generated by the Retargetable Decompiler
- // Website: https://retdec.com
- // Copyright (c) 2016 Retargetable Decompiler <info@retdec.com>
- //
- #include <stdint.h>
- #include <string.h>
- // ------------------- Function Prototypes --------------------
- int32_t ValidLac(int32_t decrypt, char * LacData, uint32_t pswdLength, int32_t ProductID);
- // ------------------------ Functions -------------------------
- // Address range: 0x0 - 0x245
- int32_t ValidLac(int32_t decrypt, char * LacData, uint32_t pswdLength, int32_t ProductID) {
- int32_t v1;
- int32_t v2 = &v1; // ebp
- int32_t result = -1; // 0x23e65
- if (pswdLength % 8 == 0) {
- // 0x22
- int32_t v3;
- GetLacEncData((int32_t)&v3, 26);
- int32_t v4;
- if (decrypt == 0) {
- // 0x22
- v4 = (int32_t)LacData;
- // branch -> 0x80
- } else {
- int32_t v5 = (int32_t)LacData;
- CbcTrplDec(v5, v2 - 2072, v2 - 2094, v2 - 2086, pswdLength);
- memcpy(LacData, (char *)(v2 - 2072), pswdLength);
- v4 = v5;
- // branch -> 0x80
- }
- // 0x80
- if ((int32_t)*LacData == v3 % 256) {
- // 0x91
- uint32_t v6;
- if ((int32_t)*(char *)(v4 + 1) == v6 % 256) {
- // 0xpswdLength
- uint32_t v7;
- if ((int32_t)*(char *)(v4 + 2) == v7 % 256) {
- // 0xb7
- uint32_t v8;
- if ((int32_t)*(char *)(v4 + 3) == v8 % 256) {
- // 0xdc
- int32_t v9;
- if ((int32_t)*(char *)(v4 + 171) == v9) {
- // 0xee
- int32_t v10;
- if ((int32_t)*(char *)(v4 + 172) == v10) {
- // 0x100
- int32_t v11;
- if ((int32_t)*(char *)(v4 + 173) == v11) {
- // 0x112
- int32_t v12;
- if ((int32_t)*(char *)(v4 + 174) == v12) {
- // 0x124
- int32_t v13;
- if ((int32_t)*(char *)(v4 + 175) == v13) {
- // 0x147
- memset((char *)(v2 - 2104), (int32_t)ValidLac, 26);
- int32_t v14 = v4 + 163; // bp+163
- ValExpDate(v14);
- if (v14 == 0) {
- int32_t v15 = pswdLength - 4;
- ckSum(v4, v15);
- int32_t v16 = v4 + pswdLength;
- if (v15 / 0x1000000 == (int32_t)*(char *)(v16 - 4)) {
- // 0x1ba
- if (v15 / 0x10000 % 256 == (int32_t)*(char *)(v16 - 3)) {
- // 0x1d8
- if (v15 / 256 % 256 == (int32_t)*(char *)(v16 - 2)) {
- // 0x1f6
- if (v15 % 256 == (int32_t)*(char *)(v16 - 1)) {
- // 0x21b
- memcpy((char *)ProductID, (char *)(v4 + 147), 16);
- result = ValidLac;
- // branch -> 0x23e
- } else {
- result = -4;
- }
- } else {
- result = -4;
- }
- } else {
- result = -4;
- }
- } else {
- result = -4;
- }
- } else {
- result = -4;
- }
- } else {
- result = -3;
- }
- } else {
- result = -3;
- }
- } else {
- result = -3;
- }
- } else {
- result = -3;
- }
- } else {
- result = -3;
- }
- } else {
- result = -2;
- }
- } else {
- result = -2;
- }
- } else {
- result = -2;
- }
- } else {
- result = -2;
- }
- }
- // 0x23e
- return result;
- }
- // --------------- Dynamically Linked Functions ---------------
- // void CbcTrplDec(int32_t decrypt, int32_t LacData, int32_t pswdLength, int32_t ProductID, int32_t a5);
- // void ckSum(int32_t decrypt, int32_t LacData);
- // void GetLacEncData(int32_t decrypt, int32_t LacData);
- // void * memcpy(void * restrict dest, const void * restrict src, size_t n);
- // void * memset(void * s, int c, size_t n);
- // void ValExpDate(int32_t decrypt);
- // --------------------- Meta-Information ---------------------
- // Detected compiler/packer: gcc (3.4.3)
- // Detected functions: 1
- // Decompiler release: v2.2 (2016-08-25)
- // Decompilation date: 2016-09-07 04:14:32
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement