joyce8/EMBER2024-capa huggingface dataset:
Function at 0x40ba40
Capabilities:
Contain obfuscated stackstrings

Disassembly:
push ebp
mov eax, 0x121c
mov ebp, esp
push edi
push esi
push ebx
call fcn.00412fe0
mov esi, dword [0x41df1c]
mov ebx, dword [0x41df18]
mov ecx, dword [0x41df14]
mov edx, dword [0x41df10]
mov dword [ebp - 0x10], 0x800
push edi
push 1
push 1
push 1
push esi
push ebx
push ecx
push edx
call dword [sym.imp.AdbWinApi.dll_AdbEnumInterfaces]
add esp, 0x20
mov edi, eax
test eax, eax
je 0x40bbba
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [ebp - 0x1220], eax
nop
lea esi, [esi]
lea eax, [ebp - 0x10]
push ebx
push eax
lea eax, [ebp - 0xa14]
push eax
push edi
call dword [sym.imp.AdbWinApi.dll_AdbNextInterface]
add esp, 0x10
test eax, eax
je 0x40bbad
lea ebx, [ebp - 0xa14]
mov edx, dword [ebp - 0xa00]
add ebx, 0x14
test dx, dx
je 0x40bbc2
lea esi, [ebp - 0x1214]
mov eax, ebx
mov ecx, esi
mov byte [ecx], dl
inc ecx
mov dx, word [eax + 2]
add eax, 2
test dx, dx
jne 0x40bae0
sub esp, 0xc
mov byte [ecx], 0
push esi
call dbg.known_device
add esp, 0x10
test eax, eax
je 0x40bb0b
mov dword [ebp - 0x10], 0x800
jmp 0x40baa0
sub esp, 0xc
push ebx
call dbg.do_usb_open
add esp, 0x10
mov ebx, eax
test eax, eax
je 0x40bb02
sub esp, 0xc
push eax
call dbg.recognized_device
add esp, 0x10
test eax, eax
je 0x40bb94
test byte [0x434b38], 0x20
jne 0x40bc28
push eax
lea eax, [ebp - 0x214]
push 0x200
push 0
push eax
call sym._memset
lea eax, [ebp - 0x14]
push 1
push eax
lea eax, [ebp - 0x214]
push eax
mov dword [ebp - 0x14], 0x200
mov eax, dword [ebx + 8]
push eax
call dword [sym.imp.AdbWinApi.dll_AdbGetSerialNumber]
add esp, 0x20
test eax, eax
je 0x40bbcf
sub esp, 0xc
push ebx
call dbg.register_new_device
add esp, 0x10
test eax, eax
jne 0x40bc45
test byte [0x434b38], 0x20
jne 0x40bc5d
sub esp, 0xc
push ebx
call dbg.usb_cleanup_handle
mov dword [esp], ebx
call sym._free
add esp, 0x10
jmp 0x40bb02
sub esp, 0xc
push edi
call dword [sym.imp.AdbWinApi.dll_AdbCloseHandle]
add esp, 0x10
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea esi, [ebp - 0x1214]
mov ecx, esi
jmp 0x40baef
sub esp, 0xc
mov dword [ebp - 0x214], 0x72646e41
mov dword [ebp - 0x210], 0x4464696f
mov dword [ebp - 0x20c], 0x63697665
push ebx
mov byte [ebp - 0x208], 0x65
call dbg.register_new_device
add esp, 0x10
test eax, eax
jne 0x40bc45
test byte [0x434b38], 0x20
je 0x40bb94
push eax
push esi
mov esi, dword [ebp - 0x1220]
push str.register_new_device_failed_for__s_n
push esi
call sym._fprintf_10
add esp, 0x10
jmp 0x40bb94
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push esi
push str.adding_a_new_device__s_n
push eax
call sym._fprintf_10
add esp, 0x10
jmp 0x40bb3a
push eax
lea eax, [ebp - 0x214]
push 1
push eax
push ebx
call dbg.register_usb_transport
add esp, 0x10
jmp 0x40bb02
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push esi
push str.register_new_device_failed_for__s_n
push eax
call sym._fprintf_10
add esp, 0x10
jmp 0x40bb94
Function at 0x40be40
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 0x40be76
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 0x40be5c

Function at 0x40d840
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 0x40d85c
cmp dword [eax], 0x41ea24
je 0x40d860
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 0x40db80
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 0x40dbab
mov eax, ebx
mov ebx, dword [ebp - 4]
leave
ret
call dbg._socket_set_errno
jmp 0x40dba4

Function at 0x40dbc0
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 0x40dbeb
mov eax, ebx
mov ebx, dword [ebp - 4]
leave
ret
call dbg._socket_set_errno
jmp 0x40dbe4

Function at 0x40de00
Capabilities:
Initialize winsock library

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x198
mov eax, dword [0x433f38]
test eax, eax
je 0x40de14
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 0x40de50
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 0x40de2d
Function at 0x40de70
Capabilities:
Create udp socket
Set socket configuration

Disassembly:
push ebp
mov eax, 0x41ea24
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 0x40df70
mov eax, dword [0x433f38]
test eax, eax
je 0x40df78
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 0x40dfcb
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 0x40dfcb
mov edx, str.udp:
cmp edi, 1
je 0x40dfb2
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 0x40df82
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 0x40dea0
mov eax, esi
call dbg._fh_to_int
mov edx, 0x41e6cd
dec edi
je 0x40dfd7
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 0x40df69
push eax
push eax
push 4
push ebx
call sub.WS2_32.DLL_listen
pop edx
test eax, eax
pop ecx
mov edx, 0x41e6b3
jns 0x40df3e
mov eax, esi
call dbg._fh_close
or eax, 0xffffffff
jmp 0x40df70
mov edx, 0x41e6d1
jmp 0x40df91
Function at 0x40dfe0
Capabilities:
Create udp socket
Set socket configuration

Disassembly:
push ebp
mov eax, 0x41ea24
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
call dbg._fh_alloc
mov ebx, eax
test eax, eax
jne 0x40e004
or eax, 0xffffffff
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [0x433f38]
test eax, eax
je 0x40e0ec
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 0x40dff9
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 0x40e142
mov edx, str.udp:
cmp dword [ebp + 0xc], 1
je 0x40e129
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 0x40e0f6
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 0x40e011
mov eax, ebx
call dbg._fh_to_int
mov edx, 0x41e6cd
cmp dword [ebp + 0xc], 1
je 0x40e151
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 0x40e0dd
push eax
push eax
push 4
push esi
call sub.WS2_32.DLL_listen
mov edx, 0x41e6b3
pop esi
test eax, eax
pop edi
jns 0x40e0b2
mov eax, ebx
call dbg._fh_close
or eax, 0xffffffff
jmp 0x40dffc
mov edx, 0x41e6d1
jmp 0x40e108
Function at 0x40e170
Capabilities:
Connect socket
Resolve dns

Disassembly:
push ebp
mov eax, 0x41ea24
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 0x40e278
mov edx, dword [0x433f38]
test edx, edx
je 0x40e280
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 0x40e2d4
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 0x40e2d4
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 0x40e2d4
mov eax, str.udp:
cmp edi, 1
je 0x40e2c3
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 0x40e290
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 0x40e1a1
mov eax, esi
call dbg._fh_to_int
mov edx, 0x41e6cd
dec edi
je 0x40e2cd
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 0x40e271
mov eax, 0x41e6b3
jmp 0x40e246
mov edx, 0x41e6d1
jmp 0x40e29f
mov eax, esi
call dbg._fh_close
or eax, 0xffffffff
jmp 0x40e278
Function at 0x40e2e0
Capabilities:
Connect socket
Connect udp socket
Create udp socket

Disassembly:
push ebp
mov eax, 0x41ea24
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 0x40e3c0
mov eax, dword [0x433f38]
test eax, eax
je 0x40e3c8
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 0x40e40e
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 0x40e43d
mov eax, str.udp:
cmp esi, 1
je 0x40e400
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 0x40e3d2
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 0x40e313
mov eax, ebx
call dbg._fh_to_int
mov edx, 0x41e6cd
dec esi
je 0x40e407
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 0x40e3b9
mov eax, 0x41e6b3
jmp 0x40e391
mov edx, 0x41e6d1
jmp 0x40e3e1
cmp byte [0x434b38], 0
js 0x40e423
mov eax, ebx
call dbg._fh_close
or eax, 0xffffffff
jmp 0x40e3c0
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 0x40e417
cmp byte [0x434b38], 0
jns 0x40e417
mov eax, 0x41e6cd
dec esi
je 0x40e457
push edi
push eax
push str.socket_loopback_client:_could_not_connect_to__s:_d_n
jmp 0x40e42a
mov eax, 0x41e6d1
jmp 0x40e44e
Function at 0x40e460
Capabilities:
Check if file exists

Disassembly:
push ebp
mov eax, 0x41ea3c
mov ebp, esp
push esi
push ebx
mov esi, dword [ebp + 8]
call dbg._fh_alloc
mov ebx, eax
test eax, eax
je 0x40e5ba
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 0x40e500
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 0x40e4d1
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 0x40e57a
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
je 0x40e557
cmp eax, 3
je 0x40e541
cmp byte [0x434b38], 0
js 0x40e5b1
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 0x40e597
call sym.__errno
mov dword [eax], 0x14
jmp 0x40e537
cmp byte [0x434b38], 0
jns 0x40e52c
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 0x40e52c
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 0x40e510
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 0x40e54a
push eax
push eax
push str.unknown_error_n
jmp 0x40e567
call sym.__errno
mov dword [eax], 0xc
jmp 0x40e537
Function at 0x40e5d0
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 0x40e690
cmp eax, 2
je 0x40e680
mov esi, 0x80000000
test eax, eax
jne 0x40e661
mov eax, 0x41ea3c
call dbg._fh_alloc
mov ebx, eax
test eax, eax
je 0x40e79b
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 0x40e6e7
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 0x40e6a0
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 0x40e6cd
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 0x40e5fa
mov esi, 0x40000000
jmp 0x40e5fa
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 0x40e66a
mov eax, ebx
call dbg._fh_close
cmp byte [0x434b38], 0
js 0x40e764
call sub.KERNEL32.dll_GetLastError
cmp eax, 2
je 0x40e752
cmp eax, 3
je 0x40e739
cmp byte [0x434b38], 0
js 0x40e71f
call sym.__errno
mov dword [eax], 2
jmp 0x40e675
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 0x40e70f
cmp byte [0x434b38], 0
js 0x40e781
call sym.__errno
mov dword [eax], 0x14
jmp 0x40e675
cmp byte [0x434b38], 0
jns 0x40e70f
push edi
push edi
push str.file_not_found_n
jmp 0x40e726
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 0x40e6f7
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 0x40e742
call sym.__errno
mov dword [eax], 0xc
jmp 0x40e675

Function at 0x40e7b0
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 0x40e7f1
cmp ebx, dword [ebp - 0xc]
ja 0x40e7e8
mov eax, dword [ebp - 0xc]
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret
mov dword [esi + 8], 1
jmp 0x40e7de
cmp byte [0x434b38], 0
js 0x40e80a
call sym.__errno
mov dword [eax], 5
or eax, 0xffffffff
jmp 0x40e7e1
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 0x40e7fa
Function at 0x40e830
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 0x40e871
cmp ebx, dword [ebp - 0xc]
ja 0x40e868
mov eax, dword [ebp - 0xc]
lea esp, [ebp - 8]
pop ebx
pop esi
pop ebp
ret
mov dword [esi + 8], 1
jmp 0x40e85e
cmp byte [0x434b38], 0
js 0x40e88a
call sym.__errno
mov dword [eax], 5
or eax, 0xffffffff
jmp 0x40e861
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 0x40e87a

Function at 0x40e930
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 0x40e982
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 0x40e990
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 0x40e9dd
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 0x40e9c2
cmp ebx, dword [ebp - 0x10]
je 0x40e96f
cmp byte [0x434b38], 0
js 0x40e9ea
sub esp, 0xc
xor ebx, ebx
push edi
call sym._free
xor edi, edi
add esp, 0x10
jmp 0x40e96f
cmp byte [0x434b38], 0
js 0x40ea07
xor ebx, ebx
jmp 0x40e96f
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 0x40e9cb
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 0x40e96f

Function at 0x40ea60
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 0x40eadb
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 0x41ea6c
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 0x40ea95
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
Function at 0x4137c0
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 0x41397e
cmp byte [ebx], 0
je 0x413940
sub esp, 0xc
push ebx
call sub.KERNEL32.dll_GetFileAttributesA
add esp, 0xc
cmp eax, 0xffffffff
je 0x41396c
test al, 0x10
je 0x413940
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 0x41381e
test edx, 0x8080
je 0x413932
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 0x41395a
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 0x4138e4
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 0x41387f
push eax
push eax
push 0x5c
push esi
call sym._strrchr
add esp, 0x10
cmp edi, eax
je 0x41387f
sub esp, 0xc
push esi
call sym._strlen
add esp, 0x10
mov word [eax + esi], 0x5c
jmp 0x41387f
shr edx, 0x10
add ecx, 2
jmp 0x413842
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 0x4138d7
call sym.__errno
xor ebp, ebp
mov dword [eax], 2
jmp 0x4138d7
call sym.__errno
xor ebp, ebp
mov dword [eax], 0xe
jmp 0x4138d7