Skip to content

Instantly share code, notes, and snippets.

@jtojnar
Created September 25, 2011 00:42
Show Gist options
  • Save jtojnar/1240056 to your computer and use it in GitHub Desktop.
Save jtojnar/1240056 to your computer and use it in GitHub Desktop.
Delphi assembly
//0048EE8C
procedure TOknoRodice.btPrihlasitClick;
begin
{*
0048EE8C push ebp
0048EE8D mov ebp,esp
0048EE8F mov ecx,40
0048EE94 push 0
0048EE96 push 0
0048EE98 dec ecx
<0048EE99 jne 0048EE94
0048EE9B push ebx
0048EE9C push esi
0048EE9D push edi
0048EE9E mov ebx,eax
0048EEA0 xor eax,eax
0048EEA2 push ebp
0048EEA3 push 48F41F
0048EEA8 push dword ptr fs:[eax]
0048EEAB mov dword ptr fs:[eax],esp
0048EEAE lea edx,[ebp-1D4]
0048EEB4 mov eax,dword ptr [ebx+374]; TOknoRodice.eKod:TEdit
0048EEBA call TControl.GetText
0048EEBF cmp dword ptr [ebp-1D4],0
>0048EEC6 jne 0048EEE3
0048EEC8 push 0
0048EECA mov ecx,10
0048EECF mov edx,48F438; 'Zadejte prosím kód studenta.'
0048EED4 mov eax,48F460; 'Chybí kód'
0048EED9 call 0047E750
>0048EEDE jmp 0048F39C
0048EEE3 lea edx,[ebp-1D8]
0048EEE9 mov eax,dword ptr [ebx+37C]; TOknoRodice.eHeslo:TEdit
0048EEEF call TControl.GetText
0048EEF4 cmp dword ptr [ebp-1D8],0
>0048EEFB jne 0048EF18
0048EEFD push 0
0048EEFF mov ecx,10
0048EF04 mov edx,48F474; 'Zadejte prosím heslo pro pøístup ke známkám studenta.'
0048EF09 mov eax,48F4B4; 'Chybí heslo'
0048EF0E call 0047E750
>0048EF13 jmp 0048F39C
0048EF18 lea eax,[ebp-4]
0048EF1B mov edx,48F4C8; 'http://www.gtgm.cz/znamky/news.dat'
0048EF20 call @LStrLAsg
0048EF25 mov eax,[00496D28]; ^gvar_004A7ED0:TWin32Slozky
0048EF2A push dword ptr [eax+0C]
0048EF2D push 48F4F4; '\\'
0048EF32 push 48F500; 'news.dat'
0048EF37 lea eax,[ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048EF3D mov edx,3
0048EF42 call @LStrCatN
0048EF47 mov edx,dword ptr [ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048EF4D mov eax,dword ptr [ebp-4]
0048EF50 call 0048DC10
0048EF55 test al,al
>0048EF57 jne 0048EF7D
0048EF59 cmp byte ptr ds:[4A7F80],0; gvar_004A7F80
>0048EF60 jne 0048EF7D
0048EF62 push 0
0048EF64 mov ecx,10
0048EF69 mov edx,48F514; 'Ujistìte se, že jste pøipojeni k internetu. Pokud ano, pokuste se navštívit www stránky gymnázia. Pokud nejsou pøístupné, jedná se o výpadek našeho serveru. Pokud se stránky zobrazily, pravdìpodobnì jste zadali chybnì kód nebo heslo. Rovnìž se ujistìte, že byl student aktivován a že používáte aktuální verzi programu.'
0048EF6E mov eax,48F65C; 'CHYBA PØIPOJENÍ'
0048EF73 call 0047E750
>0048EF78 jmp 0048F39C
0048EF7D mov edx,dword ptr [ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048EF83 lea eax,[ebp-1D0]
0048EF89 call @Assign
0048EF8E xor eax,eax
0048EF90 push ebp
0048EF91 push 48EFB6
0048EF96 push dword ptr fs:[eax]
0048EF99 mov dword ptr fs:[eax],esp
0048EF9C lea eax,[ebp-1D0]
0048EFA2 call @ResetText
0048EFA7 call @_IOTest
0048EFAC xor eax,eax
0048EFAE pop edx
0048EFAF pop ecx
0048EFB0 pop ecx
0048EFB1 mov dword ptr fs:[eax],edx
>0048EFB4 jmp 0048EFD6
<0048EFB6 jmp @HandleOnException
0048EFBB dd 1
0048EFBF dd 408354;EInOutError
0048EFC3 dd 48EFC7
0048EFC7 call @DoneExcept
>0048EFCC jmp 0048F39C
0048EFD1 call @DoneExcept
0048EFD6 lea edx,[ebx+818]; TOknoRodice.?f818:string
0048EFDC lea eax,[ebp-1D0]
0048EFE2 call @ReadLString
0048EFE7 lea eax,[ebp-1D0]
0048EFED call @ReadLn
0048EFF2 call @_IOTest
0048EFF7 lea eax,[ebp-1D0]
0048EFFD call @Close
0048F002 call @_IOTest
0048F007 cmp dword ptr [ebx+818],0; TOknoRodice.?f818:string
>0048F00E je 0048F021
0048F010 mov edx,dword ptr [ebx+818]; TOknoRodice.?f818:string
0048F016 mov eax,dword ptr [ebx+3B0]; TOknoRodice.RadekZprav:TStatusBar
0048F01C call TCustomStatusBar.SetSimpleText
0048F021 mov eax,dword ptr [ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048F027 call @LStrToPChar
0048F02C push eax
0048F02D call kernel32.DeleteFileA
0048F032 lea eax,[ebp-4]
0048F035 mov edx,48F674; 'http://www.gtgm.cz/znamky/aktualizace.dat'
0048F03A call @LStrLAsg
0048F03F mov eax,[00496D28]; ^gvar_004A7ED0:TWin32Slozky
0048F044 push dword ptr [eax+0C]
0048F047 push 48F4F4; '\\'
0048F04C push 48F6A8; 'aktualizace.dat'
0048F051 lea eax,[ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048F057 mov edx,3
0048F05C call @LStrCatN
0048F061 mov edx,dword ptr [ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048F067 mov eax,dword ptr [ebp-4]
0048F06A call 0048DC10
0048F06F test al,al
>0048F071 je 0048F097
0048F073 cmp byte ptr ds:[4A7F80],0; gvar_004A7F80
>0048F07A jne 0048F097
0048F07C push 0
0048F07E mov ecx,40
0048F083 mov edx,48F6C0; 'Právì probíhá aktualizace známek. Zkuste se prosím pøihlásit za nìkolik minut.'
0048F088 mov eax,48F718; 'Aktualizace'
0048F08D call 0047E750
>0048F092 jmp 0048F39C
0048F097 push 48F72C; 'http://www.gtgm.cz/znamky/'
0048F09C lea edx,[ebp-1E0]
0048F0A2 mov eax,dword ptr [ebx+374]; TOknoRodice.eKod:TEdit
0048F0A8 call TControl.GetText
0048F0AD mov eax,dword ptr [ebp-1E0]
0048F0B3 lea edx,[ebp-1DC]
0048F0B9 call AnsiLowerCase
0048F0BE push dword ptr [ebp-1DC]
0048F0C4 push 48F750; '.ztgm'
0048F0C9 lea eax,[ebp-4]
0048F0CC mov edx,3
0048F0D1 call @LStrCatN
0048F0D6 mov eax,[00496D28]; ^gvar_004A7ED0:TWin32Slozky
0048F0DB push dword ptr [eax+0C]
0048F0DE push 48F4F4; '\\'
0048F0E3 lea edx,[ebp-1E8]
0048F0E9 mov eax,dword ptr [ebx+374]; TOknoRodice.eKod:TEdit
0048F0EF call TControl.GetText
0048F0F4 mov eax,dword ptr [ebp-1E8]
0048F0FA lea edx,[ebp-1E4]
0048F100 call AnsiLowerCase
0048F105 push dword ptr [ebp-1E4]
0048F10B push 48F750; '.ztgm'
0048F110 lea eax,[ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048F116 mov edx,4
0048F11B call @LStrCatN
0048F120 mov edx,dword ptr [ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048F126 mov eax,dword ptr [ebp-4]
0048F129 call 0048DC10
0048F12E test al,al
>0048F130 je 0048F29A
0048F136 mov eax,ebx
0048F138 call 0048DD0C
0048F13D test al,al
>0048F13F jne 0048F16D
0048F141 mov eax,dword ptr [ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048F147 call @LStrToPChar
0048F14C push eax
0048F14D call kernel32.DeleteFileA
0048F152 push 0
0048F154 mov ecx,30
0048F159 mov edx,48F760; 'Zkontrolujte, zda jste zadali správnì heslo pro pøístup ke známkám studenta.'
0048F15E mov eax,48F7B8; 'Pøístup zamítnut'
0048F163 call 0047E750
>0048F168 jmp 0048F39C
0048F16D push 0
0048F16F lea ecx,[ebp-1EC]
0048F175 mov eax,dword ptr [ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048F17B mov edx,48F7D4; '.otgm'
0048F180 call ChangeFileExt
0048F185 mov ecx,dword ptr [ebp-1EC]
0048F18B lea edx,[ebx+658]; TOknoRodice.?f658:TStudent
0048F191 mov eax,ebx
0048F193 call 0048E004
0048F198 mov byte ptr [ebx+821],al; TOknoRodice.?f821:byte
0048F19E push 1
0048F1A0 mov ecx,dword ptr [ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048F1A6 lea edx,[ebx+4A8]; TOknoRodice.?f4A8:TStudent
0048F1AC mov eax,ebx
0048F1AE call 0048E004
0048F1B3 test al,al
>0048F1B5 je 0048F1BE
0048F1B7 mov eax,ebx
0048F1B9 call 0048EC08
0048F1BE mov eax,ebx
0048F1C0 call 00492A84
0048F1C5 mov eax,dword ptr [ebx+388]; TOknoRodice.btPrihlasit:TButton
0048F1CB xor edx,edx
0048F1CD mov ecx,dword ptr [eax]
0048F1CF call dword ptr [ecx+68]; TControl.SetEnabled
0048F1D2 mov eax,dword ptr [ebx+3D0]; TOknoRodice.chPodrobne:TCheckBox
0048F1D8 mov dl,1
0048F1DA mov ecx,dword ptr [eax]
0048F1DC call dword ptr [ecx+68]; TControl.SetEnabled
0048F1DF mov eax,dword ptr [ebx+37C]; TOknoRodice.eHeslo:TEdit
0048F1E5 xor edx,edx
0048F1E7 mov ecx,dword ptr [eax]
0048F1E9 call dword ptr [ecx+68]; TControl.SetEnabled
0048F1EC mov eax,dword ptr [ebx+374]; TOknoRodice.eKod:TEdit
0048F1F2 xor edx,edx
0048F1F4 mov ecx,dword ptr [eax]
0048F1F6 call dword ptr [ecx+68]; TControl.SetEnabled
0048F1F9 mov eax,dword ptr [ebx+3A4]; TOknoRodice.btAktualizace:TButton
0048F1FF mov dl,1
0048F201 mov ecx,dword ptr [eax]
0048F203 call dword ptr [ecx+68]; TControl.SetEnabled
0048F206 push 48F7E4; 'Známky ['
0048F20B push dword ptr [ebx+4A8]; TOknoRodice.?f4A8:TStudent
0048F211 push 48F7F8; ']'
0048F216 lea eax,[ebp-1F0]
0048F21C mov edx,3
0048F221 call @LStrCatN
0048F226 mov edx,dword ptr [ebp-1F0]
0048F22C mov eax,dword ptr [ebx+4A0]; TOknoRodice.TrayIkona:TTrayIcon
0048F232 call TCustomTrayIcon.SetHint
0048F237 cmp byte ptr [ebx+820],0; TOknoRodice.?f820:Boolean
>0048F23E je 0048F259
0048F240 mov eax,dword ptr [ebx+3D0]; TOknoRodice.chPodrobne:TCheckBox
0048F246 mov dl,1
0048F248 mov ecx,dword ptr [eax]
0048F24A call dword ptr [ecx+0DC]; TCustomCheckBox.SetChecked
0048F250 mov edx,ebx
0048F252 mov eax,ebx
0048F254 call TOknoRodice.chPodrobneClick
0048F259 mov eax,ebx
0048F25B call 00492724
0048F260 mov eax,dword ptr [ebx+46C]; TOknoRodice.btTisk:TSpeedButton
0048F266 mov dl,1
0048F268 mov ecx,dword ptr [eax]
0048F26A call dword ptr [ecx+68]; TControl.SetEnabled
0048F26D mov eax,dword ptr [ebx+400]; TOknoRodice.Casovac:TTimer
0048F273 cmp byte ptr [eax+40],0; TTimer.Enabled:Boolean
>0048F277 jne 0048F2B0
0048F279 mov eax,dword ptr [ebx+408]; TOknoRodice.chKontrolovat:TCheckBox
0048F27F mov edx,dword ptr [eax]
0048F281 call dword ptr [edx+0D8]; TCustomCheckBox.GetChecked
0048F287 test al,al
>0048F289 je 0048F2B0
0048F28B mov eax,dword ptr [ebx+400]; TOknoRodice.Casovac:TTimer
0048F291 mov dl,1
0048F293 call TTimer.SetEnabled
>0048F298 jmp 0048F2B0
0048F29A push 0
0048F29C mov ecx,10
0048F2A1 mov edx,48F804; 'Pøehled známek nebyl nalezen. Ujistìte se, jste správnì zadali kód studenta. Pokud je kód správnì, pravdìpodobnì student není zatím aktivován.'
0048F2A6 mov eax,48F89C; 'STUDENT NENALEZEN'
0048F2AB call 0047E750
0048F2B0 push 48F72C; 'http://www.gtgm.cz/znamky/'
0048F2B5 lea edx,[ebp-1F8]
0048F2BB mov eax,dword ptr [ebx+374]; TOknoRodice.eKod:TEdit
0048F2C1 call TControl.GetText
0048F2C6 mov eax,dword ptr [ebp-1F8]
0048F2CC lea edx,[ebp-1F4]
0048F2D2 call AnsiLowerCase
0048F2D7 push dword ptr [ebp-1F4]
0048F2DD push 48F8B8; '.dtgm'
0048F2E2 lea eax,[ebp-4]
0048F2E5 mov edx,3
0048F2EA call @LStrCatN
0048F2EF mov eax,[00496D28]; ^gvar_004A7ED0:TWin32Slozky
0048F2F4 push dword ptr [eax+0C]
0048F2F7 push 48F4F4; '\\'
0048F2FC lea edx,[ebp-200]
0048F302 mov eax,dword ptr [ebx+374]; TOknoRodice.eKod:TEdit
0048F308 call TControl.GetText
0048F30D mov eax,dword ptr [ebp-200]
0048F313 lea edx,[ebp-1FC]
0048F319 call AnsiLowerCase
0048F31E push dword ptr [ebp-1FC]
0048F324 push 48F8B8; '.dtgm'
0048F329 lea eax,[ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048F32F mov edx,4
0048F334 call @LStrCatN
0048F339 mov edx,dword ptr [ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048F33F mov eax,dword ptr [ebp-4]
0048F342 call 0048DC10
0048F347 test al,al
>0048F349 je 0048F388
0048F34B mov edx,dword ptr [ebx+4A4]; TOknoRodice.?f4A4:TFileName
0048F351 mov cl,1
0048F353 mov eax,ebx
0048F355 call 0048E8A0
0048F35A test al,al
>0048F35C je 0048F365
0048F35E mov eax,ebx
0048F360 call 0048ED48
0048F365 mov byte ptr [ebx+822],1; TOknoRodice.?f822:byte
0048F36C mov eax,dword ptr [ebx+418]; TOknoRodice.Kalendar:TMonthCalendar
0048F372 mov dl,1
0048F374 mov ecx,dword ptr [eax]
0048F376 call dword ptr [ecx+68]; TControl.SetEnabled
0048F379 mov eax,dword ptr [ebx+414]; TOknoRodice.gAbsence:TGroupBox
0048F37F mov dl,1
0048F381 call TControl.SetVisible
>0048F386 jmp 0048F39C
0048F388 mov byte ptr [ebx+822],0; TOknoRodice.?f822:byte
0048F38F mov eax,dword ptr [ebx+414]; TOknoRodice.gAbsence:TGroupBox
0048F395 xor edx,edx
0048F397 call TControl.SetVisible
0048F39C xor eax,eax
0048F39E pop edx
0048F39F pop ecx
0048F3A0 pop ecx
0048F3A1 mov dword ptr fs:[eax],edx
0048F3A4 push 48F426
0048F3A9 lea eax,[ebp-200]
0048F3AF call @LStrClr
0048F3B4 lea eax,[ebp-1FC]
0048F3BA call @LStrClr
0048F3BF lea eax,[ebp-1F8]
0048F3C5 call @LStrClr
0048F3CA lea eax,[ebp-1F4]
0048F3D0 mov edx,3
0048F3D5 call @LStrArrayClr
0048F3DA lea eax,[ebp-1E8]
0048F3E0 call @LStrClr
0048F3E5 lea eax,[ebp-1E4]
0048F3EB call @LStrClr
0048F3F0 lea eax,[ebp-1E0]
0048F3F6 call @LStrClr
0048F3FB lea eax,[ebp-1DC]
0048F401 call @LStrClr
0048F406 lea eax,[ebp-1D8]
0048F40C mov edx,2
0048F411 call @LStrArrayClr
0048F416 lea eax,[ebp-4]
0048F419 call @LStrClr
0048F41E ret
<0048F41F jmp @HandleFinally
<0048F424 jmp 0048F3A9
0048F426 pop edi
0048F427 pop esi
0048F428 pop ebx
0048F429 mov esp,ebp
0048F42B pop ebp
0048F42C ret
*}
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment