; Source File Generated on 10-04-2003 @ hh:mm:ss by BCET_Gen Version 0.04 (Beta) ; (Time left out to make generation compare easier - jlw) ; Later - all the compile & generation options will be listed here Include BcetXc.Inc ; This is Optional! Include Bcet.Inc ; This is REQUIRED! fdSet_T Struc fdCount_ Dword ? fdArray_ Dword 64 dup (?) fdSet_T Ends timeval_T Struc tvSec_ Dword ? tvUsec_ Dword ? timeval_T Ends hostent_T Struc hName_ Dword ? hAliases_ Dword ? hAddrtype_ Word ? hLength_ Word ? hAddrList_ Dword ? hostent_T Ends netent_T Struc nName_ Dword ? nAliases_ Dword ? nAddrtype_ Word ? nNet_ Dword ? netent_T Ends servent_T Struc sName_ Dword ? sAliases_ Dword ? sPort_ Word ? sProto_ Dword ? servent_T Ends protoent_T Struc pName_ Dword ? pAliases_ Dword ? pProto_ Word ? protoent_T Ends InAddr_T Struc Saddr_ Dword ? InAddr_T Ends sockaddrIn_T Struc sinFamily_ Word ? sinPort_ Word ? sinAddr_ Dword ? sinZero_ Byte 8 dup (?) sockaddrIn_T Ends WsaData_T Struc wVersion_ Word ? wHighVersion_ Word ? szDescription_ Byte 257 dup (?) szSystemStatus_ Byte 129 dup (?) iMaxSockets_ Word ? iMaxUdpDg_ Word ? lpVendorInfo_ Dword ? WsaData_T Ends SOCKADDR_T Struc saFamily_ Word ? saData_ Byte 14 dup (?) SOCKADDR_T Ends sockproto_T Struc spFamily_ Word ? spProtocol_ Word ? sockproto_T Ends accept Proto StdCall :Dword, :Ptr, :Ptr bind Proto StdCall :Dword, :Ptr, :Dword closesocket Proto StdCall :Dword connect Proto StdCall :Dword, :Ptr, :Dword ioctlsocket Proto StdCall :Dword, :Dword, :Ptr getpeername Proto StdCall :Dword, :Ptr, :Ptr getsockname Proto StdCall :Dword, :Ptr, :Ptr getsockopt Proto StdCall :Dword, :Dword, :Dword, :$Str, :Ptr htonl Proto StdCall :Dword htons Proto StdCall :Dword inet_addr Proto StdCall :$Str inet_ntoa Proto StdCall :Dword listen Proto StdCall :Dword, :Dword ntonl Proto StdCall :Dword ntons Proto StdCall :Dword recv Proto StdCall :Dword, :$Str, :Dword, :Dword recvfrom Proto StdCall :Dword, :$Str, :Dword, :Dword, :Ptr, :Ptr select Proto StdCall :Dword, :Ptr, :Ptr, :Ptr, :Ptr send Proto StdCall :Dword, :$Str, :Dword, :Dword sendto Proto StdCall :Dword, :$Str, :Dword, :Dword, :Ptr, :Ptr setsockopt Proto StdCall :Dword, :Dword, :Dword, :$Str, :Ptr shutdown Proto StdCall :Dword, :Dword socket Proto StdCall :Dword, :Dword, :Dword gethostbyaddr Proto StdCall :$Str, :Dword, :Dword gethostbyname Proto StdCall :$Str gethostname Proto StdCall :$Str, :Dword WSAStartup Proto StdCall :Word, :Ptr WSACleanup Proto StdCall WSAGetLastError Proto StdCall IncludeLib ws2_32.lib ?ModuleStart Dword HOSTNAME_Module Byte 'B', 0, 4, 0 ; version info Dword 0 ; String Pool Size Dword 0 ; Nothing Yet @CurSeg Ends ?StringConst Align 4 Dword 6 String_0001 Byte "ws2_32", 0 Align 4 Dword 55 String_0002 Byte "hostname - simple program to return name of this system", 0 Align 4 Dword 15 String_0003 Byte "WsaStartup Rc: ", 0 Align 4 Dword 32 String_0004 Byte "gethostname WsaGetLastError Rc: ", 0 Align 4 Dword 11 String_0005 Byte "hostname: '", 0 Align 4 Dword 1 String_0006 Byte "'", 0 Align 4 Dword 31 String_0007 Byte "WsaCleanup WsaGetLastError Rc: ", 0 @CurSeg Ends ?NumberConst Number_0001 Dword 63 ; "63" Number_0002 Dword 11 ; "11" Number_0003 Dword -1 ; "-1" Number_0004 Dword 514 ; "&H202" Number_0005 Dword 0 ; "0" Number_0006 Dword 256 ; "256" Number_0007 Dword 255 ; "255" Number_0008 Dword 1 ; "1" ; Block: 1: Module: HOSTNAME_Module ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ; Block Init Begin ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; StmtData 1: DIM Src Line: 1443 @CurSeg Ends ?UserVars W_T_vat_0_267 WsaData_T <> ; StmtData 2: DIM Src Line: 1444 Rc_L_v_0_268 Dword 0 ; StmtData 3: DIM Src Line: 1444 Rd_L_v_0_269 Dword 0 ; StmtData 4: DIM Src Line: 1444 V_L_v_0_270 Dword 0 ; StmtData 5: DIM Src Line: 1444 Re_L_v_0_271 Dword 0 ; StmtData 6: DIM Src Line: 1444 n_$_v_0_272 $Str 0 ; StmtData 18: vardim Src Line: 1457 _StrTmp_00001 $Str 0 ; Block Init End ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ @CurSeg Ends .code HOSTNAME_Module Proc ; Block Variable Init Begin ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; Block Variable Init End Code ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; Block Statements Begin ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; ===> COLOR 11: CLS ; Stmt 7: COLOR Src Line: 1446 push 11 ; RT=L, RC=C, Ty=Num, Val="11" push -1 ; RT=L, RC=C, Ty=Num, Val="-1" call js$Color@8 ; ===> COLOR 11: CLS ; Stmt 8: CLS Src Line: 1446 call js$Cls@0 ; ===> PRINT "hostname - simple program to return name of this system" ; Stmt 9: PRINT Src Line: 1447 push Offset String_0002 ; RT=$, RC=C, Ty=Str, Value="hostname - simple program to return name of this system" call js$Print$@4 ; ===> PRINT ; Stmt 10: PRINT Src Line: 1448 call js$Print@0 ; ===> V = &H202 ' (byte)minor + (byte)major ; Stmt 11: Assignment Src Line: 1450 mov V_L_v_0_270, 514 ; GS: 'dVarBvR4 &' RT=L, RC=V, Ty=Sym, Name=V_L_v_0_270 RT=L, RC=C, Ty=Num, Val="&H202" ; ===> Rc = WsaStartup(V, W) ; Stmt 12: Assignment Src Line: 1451 push Offset W_T_vat_0_267 ; PA: Parameter 1 GA: 'dVaTBvR4 t' RT=T, RC=V, Ty=Sym, Name=W_T_vat_0_267 push V_L_v_0_270 ; GL: 'dVarBvR4g &' RT=L, RC=V, Ty=Sym, Name=V_L_v_0_270 PA: Parameter 2, E: 4 P: 2 call WSAStartup ; Usr Fun Call, Name=WSAStartup mov Rc_L_v_0_268, eax ; GS: 'dVarBvR4 &' RT=L, RC=V, Ty=Sym, Name=Rc_L_v_0_268 ; ===> IF Rc <> 0 THEN ; Stmt 13: IF Src Line: 1452 cmp Rc_L_v_0_268, 0 ; GL: 'dVarBvR4g &' RT=L, RC=V, Ty=Sym, Name=Rc_L_v_0_268 je IF_01002 ; ===> PRINT "WsaStartup Rc: ", Rc ; Stmt 14: PRINT COMMA Src Line: 1453 push Offset String_0003 ; RT=$, RC=C, Ty=Str, Value="WsaStartup Rc: " call js$PrintComma$@4 ; ===> PRINT "WsaStartup Rc: ", Rc ; Stmt 15: PRINT Src Line: 1453 push Rc_L_v_0_268 ; GL: 'dVarBvR4g &' RT=L, RC=V, Ty=Sym, Name=Rc_L_v_0_268 call js$PrintL@4 ; ===> GOTO CloseIt ; Stmt 16: GOTO Src Line: 1454 jmp L_CloseIt ; ===> END IF ; Stmt 17: ENDIF Src Line: 1455 IF_01001: ; IF Exit Label IF_01002: ; ; ===> n$ = SPACE$(256) ; Stmt 19: Assignment Src Line: 1457 push 256 ; Sys Fun Call, Name=SPACE$ RT=L, RC=C, Ty=Num, Val="256" call jf$SPACE$_L_$@4 push eax push Offset n_$_v_0_272 ; GL: 'dVarBvR4g $' RT=$, RC=V, Ty=Sym, Name=n_$_v_0_272 call j$StringAssign@8 ; GS: 'dVarBvR4 $' RT=$, RC=V, Ty=Sym, Name=n_$_v_0_272 ; ===> V = 255 ; Stmt 20: Assignment Src Line: 1458 mov V_L_v_0_270, 255 ; GS: 'dVarBvR4 &' RT=L, RC=V, Ty=Sym, Name=V_L_v_0_270 RT=L, RC=C, Ty=Num, Val="255" ; ===> Re = gethostname(n$, V) ; Stmt 21: Assignment Src Line: 1460 push V_L_v_0_270 ; GL: 'dVarBvR4g &' RT=L, RC=V, Ty=Sym, Name=V_L_v_0_270 PA: Parameter 1 lea edi, n_$_v_0_272 ; GL: 'dVarBvR4g $' RT=$, RC=V, Ty=Sym, Name=n_$_v_0_272 PA: Parameter 2 push [edi] ; byval string - use ACTUAL string address call gethostname ; Usr Fun Call, Name=gethostname mov Re_L_v_0_271, eax ; GS: 'dVarBvR4 &' RT=L, RC=V, Ty=Sym, Name=Re_L_v_0_271 ; ===> IF Re <> 0 THEN ; Stmt 22: IF Src Line: 1461 cmp Re_L_v_0_271, 0 ; GL: 'dVarBvR4g &' RT=L, RC=V, Ty=Sym, Name=Re_L_v_0_271 je IF_01004 ; ===> Rd = WsaGetLastError ; Stmt 23: Assignment Src Line: 1462 call WSAGetLastError ; Usr Fun Call, Name=WSAGetLastError mov Rd_L_v_0_269, eax ; GS: 'dVarBvR4 &' RT=L, RC=V, Ty=Sym, Name=Rd_L_v_0_269 ; ===> PRINT "gethostname WsaGetLastError Rc: ", Rd ; Stmt 24: PRINT COMMA Src Line: 1463 push Offset String_0004 ; RT=$, RC=C, Ty=Str, Value="gethostname WsaGetLastError Rc: " call js$PrintComma$@4 ; ===> PRINT "gethostname WsaGetLastError Rc: ", Rd ; Stmt 25: PRINT Src Line: 1463 push Rd_L_v_0_269 ; GL: 'dVarBvR4g &' RT=L, RC=V, Ty=Sym, Name=Rd_L_v_0_269 call js$PrintL@4 ; ===> END IF ; Stmt 26: ENDIF Src Line: 1464 IF_01003: ; IF Exit Label IF_01004: ; ; ===> PRINT "hostname: '" + GetStr(n$) + "'" ; Stmt 27: PRINT Src Line: 1466 push Offset n_$_v_0_272 ; GL: 'dVarBvR4g $' RT=$, RC=V, Ty=Sym, Name=n_$_v_0_272 PA: Parameter 1 call GetStr ; Usr Fun Call, Name=GetStr push Offset String_0005 ; RT=$, RC=C, Ty=Str, Value="hostname: '" push eax call j$StringConcat@8 push eax push Offset String_0006 ; RT=$, RC=C, Ty=Str, Value="'" call j$StringConcat@8 push eax call js$Print$@4 ; ===> PRINT ; Stmt 28: PRINT Src Line: 1467 call js$Print@0 ; ===> CloseIt: ; Stmt 29: jlwlabel Src Line: 1469 L_CloseIt: ; ; ===> Rc = WsaCleanup ; Stmt 30: Assignment Src Line: 1470 call WSACleanup ; Usr Fun Call, Name=WSACleanup mov Rc_L_v_0_268, eax ; GS: 'dVarBvR4 &' RT=L, RC=V, Ty=Sym, Name=Rc_L_v_0_268 ; ===> IF Rc <> 0 THEN ; Stmt 31: IF Src Line: 1471 cmp Rc_L_v_0_268, 0 ; GL: 'dVarBvR4g &' RT=L, RC=V, Ty=Sym, Name=Rc_L_v_0_268 je IF_01006 ; ===> Rd = WsaGetLastError ; Stmt 32: Assignment Src Line: 1472 call WSAGetLastError ; Usr Fun Call, Name=WSAGetLastError mov Rd_L_v_0_269, eax ; GS: 'dVarBvR4 &' RT=L, RC=V, Ty=Sym, Name=Rd_L_v_0_269 ; ===> PRINT "WsaCleanup WsaGetLastError Rc: ", Rd ; Stmt 33: PRINT COMMA Src Line: 1473 push Offset String_0007 ; RT=$, RC=C, Ty=Str, Value="WsaCleanup WsaGetLastError Rc: " call js$PrintComma$@4 ; ===> PRINT "WsaCleanup WsaGetLastError Rc: ", Rd ; Stmt 34: PRINT Src Line: 1473 push Rd_L_v_0_269 ; GL: 'dVarBvR4g &' RT=L, RC=V, Ty=Sym, Name=Rd_L_v_0_269 call js$PrintL@4 ; ===> END IF ; Stmt 35: ENDIF Src Line: 1474 IF_01005: ; IF Exit Label IF_01006: ; ; ===> END ; Stmt 36: END Src Line: 1476 call js$End@0 ; Block Statements End ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; Block Cleanup Begin ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; StmtDone 6: DIM Src Line: 1444 push Offset n_$_v_0_272 ; GL: 'dVarBvR4g $' RT=$, RC=V, Ty=Sym, Name=n_$_v_0_272 call j$StringDelete@4 ; StmtDone 18: vardim Src Line: 1457 push Offset _StrTmp_00001 ; GL: 'dVarBvR4g $' RT=$, RC=V, Ty=Sym, Name=_StrTmp_00001 call j$StringDelete@4 ; Block Cleanup End ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ret HOSTNAME_Module EndP ; Block: 2: Function: GetStr ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ GetStr Proc \ s_$_v_1_275:$Str ; Block Init Begin ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; StmtData 37: vardim Src Line: 1478 ; Aparameter, Name=s_$_v_1_275 - $Str ; StmtData 38: vardim Src Line: 1480 Local GetStr_$_frv_1_276:$Str ; StmtData 39: vardim Src Line: 1480 Local _StrTmp_00002:$Str ; StmtData 40: vardim Src Line: 1480 Local _StrTmp_00003:$Str ; Block Init End ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ call j$RoutineEntry ; Block Variable Init Begin ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; Block Variable Init End Code ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; Block Statements Begin ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; ===> GetStr$ = LEFT$(s$, INSTR(s$, CHR$(0)) - 1) ; Stmt 41: Assignment Src Line: 1480 push s_$_v_1_275 ; GL: 'pVarBrR4g $' RT=$, RC=V, Ty=Sym, Name=s_$_v_1_275 Sys Fun Call, Name=LEFT$ push s_$_v_1_275 ; GL: 'pVarBrR4g $' RT=$, RC=V, Ty=Sym, Name=s_$_v_1_275 Sys Fun Call, Name=INSTR push 0 ; Sys Fun Call, Name=CHR$ RT=L, RC=C, Ty=Num, Val="0" call jf$CHR$_L_$@4 push eax call jf$INSTR_$$_L@8 mov edi, eax dec edi ; RT=L, RC=C, Ty=Num, Val="1" push edi call jf$LEFT$_$L_$@8 push eax lea edi, GetStr_$_frv_1_276 ; GL: 'sFrvBvR4g $' RT=$, RC=V, Ty=Sym, Name=GetStr_$_frv_1_276 push edi call j$StringAssign@8 ; GS: 'sFrvBvR4 $' RT=$, RC=V, Ty=Sym, Name=GetStr_$_frv_1_276 ; Block Statements End ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ FS_01007: ; Block Exit Label ; Block Cleanup Begin ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ; StmtDone 39: vardim Src Line: 1480 lea edi, _StrTmp_00002 ; GL: 'sVarBvR4g $' RT=$, RC=V, Ty=Sym, Name=_StrTmp_00002 push edi call j$StringDelete@4 ; StmtDone 40: vardim Src Line: 1480 lea edi, _StrTmp_00003 ; GL: 'sVarBvR4g $' RT=$, RC=V, Ty=Sym, Name=_StrTmp_00003 push edi call j$StringDelete@4 ; StmtDone 38: vardim Src Line: 1480 lea eax, GetStr_$_frv_1_276 ; GA: 'sFrvBvR4 $' RT=$, RC=V, Ty=Sym, Name=GetStr_$_frv_1_276 call S$StringReturn ; Block Cleanup End ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ call j$RoutineExit mov eax, j_Func_$ ; Load Frv - load address of descriptor ret GetStr EndP ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ End ; Gen Code Completed!