Rev 9076 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
9076 | turbocat | 1 | format coff |
2 | use32 ; Tell compiler to use 32 bit instructions |
||
3 | |||
4 | ;section '.export' |
||
5 | |||
6 | section '.text' |
||
7 | |||
8 | include '../../../../proc32.inc' |
||
9 | include '../../../../macros.inc' |
||
10 | include '../../../../debug-fdo.inc' |
||
11 | include '../../../../dll.inc' |
||
12 | |||
13 | |||
14 | public mbedtls_init |
||
15 | ;;; Returns 0 on success. -1 on failure. |
||
16 | |||
17 | __DEBUG__ = 1 |
||
18 | __DEBUG_LEVEL__ = 2 |
||
19 | |||
20 | |||
21 | mbedtls_init: |
||
22 | pushad |
||
23 | stdcall dll.Load, @IMPORT |
||
24 | ;int3 |
||
25 | test eax, eax |
||
26 | jnz .error |
||
27 | |||
28 | popad |
||
29 | mov eax, 0 |
||
30 | ret |
||
31 | |||
32 | .error: |
||
33 | popad |
||
34 | mov eax, -1 |
||
35 | ret |
||
36 | |||
37 | gmtime: |
||
38 | jmp [localtime] |
||
39 | |||
40 | ;include_debug_strings |
||
41 | |||
42 | section '.data' |
||
43 | |||
44 | align 4 |
||
45 | @IMPORT: |
||
46 | library libc, 'libc.obj', networklib, 'network.obj' |
||
47 | import libc, \ |
||
48 | memcmp, 'memcmp', \ |
||
49 | printf, 'printf', \ |
||
50 | free, 'free', \ |
||
51 | strlen, 'strlen', \ |
||
52 | _strcmp, 'strcmp', \ |
||
53 | strstr, 'strstr', \ |
||
54 | rand, 'rand', \ |
||
55 | vsnprintf, 'vsnprintf', \ |
||
56 | socket, 'socket', \ |
||
57 | connect, 'connect', \ |
||
58 | close , 'close', \ |
||
59 | recv, 'recv', \ |
||
60 | send, 'send', \ |
||
61 | time, 'time', \ |
||
62 | strncmp, 'strncmp', \ |
||
63 | strncpy, 'strncpy', \ |
||
64 | calloc, 'calloc' , \ |
||
65 | snprintf, 'snprintf', \ |
||
66 | localtime, 'localtime' |
||
67 | |||
68 | import networklib, \ |
||
69 | inet_addr, 'inet_addr', \ |
||
70 | inet_ntoa, 'inet_ntoa', \ |
||
71 | getaddrinfo, 'getaddrinfo', \ |
||
72 | freeaddrinfo, 'freeaddrinfo' |
||
9812 | Coldy | 73 | |
74 | ; Most aliases below was changed for compatible to latest version tcc and the libc.obj headers |
||
9076 | turbocat | 75 | public inet_addr |
76 | public inet_ntoa |
||
9812 | Coldy | 77 | public getaddrinfo as '__imp_getaddrinfo@16' |
78 | public freeaddrinfo as '__imp_freeaddrinfo@4' |
||
9076 | turbocat | 79 | |
9812 | Coldy | 80 | public rand as '__imp_rand' |
81 | public memcmp as '__imp_memcmp' |
||
82 | public printf as '__imp_printf' |
||
83 | public calloc as '__imp_calloc' |
||
84 | public free as '__imp_free' |
||
85 | public strlen as '__imp_strlen' |
||
86 | public _strcmp as '__imp_strcmp' |
||
87 | public strstr as '__imp_strstr' |
||
9076 | turbocat | 88 | public gmtime |
9812 | Coldy | 89 | public vsnprintf as '__imp_vsnprintf' |
90 | public socket as '__imp_socket' |
||
91 | public connect as '__imp_connect' |
||
92 | public close as '__imp_close' |
||
93 | public recv as '__imp_recv' |
||
94 | public send as '__imp_send' |
||
95 | public time as '__imp_time' |
||
96 | public strncmp as '__imp_strncmp' |
||
97 | public strncpy as '__imp_strncpy' |
||
98 | public snprintf as '__imp_snprintf' |