 Timestamp:
 Jan 5, 2005, 12:38:10 AM (16 years ago)
 Location:
 pwntcha/trunk
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

pwntcha/trunk/src/linuxfr.c
r419 r420 77 77 for(x = 0; x < img>width  9 * 7 + 1; x++) 78 78 { 79 int xcan= 1;80 for(c = 0; c < 7 ; c++, xcan)79 int goodx = 1; 80 for(c = 0; c < 7 && goodx; c++) 81 81 { 82 82 for(j = 3; j < 10; j++) … … 95 95 if(count < 2) 96 96 { 97 xcan= 0;97 goodx = 0; 98 98 break; 99 99 } 100 100 } 101 101 } 102 if(! xcan)102 if(!goodx) 103 103 continue; 104 104 105 105 /* Now we have an (x,y) candidate  try to fit 7 characters */ 106 for(c = 0; c < 7 ; c++, xcan)106 for(c = 0; c < 7 && goodx; c++) 107 107 { 108 int r2, g2, b2, test, tcan; 109 for(test = 0; test < 62; test++) 108 int r2, g2, b2, ch; 109 int minerror = INT_MAX; 110 for(ch = 0; ch < 62; ch++) 110 111 { 111 tcan= 1;112 for(j = 0; j < 12 ; j++, tcan)112 int error = 0, goodch = 1; 113 for(j = 0; j < 12 && goodch; j++) 113 114 for(i = 0; i < 8; i++) 114 115 { 115 116 getpixel(tmp, x + c * 9 + i, y + j, &r, &g, &b); 116 getpixel(font, test* 9 + i, j, &r2, &g2, &b2);117 getpixel(font, ch * 9 + i, j, &r2, &g2, &b2); 117 118 /* Only die if font is black and image is white */ 118 119 if(r > r2) 119 120 { 120 tcan= 0;121 goodch = 0; 121 122 break; 122 123 } 124 else if(r < r2) 125 error++; 123 126 } 124 if( tcan)127 if(goodch && error < minerror) 125 128 { 126 result[c] = all[test]; 129 minerror = error; 130 result[c] = all[ch]; 127 131 result[c+1] = '\0'; 128 break;129 132 } 130 133 } 131 if(!tcan) 132 { 133 xcan = 0; 134 break; 135 } 134 if(minerror == INT_MAX) 135 goodx = 0; 136 136 } 137 if(xcan)138 {137 /* Wow, that was a good guess! Exit this loop */ 138 if(goodx) 139 139 break; 140 }141 140 } 142 141 } 
pwntcha/trunk/testsuite/linuxfr/control.txt
r419 r420 4 4 KUhuaDs 5 5 DmwLiUH 6 D uLcaHf6 DyLcaWf 7 7 CSaNFLl 8 8 vGwzWNE 9 9 zoCucuh 10 10 WjikOBC 11 BbE OaSs12 wSeAk uu13 hjb Hvin14 x OmBzlq11 BbEQaSs 12 wSeAkyu 13 hjbNvin 14 xQmBzIq 15 15 McCUroO 16 16 TFdmmiK 17 17 gkHaGEK 18 Xzfqb uS19 B FlOzwq18 XzfqbyS 19 BRTOzwq 20 20 NFDBmfm 21 qzzDi lT21 qzzDiIT 22 22 ZdusZnh 23 PmhzZ PL24 AOe CsPD23 PmhzZRL 24 AOeGsRD 25 25 btZGKnl 26 26 wpfVpai 27 rtD PugJ28 PvspMJO29 PKFrJTX30 EVbK lUM31 T OXOzuY32 p FbSBTD27 rtDRygJ 28 RvspMJO 29 RKHrJTX 30 EVbKIUM 31 TQXQzuY 32 pHbSBTD 33 33 ZkFVWhk 34 CB lSCkh34 CBISCkh 35 35 MpjaaDq 36 36 vouZvvk 37 G OucaYn38 ph Ptpdq37 GQycaYn 38 phRtpdq 39 39 VmGnfZC 40 JSEVPZ H41 Btqp OUC42 Z lLWZWu43 DXYndf L40 JSEVPZN 41 BtqpQUC 42 ZTLWZWy 43 DXYndfN 44 44 fqqhGYL 45 45 GEnJVJH 46 46 xfHJsBV 47 Xu OuFjt47 XuQyFjt 48 48 HLqjlza 49 Mhw utaO50 JugmB lc51 FcmLZF u49 MhwytaO 50 JugmBIc 51 FcmLZFy 52 52 JuaocqJ 53 53 VvFfSdT 54 m uAASFU55 jmvPf lE56 ln usBSe57 uVTTaOl54 myAASPU 55 jmvPfIE 56 lnysBSe 57 yVTTaQl 58 58 BiNlSNW 59 59 lcqzuPc 60 60 dnZNenC 61 61 EXWwPES 62 iz CHLXu63 e Orxuva64 OWXHAmm62 izGHLXu 63 eQrxwva 64 QWXHAmm 65 65 pYlDnDf 66 F PqWdcf67 EAaVz LD68 sOvdO EL69 WExmj HL70 x ODiwFF71 ANSn Opb66 FRqWdcf 67 EAaVzND 68 sOvdORN 69 WExmjNL 70 xQDiwFF 71 ANSnQpb 72 72 kcBgrjc 73 73 HHmCNFx 74 74 tUFqNlc 75 LdCz COw76 Fj EElxG75 LdCzGQw 76 FjHRIxG 77 77 FCAhWZp 78 78 ZSEokTi 79 79 qqZZGdH 80 80 almMBzB 81 DdM hhwK81 DdMHHwK 82 82 uobBZWp 83 YC xsUHr83 YCWsUNr 84 84 oraVSFP 85 xuzz hvh85 xuzzHvH 86 86 Yifbkzq 87 87 ebttbkj 88 EzJjsHE89 dE OnsXL90 wcjS Pea91 jMGDfY O92 CgGkd uT88 RzJjsHE 89 dEQnAXM 90 wcjSRea 91 jMGDfYQ 92 CgGkdyT 93 93 JBJMMpY 94 o PvDKkz95 uAuKTOS96 Xj Prioj97 u nuJumu94 oRvDKkz 95 yAyKTOS 96 XjRrioj 97 upMJNWU 98 98 NiVdvTh 99 av hDElE100 ZoNuv OO99 avHDElE 100 ZoNuvQO
Note: See TracChangeset
for help on using the changeset viewer.