Posted: Wed Jun 13, 2007 1:26 pm
Knott
А зачем ВМ, если твой компилер переводит яву в фасм?
А зачем ВМ, если твой компилер переводит яву в фасм?
Code: Select all
format ELF
; Ыпмп кепмд ле лятел...
; Уънмйщяцепъз пмйщим дйз имлъпояипмоч мюгеипч Entrypoint
; (Импмоьх ле лятел - уюм Entrypoint леимдч ле ъмцдчёпъз).
; Method: knott/Entrypoint#<init>!()V
;public Q25knott10Entrypoint233cinit3e2e2829V
;Q25knott10Entrypoint233cinit3e2e2829V:
; push ebp
; mov ebp,esp
; sub esp,8
; .JL_0:
; .JL_1:
; push dword [ebp+-4]
; call Q34java4lang6Object233cinit3e2e2829V
; .JL_4:
; jmp .footer
; .footer:
; add esp,8
; mov esp,ebp
; pop ebp
; ret
; Method: knott/Entrypoint#main!([Ljava/lang/String;)V
public Q25knott10Entrypoint23main2e285bLjava2flang2fString3b29V
Q25knott10Entrypoint23main2e285bLjava2flang2fString3b29V:
push ebp
mov ebp,esp
sub esp,24
.JL_0:
call Q25knott10Entrypoint23getZeroLong2e2829J
.JL_3:
mov [ebp+-8],eax
mov [ebp+-12],ebx
.JL_4:
.JL_5:
; For compability...
mov [ebp+-16],0
mov [ebp+-20],0
.JL_6:
.JL_7:
.JL_8:
push dword [ebp+-8]
push dword [ebp+-12]
push 0
push 0
call Q25knott10Entrypoint23compareLongs2e28JJ29Z
.JL_11:
mov [ebp+-24],eax
.JL_13:
.JL_15:
mov eax,[ebp+-24]
cmp eax,0
jne .JL_21
.JL_18:
call Q25knott10Entrypoint23hello2e2829V
.JL_21:
jmp .footer
.footer:
add esp,24
mov esp,ebp
pop ebp
ret
; Method: knott/Entrypoint#hello!()V
public Q25knott10Entrypoint23hello2e2829V
Q25knott10Entrypoint23hello2e2829V:
.JL_0:
.JL_2:
push 104
call Q25knott10Entrypoint23outch2e28C29V
.JL_5:
.JL_7:
push 101
call Q25knott10Entrypoint23outch2e28C29V
.JL_10:
.JL_12:
push 108
call Q25knott10Entrypoint23outch2e28C29V
.JL_15:
.JL_17:
push 108
call Q25knott10Entrypoint23outch2e28C29V
.JL_20:
.JL_22:
push 111
call Q25knott10Entrypoint23outch2e28C29V
.JL_25:
jmp .footer
.footer:
ret
; Method: knott/Entrypoint#getZeroLong!()J
public Q25knott10Entrypoint23getZeroLong2e2829J
Q25knott10Entrypoint23getZeroLong2e2829J:
.JL_0:
.JL_1:
xor eax,eax
xor ebx,ebx
jmp .footer
.footer:
ret
; Method: knott/Entrypoint#compareLongs!(JJ)Z
public Q25knott10Entrypoint23compareLongs2e28JJ29Z
Q25knott10Entrypoint23compareLongs2e28JJ29Z:
push ebp
mov ebp,esp
sub esp,12
.JL_0:
.JL_1:
.JL_2:
mov edx,[ebp+-12]
mov ecx,[ebp+-16]
mov ebx,[ebp+16]
mov eax,[ebp+12]
sub edx,ebx
test edx,edx
je .dl1
cmp edx,0
jl .dl2
jmp .dl3
.dl1:
sub ecx,eax
test ecx,ecx
je .dl4
cmp ecx,0
jl .dl2
jmp .dl3
.dl2:
mov eax,-1
jmp .dl5
.dl3:
mov eax,1
jmp .dl5
.dl4:
mov eax,0
.dl5:
.JL_3:
cmp eax,0
jle .JL_8
.JL_6:
.JL_7:
mov eax,1
jmp .footer
.JL_8:
.JL_9:
xor eax,eax
jmp .footer
.footer:
add esp,12
mov esp,ebp
pop ebp
ret
extrn Q34java4lang6Object233cinit3e2e2829V
extrn Q25knott10Entrypoint23outch2e28C29V
Code: Select all
package knott;
public class Entrypoint {
// Main entrypoint method.
public static void main(String[] args) {
long a = getZeroLong();
long b = 0;
boolean b = compareLongs(a, b);
if (b == false) {
hello();
}
}
// native - оечйуцчфуз кепмдч, лч мпйублмк мп заь
// омдлмк зцьие.
private static native void outch(char arg0);
private static void hello() {
outch('H'); outch('e'); outch('l');
outch('l'); outch('o');
}
private static long getZeroLong() {
return 0;
}
private static boolean compareLongs(long a, long b) {
return (a > b);
}
}
Code: Select all
main:
.JL_0:
.JL_2:
push 104
call Q25knott10Entrypoint23outch2e28C29V
.JL_5:
.JL_7:
push 101
call Q25knott10Entrypoint23outch2e28C29V
.JL_10:
.JL_12:
push 108
call Q25knott10Entrypoint23outch2e28C29V
.JL_15:
.JL_17:
push 108
call Q25knott10Entrypoint23outch2e28C29V
.JL_20:
.JL_22:
push 111
call Q25knott10Entrypoint23outch2e28C29V
ret
Code: Select all
// Main entrypoint method.
public static void main(String[] args) {
long a = getZeroLong();
long b = 0;
boolean b = compareLongs(a, b);
if (b == false) {
hello();
}
}
Code: Select all
; Дояжмх имд
.JL_4:
.JL_5:
; For compability...
mov [ebp+-16],0
mov [ebp+-20],0
.JL_6:
.JL_7:
.JL_8:
push dword [ebp+-8]
push dword [ebp+-12]
push 0
push 0
call Q25knott10Entrypoint23compareLongs2e28JJ29Z