...
reSort
- 해당 함수는 다음과 같은 기능을 합니다.
해당 함수는 free() 함수를 이용해 gOrderList[a1] 영역을 해제합니다.
Code Block | ||||
---|---|---|---|---|
| ||||
unsigned __int64 __fastcall reSort(unsigned int a1) { int i; // [rsp+14h] [rbp-Ch] unsigned __int64 v3; // [rsp+18h] [rbp-8h] v3 = __readfsqword(0x28u); free(gOrderList[a1]); if ( a1 < gOrderCnt ) { for ( i = 0; a1 + i < gOrderCnt; ++i ) gOrderList[a1 + i] = gOrderList[a1 + i + 1]; } gOrderList[gOrderCnt--] = 0LL; return __readfsqword(0x28u) ^ v3; } |
orderCandy()
- 해당 함수는 다음과 같은 기능을 합니다.
Code Block |
---|
unsigned __int64 orderCandy() { struct STOCK *dest; // ST10_8 unsigned int i; // [rsp+4h] [rbp-1Ch] int num; // [rsp+Ch] [rbp-14h] unsigned __int64 v4; // [rsp+18h] [rbp-8h] v4 = __readfsqword(0x28u); if ( gOrderCnt ) { orderList(); puts("\nWould you like to order these candies?"); puts("0) Yes, 1) No"); if ( !(unsigned int)retNumber(2LL) ) { for ( i = 0; i < gOrderCnt; ++i ) { num = getStockNum(i); if ( num ) { gStock[num - 1]->candyNumber += gOrderList[i]->orderNumber; } else if ( (unsigned int)gStockCnt > 4 ) { puts("The warehouse is full. Your new order can not be completed."); } else { puts("\nEnter information about newly added candy."); dest = (struct STOCK *)malloc(0x18uLL); strncpy(dest->candyName, gOrderList[i]->orderCandyName, 8uLL); dest->candyNumber = gOrderList[i]->orderNumber; printf("Enter the price of %s candy.\n", dest); dest->candyPrice = retNumber(5LL); printf("Enter a description of the %s candy.\n", dest); dest->candyDescription = (char *)malloc(0x7CuLL); UserInput(dest->candyDescription, 124LL); gStock[gStockCnt++] = dest; } } while ( gOrderCnt ) { free(gOrderList[gOrderCnt - 1]); gOrderList[gOrderCnt-- - 1] = 0LL; } } } else { puts("You have never ordered a product."); } return __readfsqword(0x28u) ^ v4; } |
...