call _printf printf(\
switch(software->info.category) {
case DISASSEMBLY:
printf(\DISASSEMBLY\
break;
case RECOVERY:
printf(\RECOVERY\
break;
case CRYPTOGRAPHY:
printf(\CRYPTOGRAPHY\ break; } pop ecx
not_os_x:
lea edx, (asc_40A331 -
aWeDonTSellHardwareForThe)[esi] push edx ; format call _printf pop ecx
mov cl, byte ptr [ebx+software_t.info] shr ecx, 5
and ecx, category >> 5 dec ecx
jz short DISASSEMBLY dec ecx
jz short RECOVERY dec ecx
jz short CRYPTOGRAPHY jmp short end
; ------------------------------------------------------------
DISASSEMBLY:
lea eax, (aDisassembly - aWeDonTSellHardwareForThe)[esi] push eax ; format call _printf pop ecx
jmp short end
; ------------------------------------------------------------
RECOVERY:
lea edx, (aRecovery -
aWeDonTSellHardwareForThe)[esi] push edx ; format call _printf pop ecx
jmp short end
; ------------------------------------------------------------
CRYPTOGRAPHY:
printf(\ }
bool
print_product(product_t *product) {
if (! check_product( product->category))
lea ecx, (aCryptography - aWeDonTSellHardwareForThe)[esi] push ecx ; format call _printf pop ecx end:
lea eax, (asc_40A358 -
aWeDonTSellHardwareForThe)[esi] push eax ; format call _printf pop ecx pop esi pop ebx pop ebp retn
print_software endp
; ------------------------------------------------------------ align 4
; ||||||||||||||| S U B R O U T I N E ||||||||||||||||||||||||
; Attributes: bp-based frame
; int __cdecl print_product(product_t *product)
print_product proc near ; CODE XREF: main+128p
product= dword ptr 8
push ebp
mov ebp, esp push ebx
mov ebx, [ebp+product]
push [ebx+product_t.category] ; product_category
call check_product pop ecx
test eax, eax
return false;
printf(\\
product->id);
switch(product->category) {
case BOOK:
print_book(&product->p.book);
break;
case SOFTWARE:
print_software( &product->p.software); break; }
return true; } jnz short check_product_ok xor eax, eax pop ebx pop ebp retn
; ------------------------------------------------------------
check_product_ok: ; CODE XREF: print_product+12j
push [ebx+product_t.id]
push offset aProduct04x ; format call _printf add esp, 8
mov edx, [ebx+product_t.category] sub edx, 1
jb short case_book jz short case_software jmp short default
; ------------------------------------------------------------
case_book: ; CODE XREF: print_product+2Ej
add ebx, product_t.p.book.title push ebx ; book call print_book pop ecx
jmp short default
; ------------------------------------------------------------
case_software: ; CODE XREF: print_product+30j
add ebx, product_t.p.software.info push ebx ; software call print_software pop ecx
default: ; CODE XREF: print_product+32j ... mov al, 1 pop ebx
pop ebp retn
print_product endp
; ------------------------------------------------------------ align 4
; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||| ; Attributes: bp-based frame void main() { ; void __cdecl main() main proc near ; DATA XREF: .data:0040A0D0o push ebp mov ebp, esp push ebx push esi printf(\ push edi push offset aCustomers ; format customer_t *customer = call _printf customers; pop ecx mov ebx, offset customers jmp short loc_401376 ; ---------------------------------------- while (customer->id != -------------------- 0) { loop_print_customer: ; CODE XREF: main+25j print_customer(custom push ebx ; customer er); call print_customer pop ecx customer++; add ebx, 40 loc_401376: ; CODE XREF: main+16j cmp [ebx+customer_t.id], 0 } jnz short loop_print_customer product_t *products = push 544 ; size (product_t*) call _malloc malloc(PRODUCTS_COUNT pop ecx
* sizeof(product_t)); mov ebx, eax mov [ebx+product_t.id], 1
products[0].id = 1;
products[0].category = BOOK;
products[0].p.book = ida_book;
products[1].id = 2;
products[1].category = SOFTWARE;
products[1].p.software =
softwares.softs[0];
products[2].id = 3;
products[2].category = SOFTWARE;
products[2].p.software =
softwares.softs[1];
products[3].id = 4;
products[3].category = SOFTWARE;
products[3].p.software =
softwares.softs[2];
printf(\; xor eax, eax ; BOOK
mov [ebx+product_t.category], eax
mov esi, offset aIdaQuickstartG ; \QuickStart Guide\
lea edi, [ebx+product_t.p.book.title] mov ecx, 32 rep movsd
mov dword ptr [ebx+product_t[1].id], 2 mov dword ptr
[ebx+product_t[1].category], SOFTWARE mov esi, offset softwares.softs
lea edi, [ebx+product_t[1].p.software] mov ecx, 9 rep movsd
mov dword ptr [ebx+product_t[2].id], 3 mov dword ptr
[ebx+product_t[2].category], SOFTWARE mov esi, (offset
softwares.softs.info+24h)
lea edi, [ebx+product_t[2].p.software] mov ecx, 9 rep movsd
mov dword ptr [ebx+product_t[3].id], 4 mov dword ptr
[ebx+product_t[3].category], SOFTWARE mov esi, (offset
softwares.softs.info+48h)
lea edi, [ebx+product_t[3].p.software] mov ecx, 9 rep movsd
push offset aProducts ; format call _printf pop ecx
xor esi, esi
loop_verify_print_product: ; CODE XREF: main+132j
mov eax, esi shl eax, 4 add eax, esi
push [ebx+eax*8+product_t.category] ; product_category
call check_product
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库IDA简易教程(8)在线全文阅读。
相关推荐: