Apa yang kita butuhkan untuk membangun tambalan, kita akan menggambar, kita akan hidup

Kisah insinyur Rusia yang keras.



1. Bagaimana semuanya dimulai ...



Malaikat dan iblis berputar-putar di atas saya

Memotong duri dan Bima Sakti


Origa - Alam Semesta Batin

Dalam satu, CAD tidak terlalu domestik, dimungkinkan untuk mengkonversi gambar langsung ke PDF. Tetapi programmer tidak benar-benar mengerti bagaimana CAD mereka digunakan, atau mereka lupa menambahkan kemampuan untuk menyimpan pengaturan. Akibatnya, CAD, saat mengekspor ke PDF, selalu mengonversi hanya "lembar saat ini", kecuali Anda masuk ke parameter dan secara paksa memilih "Semua lembar". Dalam bisnis teknik kami, dokumen satu lembar sangat jarang, orang menderita dan terus mengunggah, mengirim, menghasilkan, dan hanya membuang daya prosesor pada PDF satu lembar dari waktu ke waktu. Pada Jumat malam yang lesumenyesap wiski campur dan menghisap cerutu, Saya bertanya-tanya - adakah yang dapat Anda lakukan?



Penolakan
  • , . . .
  • , - , \ . - , .






Gambar 1. Jendela pengaturan PDF.



2. ... dan bagaimana itu bisa berakhir



— . , . , , PDF .



, — . HKEY_LOCAL_MACHINE\SOFTWARE\ ( HKEY_CURRENT_USER) , . . , , - , .



— . , config.ini, settings.xml . .



3. Just Do It!



-

-


— -

, IT-. , . , " ", . , "Options", "1,1,2,3,1,0,1" , , . : " ?" " ?"



, — SysinternalsProcess Monitor(procmon).





2. Process Monitor



, , .. Procmon , windows - , 10-20 . , — . , , , "", … — "" 700+ . . , 19:46:29,4265774, — ( ) 1391,790…1,0,0.



"! !" — , , 1 0 , .

"!" — , , - , , .



. . — .



, , , , - , … , — " …". , , , . .



, , 20 000? , ( , ), , . , , (10^9)…



. " ". , . . … … "DPI". , , "400 DPI" ( ). . () - , …



TotalCommader > > *.* c "400 DPI". … . , , , , HEX- (, ). — :

imgUI.dll ( )

! ? . DLL — , , -:





3. DLL



--… , imgUI.dll img.dll imgUtils.dll. -- . , , , Rusians (, s) — imgRes.dll imgUIRes.dll. :



  • imgUI.dll — UI, — "User Interface", "400 DPI". — .
  • imgUIRes.dll — ,
  • imgUtils.dll — , pdf, (?)
  • img.dll — , , .
  • imgRes.dll — ??? img.dll ???


4.We need to go deeper ( )



All in all it was just a brick in the wall.

All in all it was just the bricks in the wall.


Pink Floyd — Another Brick In the Wall (Part 2)

.



, : , res-… . ArtMoney Restorator. — res- , , ( ) .



— res- ( ++- ).



imgRes.dll , imgUIRes.dll .



! — , — … … - … … , , ?

. Res- , , , , , — ! — " " , !



, , .



>>>OK>. . "-" , .





4. .



. -, -, , . ( , ). -, ID , . ( — ID):





5. ID Res-.



, - , , " ", .



— , ? , , , , - .



5.!



Run rabbit run

Dig that hole, forget the sun,

And when at last the work is done

Don't sit down it's time to dig another one


Pink Floyd — Breathe

10 , , - , - , . , , - DES, AES , — , . , . - HEX, ASM, IDA.



, (freeware, ). Ollydbg , .. 64 . Microsoft Debugger — , IDA .



, :



  • ID ( 1001 1014)
  • "400 DPI"


… , , imgUI.dll. ? -, "400 DPI" , -, .

DLL IDA , , 302A79452F5C:





6. IDA.



? , 1. 2. -, - -. "TextView" , — , 800+ sub_18…, , , — ?, , !?



, , - (PowerShell VBA), , , , .



, — " , ". — radiobutton ID 1004\1005. …-- . , IDA . , , " " 1004 3ECh HEX (h ). — , 3 2 . , ID 1005 (3EDh) . :





7. ID 1005



, … , , . , " " " ", " ", " ". — IDA . - . , — "" , — . , -. , , ( ), "" - . mov edx, 3EC - :



BA EC 03 00 0  


mov edx, 3ED :



BA ED 03 00 00


, , EC ED ! DLL , "", , … > … !!! PDF-, … ! ! , !



, , , , . , , , .



6. Hardcore hardcore



, ,

.

— , , , — .

, , — "", , PDF 1 . .. — PDF', , .





8.



? , !



"just for fun" imgUtils.dll. , imgUI.dll, — : OptionsPDFExport::SetResol, OptionsPDFExport::SetBW, OptionsPDFExport::GetStartSheet . ! ! , .. - :



mov     [rcx+15h], dl  
Retn


.. , DL rcx ( ?) … dl? rcx? , - GetBW rcx+15h 1 ( 0, )?



— . . . — ( ) , 99 , , 100 , .. … . (, , ).



mov rcx+15h, dl. - :



88 51 14


mov rcx+15h, 1, :



C7 81 14 00 00 00 01 00 00 00


.. 14 . ( — -- -, 86-64, ).



. - .



, … . .



? - ? , . — - PDF .



API Monitor v2. "" imgUtils.dll imgUI.dll… , 233 . , .



GetBW\SetBW\GetStartSheet , , .. .



- OptionsXPSExport. … , PDF', - ? Get' Set'



. , 300 . — ? ID — , "400 DPI".

400 16- , 190h. … 1 :





9. .



— , ? ! ! , 190h 96h ( 150). > PDF> … 400 DPI 150 DPI. ! — "" . — 300 , .



, ? r12 r13? :





10. R2D2.



r12 , r13 , , .. xor, mov. xor mov, .

, , rbp+330h 0, 32h - 1.

, — (1) (0).



, . " " , — . — .



r13b r12b [rbp+326h], , mov . mov . . . . — .



1 0, . - — , . — , 10-20 -.



— " ? 5 7 ?" , 0FFFFFFh "", "".



mov rpb+314, r12 . 0, 1! ? , . , 1 0 . , — mov rpb+314 r12 mov rpb+314 r13 … … " " !

, , . 14 .



. 0 — , 1 — , 2.

, — mov rpb+314 r12 mov rpb+314 00002h



, :





11. 24.



.. eax , mov rpb+314 eax mov rpb+314 r12!



-
mov rpb+314, r12 44 89 A5 14 03 00 00
mov rpb+314, eax 89 85 0C 03 00 00


— ? . , :



  • ( )
  • ( )
  • nop —
  • …. , .


— NOP, .. - NOP "90".

… , . PDF. :





11. PDF.



7.



We've come too far to give up who we are

So let's raise the bar and our cups to the stars


Daft Punk — Get Lucky

, , . , . " ", JMP' , , , - .



Agak memalukan bahwa pengetahuan ini tidak akan pernah masuk ke "produksi", dan insinyur akan terus menderita karena beberapa programmer, tapi C'est La Vie, begitulah perjanjian lisensinya.



Semoga postingan ini dapat menginspirasi seseorang untuk memperbaiki alat kerja, walaupun Anda seorang design engineer dan cukup jauh dari reverse engineering.




All Articles