Module: E:\SOURCE\TMP\LABGEN\targagen.cpp Group: 'DGROUP' CONST,CONST2,_DATA,_BSS Segment: _TEXT PARA USE32 000000e2 bytes #include "targagen.hpp" #include "genpixel.hpp" #include #include typedef unsigned char uint8; typedef unsigned short uint16; typedef unsigned long uint32; struct TargaHeader { uint32 unknown[3]; uint16 width; uint16 height; uint16 bpp; }; void generateTargaFile(const PixelMap& pm, const char *filename) { 0000 void near generateTargaFile( PixelMap const near &, char const near * ): 0000 53 push ebx 0001 51 push ecx 0002 56 push esi 0003 57 push edi 0004 83 ec 1c sub esp,0000001cH 0007 89 c6 mov esi,eax 0009 89 d0 mov eax,edx FILE *fp=fopen(filename,"wb"); 000b ba 00 00 00 00 mov edx,offset L7 0010 e8 00 00 00 00 call fopen_ 0015 89 44 24 14 mov +14H[esp],eax if(!fp) return; TargaHeader hdr; 0019 85 c0 test eax,eax 001b 0f 84 b9 00 00 00 je L6 hdr.unknown[0] = 0x00020000; 0021 ba 00 00 02 00 mov edx,00020000H hdr.unknown[1] = 0x00000000; 0026 31 db xor ebx,ebx 0028 89 14 24 mov [esp],edx 002b 89 5c 24 04 mov +4H[esp],ebx hdr.unknown[2] = 0x00000000; 002f 89 5c 24 08 mov +8H[esp],ebx hdr.width = (uint16)pm.queryWidth(); hdr.height = (uint16)pm.queryHeight(); hdr.bpp = 24; 0033 8b 56 04 mov edx,+4H[esi] 0036 66 89 54 24 0c mov +0cH[esp],dx fwrite(&hdr,sizeof(hdr),1,fp); 003b 89 c1 mov ecx,eax 003d 8b 56 08 mov edx,+8H[esi] 0040 89 e0 mov eax,esp 0042 66 89 54 24 0e mov +0eH[esp],dx 0047 ba 18 00 00 00 mov edx,00000018H 004c bb 01 00 00 00 mov ebx,00000001H 0051 66 89 54 24 10 mov +10H[esp],dx 0056 ba 12 00 00 00 mov edx,00000012H 005b e8 00 00 00 00 call fwrite_ uint8 *rgb=new uint8[pm.queryWidth()*3]; 0060 8b 56 04 mov edx,+4H[esi] 0063 8d 04 95 00 00 00 00 lea eax,+0H[edx*4] 006a 29 d0 sub eax,edx 006c e8 00 00 00 00 call void near * near operator new []( int unsigned ) memset(rgb,0,pm.queryWidth()*3); 0071 8b 56 04 mov edx,+4H[esi] 0074 8d 1c 95 00 00 00 00 lea ebx,+0H[edx*4] for(unsigned y=0; y