joyce8/EMBER2024-capa huggingface dataset:
Function at 0x40b8c0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push 0
push 0
push dbg.device_poll_thread
call sym.__beginthread
add esp, 0x10
inc eax
je 0x40b8e0
leave
ret
sub esp, 0xc
push str.cannot_create_input_thread
call dbg.fatal_errno
add esp, 0x10
leave
ret

Function at 0x40bdd0
Capabilities:
Get common file path
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x120
push str.ANDROID_SDK_HOME
call sym._getenv
add esp, 0x10
test eax, eax
je 0x40be06
push eax
mov ebx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
push str._s_s_s
push eax
push ebx
call dbg.build_path
add esp, 0x10
mov ebx, dword [ebp - 4]
leave
ret
sub esp, 0xc
lea ebx, [ebp - 0x108]
push ebx
push 0
push 0
push 0x28
push 0
call sub.SHELL32.DLL_SHGetFolderPathA
add esp, 0xc
push ebx
jmp 0x40bdec

Function at 0x40d7d0
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 8]
call dbg._fh_from_int
mov edx, eax
test eax, eax
je 0x40d7ec
cmp dword [eax], 0x41ea3c
je 0x40d7f0
leave
ret
sub esp, 0xc
lea eax, [ebp - 4]
push 4
push eax
push 1
push 6
mov eax, dword [edx + 0xc]
push eax
call sub.WS2_32.DLL_setsockopt
add esp, 0xc
leave
ret

Function at 0x40db10
Capabilities:
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 4
mov eax, dword [ebp + 0x10]
push 0
push eax
mov eax, dword [ebp + 0xc]
push eax
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0xc]
push eax
call sub.WS2_32.DLL_send
mov ebx, eax
cmp eax, 0xffffffff
je 0x40db3b
mov eax, ebx
mov ebx, dword [ebp - 4]
leave
ret
call dbg._socket_set_errno
jmp 0x40db34

Function at 0x40db50
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 4
mov ebx, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
push 0
push ebx
push ecx
mov edx, dword [eax + 0xc]
push edx
call sub.WS2_32.DLL_recv
mov ebx, eax
cmp eax, 0xffffffff
je 0x40db7b
mov eax, ebx
mov ebx, dword [ebp - 4]
leave
ret
call dbg._socket_set_errno
jmp 0x40db74

Function at 0x40dd90
Capabilities:
Initialize winsock library

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x198
mov eax, dword [0x433f38]
test eax, eax
je 0x40dda4
leave
ret
push eax
push eax
lea eax, [ebp - 0x190]
push eax
push 0x202
call sub.WS2_32.DLL_WSAStartup
pop edx
test eax, eax
pop ecx
jne 0x40dde0
sub esp, 0xc
push dbg._cleanup_winsock
call dbg.atexit
mov dword [0x433f38], 1
add esp, 0x10
leave
ret
sub esp, 0xc
push str.adb:_could_not_initialize_Winsock_n
call dbg.fatal
add esp, 0x10
jmp 0x40ddbd
Function at 0x40de00
Capabilities:
Create udp socket
Set socket configuration

Disassembly:
push ebp
mov eax, 0x41ea3c
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
mov edi, dword [ebp + 0xc]
call dbg._fh_alloc
mov esi, eax
or eax, 0xffffffff
test esi, esi
je 0x40df00
mov eax, dword [0x433f38]
test eax, eax
je 0x40df08
sub esp, 0xc
mov eax, dword [ebp + 8]
and eax, 0xffff
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov word [ebp - 0x20], 2
push eax
call sub.WS2_32.DLL_htons
mov word [addr.sin_family], ax
push 0
call sub.WS2_32.DLL_htonl
mov dword [ebp - 0x1c], eax
push eax
push eax
push 0
push edi
push 2
call sub.WS2_32.DLL_socket
add esp, 0x14
mov ebx, eax
cmp eax, 0xffffffff
je 0x40df5b
sub esp, 0xc
mov dword [esi + 0xc], eax
lea eax, [ebp - 0x10]
mov dword [ebp - 0x10], 1
push 4
push eax
push 0xfffffffffffffffb
push 0xffff
push ebx
call sub.WS2_32.DLL_setsockopt
push eax
push eax
lea eax, [ebp - 0x20]
push 0x10
push eax
push ebx
call sub.WS2_32.DLL_bind
add esp, 0x14
test eax, eax
js 0x40df5b
mov edx, str.udp:
cmp edi, 1
je 0x40df42
push eax
push eax
mov eax, dword [ebp + 8]
push eax
mov eax, esi
push edx
call dbg._fh_to_int
push eax
lea eax, [esi + 0x18]
push str._d_any_server:_s_d_
push 0x20
push eax
call sym.___mingw_snprintf
add esp, 0x20
cmp byte [0x434b38], 0
js 0x40df12
mov eax, esi
call dbg._fh_to_int
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call dbg._init_winsock
jmp 0x40de30
mov eax, esi
call dbg._fh_to_int
mov edx, 0x41e6e5
dec edi
je 0x40df67
sub esp, 0xc
push eax
mov eax, dword [ebp + 8]
push edx
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
push str.socket_inaddr_server:_port__d_type__s___fd__d_n
add eax, 0x40
push eax
call dbg.fprintf
add esp, 0x20
jmp 0x40def9
push eax
push eax
push 4
push ebx
call sub.WS2_32.DLL_listen
pop edx
test eax, eax
pop ecx
mov edx, 0x41e6cb
jns 0x40dece
mov eax, esi
call dbg._fh_close
or eax, 0xffffffff
jmp 0x40df00
mov edx, 0x41e6e9
jmp 0x40df21
Function at 0x40df70
Capabilities:
Create udp socket
Set socket configuration

Disassembly:
push ebp
mov eax, 0x41ea3c
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
call dbg._fh_alloc
mov ebx, eax
test eax, eax
jne 0x40df94
or eax, 0xffffffff
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [0x433f38]
test eax, eax
je 0x40e07c
sub esp, 0xc
mov eax, dword [ebp + 8]
mov dword [ebp - 0x20], 0
and eax, 0xffff
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov word [ebp - 0x20], 2
push eax
call sub.WS2_32.DLL_htons
mov word [addr.sin_family], ax
lea edi, [ebp - 0x20]
push 0x7f000001
call sub.WS2_32.DLL_htonl
mov dword [ebp - 0x1c], eax
push eax
push eax
push 0
mov eax, dword [ebp + 0xc]
push eax
push 2
call sub.WS2_32.DLL_socket
add esp, 0x14
mov esi, eax
cmp eax, 0xffffffff
je 0x40df89
sub esp, 0xc
mov dword [ebx + 0xc], eax
mov dword [ebp - 0x10], 1
lea eax, [ebp - 0x10]
push 4
push eax
push 0xfffffffffffffffb
push 0xffff
push esi
call sub.WS2_32.DLL_setsockopt
push eax
push eax
push 0x10
push edi
push esi
call sub.WS2_32.DLL_bind
add esp, 0x14
test eax, eax
js 0x40e0d2
mov edx, str.udp:
cmp dword [ebp + 0xc], 1
je 0x40e0b9
push ecx
push ecx
mov eax, dword [ebp + 8]
push eax
mov eax, ebx
push edx
call dbg._fh_to_int
push eax
lea eax, [ebx + 0x18]
push str._d_lo_server:_s_d_
push 0x20
push eax
call sym.___mingw_snprintf
add esp, 0x20
cmp byte [0x434b38], 0
js 0x40e086
mov eax, ebx
call dbg._fh_to_int
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call dbg._init_winsock
jmp 0x40dfa1
mov eax, ebx
call dbg._fh_to_int
mov edx, 0x41e6e5
cmp dword [ebp + 0xc], 1
je 0x40e0e1
sub esp, 0xc
push eax
push edx
mov eax, dword [ebp + 8]
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push str.socket_loopback_server:_port__d_type__s___fd__d_n
push eax
call dbg.fprintf
add esp, 0x20
jmp 0x40e06d
push eax
push eax
push 4
push esi
call sub.WS2_32.DLL_listen
mov edx, 0x41e6cb
pop esi
test eax, eax
pop edi
jns 0x40e042
mov eax, ebx
call dbg._fh_close
or eax, 0xffffffff
jmp 0x40df8c
mov edx, 0x41e6e9
jmp 0x40e098
Function at 0x40e100
Capabilities:
Connect socket
Resolve dns

Disassembly:
push ebp
mov eax, 0x41ea3c
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x1c
mov edi, dword [ebp + 0x10]
call dbg._fh_alloc
mov esi, eax
or eax, 0xffffffff
test esi, esi
je 0x40e208
mov edx, dword [0x433f38]
test edx, edx
je 0x40e210
sub esp, 0xc
mov eax, dword [ebp + 8]
push eax
call sub.WS2_32.DLL_gethostbyname
add esp, 0xc
mov ebx, eax
test eax, eax
je 0x40e264
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
mov eax, dword [eax + 8]
sub esp, 0xc
mov word [ebp - 0x1c], ax
mov eax, dword [ebp + 0xc]
and eax, 0xffff
push eax
call sub.WS2_32.DLL_htons
mov word [addr.sin_family], ax
sub esp, 8
movsx eax, word [ebx + 0xa]
mov edx, dword [ebx + 0xc]
push eax
lea ecx, [ebp - 0x18]
mov eax, dword [edx]
push eax
push ecx
call sym._memcpy
add esp, 0x1c
push 0
push edi
movsx eax, word [ebx + 8]
push eax
call sub.WS2_32.DLL_socket
pop edx
cmp eax, 0xffffffff
je 0x40e264
mov dword [esi + 0xc], eax
lea edx, [ebp - 0x1c]
push ebx
push 0x10
push edx
push eax
call sub.WS2_32.DLL_connect
pop ecx
test eax, eax
js 0x40e264
mov eax, str.udp:
cmp edi, 1
je 0x40e253
mov ebx, dword [ebp + 0xc]
push edx
push edx
push ebx
push eax
mov eax, esi
call dbg._fh_to_int
push eax
lea eax, [esi + 0x18]
push str._d_net_client:_s_d_
push 0x20
push eax
call sym.___mingw_snprintf
add esp, 0x20
cmp byte [0x434b38], 0
js 0x40e220
mov eax, esi
call dbg._fh_to_int
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call dbg._init_winsock
jmp 0x40e131
mov eax, esi
call dbg._fh_to_int
mov edx, 0x41e6e5
dec edi
je 0x40e25d
push ecx
push ecx
push eax
mov eax, dword [ebp + 8]
push edx
mov edx, dword [ebp + 0xc]
push edx
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
push str.socket_network_client:_host__s_port__d_type__s___fd__d_n
add eax, 0x40
push eax
call dbg.fprintf
add esp, 0x20
jmp 0x40e201
mov eax, 0x41e6cb
jmp 0x40e1d6
mov edx, 0x41e6e9
jmp 0x40e22f
mov eax, esi
call dbg._fh_close
or eax, 0xffffffff
jmp 0x40e208
Function at 0x40e270
Capabilities:
Connect socket
Connect udp socket
Create udp socket

Disassembly:
push ebp
mov eax, 0x41ea3c
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x1c
mov edi, dword [ebp + 8]
mov esi, dword [ebp + 0xc]
call dbg._fh_alloc
mov ebx, eax
or eax, 0xffffffff
test ebx, ebx
je 0x40e350
mov eax, dword [0x433f38]
test eax, eax
je 0x40e358
sub esp, 0xc
mov eax, edi
and eax, 0xffff
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
mov word [ebp - 0x1c], 2
push eax
call sub.WS2_32.DLL_htons
mov word [addr.sin_family], ax
push 0x7f000001
call sub.WS2_32.DLL_htonl
mov dword [ebp - 0x18], eax
push eax
push eax
push 0
push esi
push 2
call sub.WS2_32.DLL_socket
add esp, 0x14
cmp eax, 0xffffffff
je 0x40e39e
mov dword [ebx + 0xc], eax
lea edx, [ebp - 0x1c]
push ecx
push 0x10
push edx
push eax
call sub.WS2_32.DLL_connect
pop edx
test eax, eax
js 0x40e3cd
mov eax, str.udp:
cmp esi, 1
je 0x40e390
push ecx
push ecx
push edi
push eax
mov eax, ebx
call dbg._fh_to_int
push eax
lea eax, [ebx + 0x18]
push str._d_lo_client:_s_d_
push 0x20
push eax
call sym.___mingw_snprintf
add esp, 0x20
cmp byte [0x434b38], 0
js 0x40e362
mov eax, ebx
call dbg._fh_to_int
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call dbg._init_winsock
jmp 0x40e2a3
mov eax, ebx
call dbg._fh_to_int
mov edx, 0x41e6e5
dec esi
je 0x40e397
sub esp, 0xc
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push edx
push edi
push str.socket_loopback_client:_port__d_type__s___fd__d_n
push eax
call dbg.fprintf
add esp, 0x20
jmp 0x40e349
mov eax, 0x41e6cb
jmp 0x40e321
mov edx, 0x41e6e9
jmp 0x40e371
cmp byte [0x434b38], 0
js 0x40e3b3
mov eax, ebx
call dbg._fh_close
or eax, 0xffffffff
jmp 0x40e350
push esi
push esi
push str.socket_loopback_client:_could_not_create_socket_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
call dbg.fprintf
add esp, 0x10
jmp 0x40e3a7
cmp byte [0x434b38], 0
jns 0x40e3a7
mov eax, 0x41e6e5
dec esi
je 0x40e3e7
push edi
push eax
push str.socket_loopback_client:_could_not_connect_to__s:_d_n
jmp 0x40e3ba
mov eax, 0x41e6e9
jmp 0x40e3de
Function at 0x40e3f0
Capabilities:
Check if file exists

Disassembly:
push ebp
mov eax, 0x41ea54
mov ebp, esp
push esi
push ebx
mov esi, dword [ebp + 8]
call dbg._fh_alloc
mov ebx, eax
test eax, eax
je 0x40e54a
push ecx
push 0
push pe_nt_image_headers32
push 2
push 0
push 3
push 0x40000000
push esi
call sub.KERNEL32.dll_CreateFileA
mov dword [ebx + 0xc], eax
inc eax
pop edx
je 0x40e490
sub esp, 0xc
mov eax, ebx
push esi
call dbg._fh_to_int
push eax
lea eax, [ebx + 0x18]
push str._d__s_
push 0x20
push eax
call sym.___mingw_snprintf
add esp, 0x20
cmp byte [0x434b38], 0
js 0x40e461
lea esp, [ebp - 8]
mov eax, ebx
pop ebx
pop esi
pop ebp
jmp dbg._fh_to_int
mov eax, ebx
call dbg._fh_to_int
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push esi
push str.adb_creat:__s___fd__d_n
push eax
call dbg.fprintf
add esp, 0x10
mov eax, ebx
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
jmp dbg._fh_to_int
mov eax, ebx
call dbg._fh_close
cmp byte [0x434b38], 0
js 0x40e50a
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
je 0x40e4e7
cmp eax, 3
je 0x40e4d1
cmp byte [0x434b38], 0
js 0x40e541
call sym.__errno
mov dword [eax], 2
lea esp, [ebp - 8]
or eax, 0xffffffff
pop ebx
pop esi
pop ebp
ret
cmp byte [0x434b38], 0
js 0x40e527
call sym.__errno
mov dword [eax], 0x14
jmp 0x40e4c7
cmp byte [0x434b38], 0
jns 0x40e4bc
push eax
push eax
push str.file_not_found_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
call dbg.fprintf
add esp, 0x10
jmp 0x40e4bc
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push esi
push str.adb_creat:_could_not_open__s:
push eax
call dbg.fprintf
add esp, 0x10
jmp 0x40e4a0
push eax
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
push str.path_not_found_n
add eax, 0x40
push eax
call dbg.fprintf
add esp, 0x10
jmp 0x40e4da
push eax
push eax
push str.unknown_error_n
jmp 0x40e4f7
call sym.__errno
mov dword [eax], 0xc
jmp 0x40e4c7
Function at 0x40e560
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0xc
mov eax, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
cmp eax, 1
je 0x40e620
cmp eax, 2
je 0x40e610
mov esi, 0x80000000
test eax, eax
jne 0x40e5f1
mov eax, 0x41ea54
call dbg._fh_alloc
mov ebx, eax
test eax, eax
je 0x40e72b
push ecx
push 0
push 0
push 3
push 0
push 3
push esi
push edi
call sub.KERNEL32.dll_CreateFileA
mov dword [ebx + 0xc], eax
inc eax
pop edx
je 0x40e677
sub esp, 0xc
mov eax, ebx
push edi
call dbg._fh_to_int
push eax
lea eax, [ebx + 0x18]
push str._d__s_
push 0x20
push eax
call sym.___mingw_snprintf
add esp, 0x20
cmp byte [0x434b38], 0
js 0x40e630
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
jmp dbg._fh_to_int
cmp byte [0x434b38], 0
js 0x40e65d
call sym.__errno
mov dword [eax], 0x16
lea esp, [ebp - 0xc]
or eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, 0xc0000000
jmp 0x40e58a
mov esi, 0x40000000
jmp 0x40e58a
mov eax, ebx
call dbg._fh_to_int
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push edi
push str.adb_open:__s___fd__d_n
push eax
call dbg.fprintf
add esp, 0x10
mov eax, ebx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
jmp dbg._fh_to_int
push ebx
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
push str.adb_open:_invalid_options__0x_0x__n
add eax, 0x40
push eax
call dbg.fprintf
add esp, 0x10
jmp 0x40e5fa
mov eax, ebx
call dbg._fh_close
cmp byte [0x434b38], 0
js 0x40e6f4
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
je 0x40e6e2
cmp eax, 3
je 0x40e6c9
cmp byte [0x434b38], 0
js 0x40e6af
call sym.__errno
mov dword [eax], 2
jmp 0x40e605
push ebx
push ebx
push str.unknown_error_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push eax
call dbg.fprintf
add esp, 0x10
jmp 0x40e69f
cmp byte [0x434b38], 0
js 0x40e711
call sym.__errno
mov dword [eax], 0x14
jmp 0x40e605
cmp byte [0x434b38], 0
jns 0x40e69f
push edi
push edi
push str.file_not_found_n
jmp 0x40e6b6
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push edi
push str.adb_open:_could_not_open__s:
push eax
call dbg.fprintf
add esp, 0x10
jmp 0x40e687
mov eax, dword [sym.imp.msvcrt.dll__iob]
push esi
add eax, 0x40
push esi
push str.path_not_found_n
push eax
call dbg.fprintf
add esp, 0x10
jmp 0x40e6d2
call sym.__errno
mov dword [eax], 0xc
jmp 0x40e605

Function at 0x40e740
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x1c
lea eax, [ebp - 0xc]
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0x10]
push 0
push eax
mov eax, dword [ebp + 0xc]
push ebx
push eax
mov eax, dword [esi + 0xc]
push eax
call sub.KERNEL32.dll_WriteFile
add esp, 0xc
test eax, eax
je 0x40e781
cmp ebx, dword [ebp - 0xc]
ja 0x40e778
mov eax, dword [ebp - 0xc]
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret
mov dword [esi + 8], 1
jmp 0x40e76e
cmp byte [0x434b38], 0
js 0x40e79a
call sym.__errno
mov dword [eax], 5
or eax, 0xffffffff
jmp 0x40e771
lea eax, [esi + 0x18]
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push ebx
push str.adb_file_write:_could_not_write__d_bytes_from__s_n
push eax
call dbg.fprintf
add esp, 0x10
jmp 0x40e78a
Function at 0x40e7c0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x1c
lea eax, [ebp - 0xc]
mov esi, dword [ebp + 8]
mov ebx, dword [ebp + 0x10]
push 0
push eax
mov eax, dword [ebp + 0xc]
push ebx
push eax
mov eax, dword [esi + 0xc]
push eax
call sub.KERNEL32.dll_ReadFile
add esp, 0xc
test eax, eax
je 0x40e801
cmp ebx, dword [ebp - 0xc]
ja 0x40e7f8
mov eax, dword [ebp - 0xc]
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret
mov dword [esi + 8], 1
jmp 0x40e7ee
cmp byte [0x434b38], 0
js 0x40e81a
call sym.__errno
mov dword [eax], 5
or eax, 0xffffffff
jmp 0x40e7f1
lea eax, [esi + 0x18]
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push ebx
push str.adb_read:_could_not_read__d_bytes_from__s_n
push eax
call dbg.fprintf
add esp, 0x10
jmp 0x40e80a

Function at 0x40e8c0
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x20
mov eax, dword [ebp + 8]
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push eax
call sub.KERNEL32.dll_CreateFileA
mov esi, eax
pop eax
xor eax, eax
cmp esi, 0xffffffff
je 0x40e912
push eax
push eax
push 0
push esi
call sub.KERNEL32.dll_GetFileSize
mov ebx, eax
pop edi
xor edi, edi
pop eax
test ebx, ebx
jne 0x40e920
sub esp, 0xc
push esi
call sub.KERNEL32.dll_CloseHandle
mov eax, dword [ebp + 0xc]
add esp, 0xc
mov dword [eax], ebx
mov eax, edi
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
sub esp, 0xc
lea eax, [ebx + 1]
push eax
call sym._malloc
add esp, 0x10
mov edi, eax
test eax, eax
je 0x40e96d
sub esp, 0xc
lea eax, [ebp - 0x10]
push 0
push eax
push ebx
push edi
push esi
call sub.KERNEL32.dll_ReadFile
add esp, 0xc
test eax, eax
je 0x40e952
cmp ebx, dword [ebp - 0x10]
je 0x40e8ff
cmp byte [0x434b38], 0
js 0x40e97a
sub esp, 0xc
xor ebx, ebx
push edi
call sym._free
xor edi, edi
add esp, 0x10
jmp 0x40e8ff
cmp byte [0x434b38], 0
js 0x40e997
xor ebx, ebx
jmp 0x40e8ff
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov edx, dword [ebp + 8]
add eax, 0x40
push edx
push ebx
push str.load_file:_could_not_read__ld_bytes_from__s_n
push eax
call dbg.fprintf
add esp, 0x10
jmp 0x40e95b
mov eax, dword [sym.imp.msvcrt.dll__iob]
push ecx
add eax, 0x40
push ebx
push str.load_file:_could_not_allocate__ld_bytes_n
push eax
call dbg.fprintf
xor ebx, ebx
add esp, 0x10
jmp 0x40e8ff

Function at 0x40e9f0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x10
mov eax, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
mov ebx, dword [eax + 0x20]
mov eax, dword [eax + 0xc]
and eax, 0xffff
push eax
push str.entryCount_d_n
push edi
call sym._fprintf_13
mov eax, dword [ebp + 0xc]
add esp, 0x10
cmp word [eax + 0xc], 0
je 0x40ea6b
xor esi, esi
push edi
push 8
push 1
push str.__file__
call sym._fwrite
push edi
push 1
inc esi
mov edx, dword [ebx]
push edx
mov eax, dword [ebx + 4]
push eax
call sym._fwrite
add esp, 0x20
push edi
push 2
push 1
push 0x41ea84
call sym._fwrite
mov edx, dword [ebp + 0xc]
mov eax, dword [edx + 0xc]
add esp, 0x10
and eax, 0xffff
mov ebx, dword [ebx + 0x18]
cmp eax, esi
jg 0x40ea25
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
Function at 0x413750
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x11c
mov ebx, dword [esp + 0x130]
call sym.__errno
test ebx, ebx
mov dword [eax], 0
je 0x41390e
cmp byte [ebx], 0
je 0x4138d0
sub esp, 0xc
push ebx
call sub.KERNEL32.dll_GetFileAttributesA
add esp, 0xc
cmp eax, 0xffffffff
je 0x4138fc
test al, 0x10
je 0x4138d0
push eax
push 0x104
push ebx
lea edi, [esp + 0x24]
push edi
call sym.__fullpath
pop eax
mov ecx, edi
mov eax, dword [ecx]
add ecx, 4
lea edx, [eax - 0x1010101]
xor eax, 0xffffffff
and edx, eax
and edx, 0x80808080
je 0x4137ae
test edx, 0x8080
je 0x4138c2
add dl, dl
sbb ecx, 3
sub ecx, edi
lea eax, [ecx + 0x233]
push eax
call sym._malloc
add esp, 0x10
mov ebx, eax
test eax, eax
je 0x4138ea
lea esi, [eax + 0x22c]
mov ebp, eax
push eax
push eax
push edi
push esi
call sym._strcpy
add esp, 0x10
cmp byte [ebx + 0x22c], 0
jne 0x413874
sub esp, 0xc
push esi
call sym._strlen
add esp, 0xc
mov word [eax + esi], 0x2a
lea eax, [ebx + 0x120]
mov dword [ebx + 0x224], 0xffffffff
mov dword [ebx + 0x228], 0
mov dword [ebx + 0x118], 0
mov word [ebx + 0x11c], 0
mov word [ebx + 0x11e], 0
push 0x104
push 0
push eax
call sym._memset
add esp, 0x10
add esp, 0x11c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
sub esp, 0xc
push esi
call sym._strlen
pop edx
pop ecx
push 0x2f
lea edi, [esi + eax - 1]
push esi
call sym._strrchr
add esp, 0x10
cmp eax, edi
je 0x41380f
push eax
push eax
push 0x5c
push esi
call sym._strrchr
add esp, 0x10
cmp edi, eax
je 0x41380f
sub esp, 0xc
push esi
call sym._strlen
add esp, 0x10
mov word [eax + esi], 0x5c
jmp 0x41380f
shr edx, 0x10
add ecx, 2
jmp 0x4137d2
call sym.__errno
xor ebp, ebp
mov dword [eax], 0x14
add esp, 0x11c
mov eax, ebp
pop ebx
pop esi
pop edi
pop ebp
ret
call sym.__errno
xor ebp, ebp
mov dword [eax], 0xc
jmp 0x413867
call sym.__errno
xor ebp, ebp
mov dword [eax], 2
jmp 0x413867
call sym.__errno
xor ebp, ebp
mov dword [eax], 0xe
jmp 0x413867
Function at 0x4095aa
Capabilities:
Terminate process

Disassembly:
cmp ecx, dword [0x43c468]
jne 0x4095b4
repz ret
jmp fcn.0040bd76

Function at 0x40ba0b
Capabilities:
Link many functions at runtime

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x43c468]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 0xc]
push esi
push edi
mov dword [ebp - 0x1c], eax
call fcn.00408428
and dword [ebp - 0x14], 0
cmp dword [0x440f30], 0
mov dword [ebp - 0x18], eax
jne 0x40babe
push 0x4029b0
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov ebx, eax
test ebx, ebx
je 0x40bb66
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x4029a4
push ebx
call edi
test eax, eax
je 0x40bb66
mov esi, dword [sym.imp.KERNEL32.dll_EncodePointer]
push eax
call esi
push 0x402994
push ebx
mov dword [0x440f30], eax
call edi
push eax
call esi
push 0x402980
push ebx
mov dword [0x440f34], eax
call edi
push eax
call esi
push 0x402964
push ebx
mov dword [0x440f38], eax
call edi
push eax
call esi
mov dword [0x440f40], eax
test eax, eax
je 0x40babe
push 0x40294c
push ebx
call edi
push eax
call esi
mov dword [0x440f3c], eax
mov eax, dword [0x440f3c]
mov ecx, dword [ebp - 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_DecodePointer]
cmp eax, ecx
je 0x40bb17
cmp dword [0x440f40], ecx
je 0x40bb17
push eax
call esi
push dword [0x440f40]
mov edi, eax
call esi
mov ebx, eax
test edi, edi
je 0x40bb17
test ebx, ebx
je 0x40bb17
call edi
test eax, eax
je 0x40bb0e
lea ecx, [ebp - 0x24]
push ecx
push 0xc
lea ecx, [ebp - 0x10]
push ecx
push 1
push eax
call ebx
test eax, eax
je 0x40bb0e
test byte [ebp - 8], 1
jne 0x40bb17
or dword [ebp + 0x10], 0x200000
jmp 0x40bb4a
mov eax, dword [0x440f34]
cmp eax, dword [ebp - 0x18]
je 0x40bb4a
push eax
call esi
test eax, eax
je 0x40bb4a
call eax
mov dword [ebp - 0x14], eax
test eax, eax
je 0x40bb4a
mov eax, dword [0x440f38]
cmp eax, dword [ebp - 0x18]
je 0x40bb4a
push eax
call esi
test eax, eax
je 0x40bb4a
push dword [ebp - 0x14]
call eax
mov dword [ebp - 0x14], eax
push dword [0x440f30]
call esi
test eax, eax
je 0x40bb66
push dword [ebp + 0x10]
push dword [ebp - 0x1c]
push dword [ebp - 0x20]
push dword [ebp - 0x14]
call eax
jmp 0x40bb68
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004095aa
leave
ret