joyce8/EMBER2024-capa huggingface dataset:
Function at 0x5efb65
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
push edi
call fcn.005db70e
xor ebx, ebx
cmp dword [0x68bfe8], ebx
mov dword [ebp - 8], eax
mov dword [ebp - 4], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x10], ebx
jne 0x5efc3b
push str.USER32.DLL
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov edi, eax
cmp edi, ebx
je 0x5efd1b
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x623640
push edi
call esi
cmp eax, ebx
je 0x5efd1b
push eax
call fcn.005db6a0
mov dword [esp], 0x623630
push edi
mov dword [0x68bfe8], eax
call esi
push eax
call fcn.005db6a0
mov dword [esp], 0x62361c
push edi
mov dword [0x68bfec], eax
call esi
push eax
call fcn.005db6a0
mov dword [0x68bff0], eax
lea eax, [ebp - 0xc]
push eax
call fcn.005cebc3
test eax, eax
pop ecx
pop ecx
je 0x5efc09
push ebx
push ebx
push ebx
push ebx
push ebx
call fcn.005d1dae
add esp, 0x14
cmp dword [ebp - 0xc], 2
jne 0x5efc3b
push str.GetUserObjectInformationA
push edi
call esi
push eax
call fcn.005db6a0
cmp eax, ebx
pop ecx
mov dword [0x68bff8], eax
je 0x5efc3b
push str.GetProcessWindowStation
push edi
call esi
push eax
call fcn.005db6a0
pop ecx
mov dword [0x68bff4], eax
mov eax, dword [0x68bff4]
mov ecx, dword [ebp - 8]
cmp eax, ecx
je 0x5efcc0
cmp dword [0x68bff8], ecx
je 0x5efcc0
push eax
call fcn.005db717
push dword [0x68bff8]
mov esi, eax
call fcn.005db717
cmp esi, ebx
pop ecx
pop ecx
mov edi, eax
je 0x5efcc0
cmp edi, ebx
je 0x5efcc0
call esi
cmp eax, ebx
je 0x5efc8d
lea ecx, [ebp - 0x14]
push ecx
push 0xc
lea ecx, [ebp - 0x20]
push ecx
push 1
push eax
call edi
test eax, eax
je 0x5efc8d
test byte [ebp - 0x18], 1
jne 0x5efcc0
lea eax, [ebp - 0x10]
push eax
call fcn.005cec72
test eax, eax
pop ecx
je 0x5efca8
push ebx
push ebx
push ebx
push ebx
push ebx
call fcn.005d1dae
add esp, 0x14
cmp dword [ebp - 0x10], 4
jb 0x5efcb7
or dword [ebp + 0x10], 0x200000
jmp 0x5efcfb
or dword [ebp + 0x10], 0x40000
jmp 0x5efcfb
mov eax, dword [0x68bfec]
cmp eax, dword [ebp - 8]
je 0x5efcfb
push eax
call fcn.005db717
cmp eax, ebx
pop ecx
je 0x5efcfb
call eax
cmp eax, ebx
mov dword [ebp - 4], eax
je 0x5efcfb
mov eax, dword [0x68bff0]
cmp eax, dword [ebp - 8]
je 0x5efcfb
push eax
call fcn.005db717
cmp eax, ebx
pop ecx
je 0x5efcfb
push dword [ebp - 4]
call eax
mov dword [ebp - 4], eax
push dword [0x68bfe8]
call fcn.005db717
cmp eax, ebx
pop ecx
je 0x5efd1b
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp - 4]
call eax
jmp 0x5efd1d
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
Function at 0x6028d7
Capabilities:
Check os version

Disassembly:
push ebp
lea ebp, [esp - 0x78]
sub esp, 0x98
mov eax, dword [0x67f864]
xor eax, ebp
mov dword [ebp + 0x74], eax
push esi
mov esi, ecx
call fcn.00602736
mov eax, 0x400000
push 0x94
mov dword [esi + 8], eax
mov dword [esi + 4], eax
lea eax, [ebp - 0x20]
push 0
push eax
mov dword [esi], 0x3c
mov byte [esi + 0xc], 0
call fcn.005d5de0
add esp, 0xc
lea eax, [ebp - 0x20]
push eax
mov dword [ebp - 0x20], 0x94
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
cmp dword [ebp - 0x10], 2
jne 0x602926
cmp dword [ebp - 0x1c], 5
jb 0x60293e
jmp 0x60293a
cmp dword [ebp - 0x10], 1
jne 0x60293e
cmp dword [ebp - 0x1c], 4
ja 0x60293a
jne 0x60293e
cmp dword [ebp - 0x18], 0
jbe 0x60293e
mov byte [esi + 0xc], 1
lea ecx, [esi + 0x18]
mov dword [esi + 0x10], 0x800
mov dword [esi + 0x14], 0x628fe8
call fcn.006024f3
test eax, eax
jge 0x60295f
mov byte [0x693104], 1
mov ecx, dword [ebp + 0x74]
mov eax, esi
xor ecx, ebp
pop esi
call fcn.005ce60a
add ebp, 0x78
leave
ret
Function at 0x401660
Capabilities:
Check os version

Disassembly:
mov ecx, 1
mov edx, 0x834348
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
jne 0x401789
cmp dword fs:[0xc0], eax
je 0x40168b
mov dword [0x834344], 1
mov eax, dword fs:[0x18]
push ebx
push esi
mov ebx, 1
mov esi, dword [eax + 0x30]
mov eax, dword [esi + 0xa4]
mov dword [0x83422c], eax
mov eax, dword [esi + 0xa8]
mov dword [0x834230], eax
movzx edx, word [esi + 0xac]
mov dword [0x834234], edx
mov eax, dword [esi + 0xb0]
mov dword [0x834238], eax
mov eax, dword [esi + 0x1f4]
test eax, eax
je 0x4016eb
push 0x7f
push eax
push 0x83423c
call fcn.00403b50
mov edx, dword [0x834234]
add esp, 0xc
jmp 0x4016f3
xor eax, eax
mov word [0x83423c], ax
movzx eax, byte [esi + 0xaf]
mov ecx, 0xff
mov word [0x83433c], ax
movzx eax, word [esi + 0xae]
and ax, cx
mov word [0x83433e], ax
movzx eax, word [0x7ffe02d0]
mov word [0x834340], ax
mov ecx, eax
mov byte [0x834342], 0
cmp byte [0x7ffe0268], 0
je 0x40173a
mov ebx, dword [0x7ffe0264]
pop esi
mov byte [0x834342], bl
cmp ebx, 1
pop ebx
jne 0x401754
and ecx, 0xffef
mov word [0x834340], cx
test edx, edx
jne 0x401789
call fcn.00401660
cmp dword [0x83422c], 6
ja 0x401789
jb 0x401771
cmp dword [0x834230], 4
jae 0x401789
call fcn.00401660
cmp dword [0x83422c], 0xa
jae 0x401789
mov dword [0x834234], 1
ret
Function at 0x402840
Capabilities:
Encode data using xor
Encrypt data using rc4 prga

Disassembly:
mov eax, dword [0x8352a8]
sub esp, 0x11c
test eax, eax
jne 0x40293e
push ebx
push esi
push edi
push 0x100
push eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov word [esp + 0x2c], ax
lea eax, [esp + 0x30]
push eax
call fcn.00401940
add esp, 0xc
xor edi, edi
xor eax, eax
lea ebx, [ebx]
mov byte [esp + eax + 0x28], al
inc eax
cmp eax, 0x100
jb 0x402890
xor esi, esi
mov edi, edi
mov dl, byte [esp + esi + 0x28]
mov eax, esi
and eax, 3
movzx ecx, dl
movzx eax, byte [eax + 0x41d100]
add eax, edi
add ecx, eax
movzx edi, cl
mov al, byte [esp + edi + 0x28]
mov byte [esp + esi + 0x28], al
inc esi
mov byte [esp + edi + 0x28], dl
cmp esi, 0x100
jb 0x4028a0
xor edi, edi
xor ebx, ebx
xor esi, esi
lea eax, [edi + 1]
movzx edi, al
mov cl, byte [esp + edi + 0x28]
movzx edx, cl
lea eax, [edx + ebx]
movzx ebx, al
movzx eax, byte [esp + ebx + 0x28]
mov byte [esp + edi + 0x28], al
mov byte [esp + ebx + 0x28], cl
movzx eax, byte [esp + edi + 0x28]
add eax, edx
movzx eax, al
movzx eax, byte [esp + eax + 0x28]
xor al, byte [esi + 0x41d104]
mov byte [esp + esi + 0xc], al
inc esi
cmp esi, 0x1a
jb 0x4028d5
xor edx, edx
lea ecx, [esp + 0xc]
call fcn.00404070
pop edi
pop esi
pop ebx
test eax, eax
je 0x402939
mov eax, dword [eax + 0x18]
test eax, eax
je 0x402939
mov dword [0x8352a8], eax
add esp, 0x11c
ret
mov eax, dword [0x8352a8]
add esp, 0x11c
ret
Function at 0x4036f0
Capabilities:
64-bit execution via heavens gate

Disassembly:
push ebp
mov ebp, esp
mov ecx, dword [ebp + 0xc]
lea edx, [ebp + 0x10]
sub esp, 0x40
push ebx
push esi
push edi
test ecx, ecx
jle 0x403718
mov eax, dword [ebp + 0x10]
lea edx, [ebp + 0x18]
dec ecx
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp + 0xc], ecx
mov dword [ebp - 0xc], eax
jmp 0x403726
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0
test ecx, ecx
jle 0x40373f
dec ecx
add edx, 8
mov dword [ebp + 0xc], ecx
mov eax, dword [edx - 8]
mov dword [ebp - 0x18], eax
mov eax, dword [edx - 4]
mov dword [ebp - 0x14], eax
jmp 0x40374d
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
test ecx, ecx
jle 0x403766
dec ecx
add edx, 8
mov dword [ebp + 0xc], ecx
mov eax, dword [edx - 8]
mov dword [ebp - 0x20], eax
mov eax, dword [edx - 4]
mov dword [ebp - 0x1c], eax
jmp 0x403774
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
test ecx, ecx
jle 0x40378d
dec ecx
add edx, 8
mov dword [ebp + 0xc], ecx
mov eax, dword [edx - 8]
mov dword [ebp - 0x28], eax
mov eax, dword [edx - 4]
mov dword [ebp - 0x24], eax
jmp 0x40379b
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
mov eax, edx
mov dword [ebp - 0x30], 0
cdq
mov dword [ebp - 0x40], eax
mov eax, ecx
mov dword [ebp - 0x3c], edx
cdq
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], edx
mov dword [ebp - 4], 0
mov dword [ebp - 8], 0
mov word [ebp - 8], fs
mov eax, 0x2b
mov fs, ax
mov dword [ebp - 4], esp
and esp, 0xfffffff0
push 0x33
call 0x4037e2
add dword [esp], 5
retf
Function at 0x403f20
Capabilities:
Access peb ldr_data
Get process heap flags

Disassembly:
sub esp, 0xc08
push ebx
push ebp
mov dword [esp + 0xc], edx
xor edx, edx
mov dword [esp + 8], edx
push esi
push edi
test ecx, ecx
je 0x403f6b
xor esi, esi
lea edi, [esp + 0x818]
mov al, byte [esi + ecx]
test al, al
je 0x403f5b
cbw
inc esi
mov word [edi], ax
add edi, 2
cmp esi, 0x1ff
jb 0x403f41
jmp 0x403f60
xor eax, eax
mov word [edi], ax
lea edx, [esp + 0x818]
mov dword [esp + 0x10], edx
xor edi, edi
xor ebp, ebp
test edx, edx
je 0x403fbb
mov edi, edx
lea ecx, [edi + 2]
jmp 0x403f80
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x403f80
sub edi, ecx
sar edi, 1
cmp edi, 0x200
jb 0x403f9c
mov edi, 0x1ff
push edi
push edx
lea eax, [esp + 0x420]
push eax
lea ebp, [edi + edi]
call fcn.00403b50
add esp, 0xc
xor eax, eax
mov word [esp + ebp + 0x418], ax
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov ebx, dword [eax + 0xc]
add ebx, 0xc
jne 0x403fdd
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov ebx, dword [eax + 0xc]
add ebx, 0x14
je 0x404050
mov esi, dword [ebx]
cmp esi, ebx
je 0x404050
test esi, esi
je 0x404050
cmp word [esi + 0x24], 2
jbe 0x40404a
movzx eax, word [esi + 0x2c]
cmp eax, 2
jbe 0x40404a
cmp dword [esi + 0x18], 0
je 0x40404a
test ebp, ebp
je 0x404005
cmp ebp, eax
jne 0x40404a
push edi
push dword [esi + 0x30]
lea eax, [esp + 0x20]
push eax
call fcn.00403b50
xor eax, eax
add esp, 0xc
mov word [esp + edi*2 + 0x18], ax
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40402a
cmp eax, dword [esi + 0x18]
jne 0x40404a
cmp dword [esp + 0x10], 0
je 0x40405d
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x41c]
push eax
call fcn.00401470
add esp, 8
test eax, eax
je 0x40405d
mov esi, dword [esi]
cmp esi, ebx
jne 0x403fe3
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xc08
ret
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0xc08
ret
Function at 0x404070
Capabilities:
Access peb ldr_data
Get process heap flags

Disassembly:
sub esp, 0x808
push ebx
push ebp
push esi
push edi
xor edi, edi
mov dword [esp + 0x10], edx
xor ebp, ebp
mov dword [esp + 0x14], ecx
test ecx, ecx
je 0x4040cb
mov edi, ecx
lea edx, [edi + 2]
nop
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x404090
sub edi, edx
sar edi, 1
cmp edi, 0x200
jb 0x4040ac
mov edi, 0x1ff
push edi
push ecx
lea eax, [esp + 0x420]
push eax
lea ebp, [edi + edi]
call fcn.00403b50
add esp, 0xc
xor eax, eax
mov word [esp + ebp + 0x418], ax
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov ebx, dword [eax + 0xc]
add ebx, 0xc
jne 0x4040ed
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov ebx, dword [eax + 0xc]
add ebx, 0x14
je 0x40415f
mov esi, dword [ebx]
cmp esi, ebx
je 0x40415f
test esi, esi
je 0x40415f
cmp word [esi + 0x24], 2
jbe 0x404159
movzx eax, word [esi + 0x2c]
cmp eax, 2
jbe 0x404159
cmp dword [esi + 0x18], 0
je 0x404159
test ebp, ebp
je 0x404115
cmp ebp, eax
jne 0x404159
push edi
push dword [esi + 0x30]
lea eax, [esp + 0x20]
push eax
call fcn.00403b50
mov edx, dword [esp + 0x1c]
xor eax, eax
add esp, 0xc
mov word [esp + edi*2 + 0x18], ax
test edx, edx
je 0x40413a
cmp edx, dword [esi + 0x18]
jne 0x404159
cmp dword [esp + 0x14], eax
je 0x40416c
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x41c]
push eax
call fcn.00401470
add esp, 8
test eax, eax
je 0x40416c
mov esi, dword [esi]
cmp esi, ebx
jne 0x4040f3
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x808
ret
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x808
ret
Function at 0x404270
Capabilities:
Encode data using xor
Encrypt data using rc4 prga
Get windows directory from kuser_shared_data

Disassembly:
mov eax, dword [0x834208]
sub esp, 0x20c
push ebp
mov ebp, ecx
push esi
push edi
test eax, eax
je 0x40441d
cmp dword [0x83420c], 0
jne 0x404409
xor eax, eax
push 0x100
push eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov word [esp + 0x1c], ax
mov byte [esp + 0x1e], al
lea eax, [esp + 0x20]
push eax
call fcn.00401940
add esp, 0xc
xor edi, edi
xor eax, eax
nop
mov byte [esp + eax + 0x18], al
inc eax
cmp eax, 0x100
jb 0x4042c0
xor esi, esi
mov edi, edi
mov dl, byte [esp + esi + 0x18]
mov eax, esi
and eax, 3
movzx ecx, dl
movzx eax, byte [eax + 0x41d0d4]
add eax, edi
add ecx, eax
movzx edi, cl
mov al, byte [esp + edi + 0x18]
mov byte [esp + esi + 0x18], al
inc esi
mov byte [esp + edi + 0x18], dl
cmp esi, 0x100
jb 0x4042d0
xor esi, esi
xor edi, edi
xor edx, edx
lea eax, [esi + 1]
movzx esi, al
mov cl, byte [esp + esi + 0x18]
movzx eax, cl
add eax, edi
movzx edi, al
movzx eax, byte [esp + edi + 0x18]
mov byte [esp + esi + 0x18], al
mov byte [esp + edi + 0x18], cl
movzx eax, byte [esp + esi + 0x18]
movzx ecx, cl
add ecx, eax
movzx eax, cl
movzx eax, byte [esp + eax + 0x18]
xor al, byte [edx + 0x41d0d8]
mov byte [esp + edx + 0xc], al
inc edx
cmp edx, 0xb
jb 0x404305
push 0x200
lea eax, [esp + 0x1c]
push 0
push eax
call fcn.00401940
mov edx, 0x7ffe0030
add esp, 0xc
xor ecx, ecx
lea esi, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x404364
sub edx, esi
sar edx, 1
je 0x40441d
mov esi, ebp
lea edi, [esi + 1]
mov edi, edi
mov al, byte [esi]
inc esi
test al, al
jne 0x404380
sub esi, edi
add edx, 0xc
add edx, esi
cmp edx, 0x200
ja 0x40441d
xor eax, eax
push ebx
test edx, edx
je 0x4043b8
movzx ebx, word [eax + eax + 0x7ffe0030]
test bx, bx
je 0x4043b8
mov byte [esp + eax + 0x1c], bl
inc ecx
inc eax
cmp eax, edx
jb 0x4043a1
xor eax, eax
test edx, edx
je 0x4043d2
mov edi, edi
mov bl, byte [esp + eax + 0x10]
test bl, bl
je 0x4043d2
mov byte [esp + ecx + 0x1c], bl
inc eax
inc ecx
cmp eax, edx
jb 0x4043c0
xor eax, eax
test edx, edx
je 0x4043ef
lea ecx, [esp + ecx + 0x1c]
lea esp, [esp]
mov bl, byte [eax + ebp]
test bl, bl
je 0x4043ef
mov byte [ecx], bl
inc eax
inc ecx
cmp eax, edx
jb 0x4043e0
push 8
push 0
lea eax, [esp + 0x24]
push eax
call dword [0x834208]
pop ebx
pop edi
pop esi
pop ebp
add esp, 0x20c
ret
push 0x800
push 0
push ebp
call eax
pop edi
pop esi
pop ebp
add esp, 0x20c
ret
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x20c
ret

Function at 0x41c852
Capabilities:
Execute syscall

Disassembly:
mov edx, esp
sysenter
ret
Function at 0x403535
Capabilities:
Terminate process

Disassembly:
jmp 0x453ab4
push 0x17
call dword [sym.imp.KERNEL32.dll_IsProcessorFeaturePresent]
test eax, eax
je 0x453ac5
push 5
pop ecx
int 0x29
push esi
push 1
mov esi, 0xc0000417
push esi
push 2
call fcn.00405790
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
pop esi
ret

Function at 0x40364d
Capabilities:
Query environment variable

Disassembly:
jmp 0x49c561
mov edi, edi
push esi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
mov esi, eax
test esi, esi
jne 0x49c572
pop esi
ret
push ebx
push edi
push esi
call fcn.0049c448
mov ebx, eax
sub ebx, esi
and ebx, 0xfffffffe
push ebx
call fcn.00403ee5
mov edi, eax
pop ecx
pop ecx
test edi, edi
je 0x49c59a
push ebx
push esi
push edi
call fcn.00405588
add esp, 0xc
push 0
call fcn.00406096
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, edi
pop edi
pop ebx
pop esi
ret

Function at 0x405646
Capabilities:
Parse pe header

Disassembly:
jmp 0x442bbb
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test eax, eax
je 0x442bfa
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x442bfa
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x442bfa
mov eax, 0x10b
cmp word [ecx + 0x18], ax
jne 0x442bfa
cmp dword [ecx + 0x74], 0xe
jbe 0x442bfa
cmp dword [ecx + 0xe8], 0
setne al
ret
xor al, al
ret

Function at 0x440a5c
Capabilities:
Get geographical location

Disassembly:
push ebp
mov ebp, esp
push ecx
and dword [ebp - 4], 0
call fcn.004036ac
push 2
lea ecx, [ebp - 4]
push ecx
mov eax, dword [eax + 0x14]
push 0x22
push eax
call dword [sym.imp.KERNEL32.dll_GetLocaleInfoEx]
movzx eax, word [ebp - 4]
sub eax, 0x30
je 0x440a9b
sub eax, 1
je 0x440a96
sub eax, 1
je 0x440a92
xor eax, eax
leave
ret
push 3
jmp 0x440a9d
xor eax, eax
inc eax
leave
ret
push 2
pop eax
leave
ret

Function at 0x487335
Capabilities:
Parse pe header

Disassembly:
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test eax, eax
je 0x487374
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x487374
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x487374
mov eax, 0x10b
cmp word [ecx + 0x18], ax
jne 0x487374
cmp dword [ecx + 0x74], 0xe
jbe 0x487374
cmp dword [ecx + 0xe8], 0
setne al
ret
xor al, al
ret
Function at 0x496306
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x101c
call fcn.00401d52
mov eax, dword [0x4cc040]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
push ebx
push dword [ebp + 8]
mov dword [ebp - 0x100c], eax
call fcn.00405cbd
pop ecx
mov ecx, dword [ebp + 8]
mov ebx, eax
cmp dword [ecx + 8], 0
jne 0x496348
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
jmp 0x4964a4
mov eax, dword [ecx]
sub eax, dword [ecx + 4]
push esi
push edi
push 0
cdq
push 2
push edx
push eax
call fcn.00405e07
push dword [ebp - 0x100c]
mov ecx, ebx
mov dword [ebp - 0x1008], eax
mov esi, ebx
mov dword [ebp - 0x1018], edx
and ecx, 0x3f
sar esi, 6
imul edi, ecx, 0x38
push 0
mov eax, dword [esi*4 + 0x4cf858]
push dword [eax + edi + 0x24]
push dword [eax + edi + 0x20]
push ebx
call fcn.004031e3
mov ecx, dword [esi*4 + 0x4cf858]
add esp, 0x14
mov dword [ebp - 0x1010], eax
mov eax, edx
mov edx, dword [ebp - 0x1010]
mov dword [ebp - 0x101c], eax
cmp edx, dword [ecx + edi + 0x20]
jne 0x49649d
cmp eax, dword [ecx + edi + 0x24]
jne 0x49649d
push 0
lea eax, [ebp - 0x1014]
push eax
push 0x1000
lea eax, [ebp - 0x1004]
push eax
push dword [ecx + edi + 0x18]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x49649d
push dword [ebp - 0x100c]
push 0
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push ebx
call fcn.004031e3
add esp, 0x14
test edx, edx
jl 0x49649d
jg 0x496413
test eax, eax
jb 0x49649d
mov ebx, dword [ebp - 0x1018]
mov eax, dword [ebp - 0x1014]
test ebx, ebx
jg 0x49649d
jl 0x49642d
cmp dword [ebp - 0x1008], eax
ja 0x49649d
lea edi, [ebp - 0x1004]
xor edx, edx
add edi, eax
lea ecx, [ebp - 0x1004]
xor esi, esi
cmp dword [ebp - 0x1008], edx
jne 0x49644b
test ebx, ebx
je 0x496484
cmp ecx, edi
jae 0x496484
mov al, byte [ecx]
cmp al, 0xd
jne 0x496465
lea eax, [edi - 1]
cmp ecx, eax
jae 0x496471
cmp byte [ecx + 1], 0xa
jne 0x496471
inc ecx
jmp 0x496471
movzx eax, al
movsx eax, byte [eax + 0x4cc3a8]
add ecx, eax
add esi, 1
adc edx, 0
inc ecx
cmp esi, dword [ebp - 0x1008]
jne 0x49644b
cmp edx, ebx
jne 0x49644b
lea eax, [ebp - 0x1004]
sub ecx, eax
mov eax, ecx
cdq
add eax, dword [ebp - 0x1010]
adc edx, dword [ebp - 0x101c]
jmp 0x4964a2
or edx, 0xffffffff
mov eax, edx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.00402fc7
leave
ret
Function at 0x496be3
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [ebp + 8]
mov ecx, eax
push ebx
mov ebx, dword [ebp + 0xc]
and eax, 0x3f
sar ecx, 6
push esi
push edi
imul edi, eax, 0x38
mov eax, dword [ecx*4 + 0x4cf858]
mov dword [ebp - 0xc], ecx
mov ecx, dword [edi + eax + 0x18]
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x496c23
cmp byte [ebx], 0xa
jne 0x496c23
or byte [edi + eax + 0x28], 4
jmp 0x496c28
and byte [edi + eax + 0x28], 0xfb
add ecx, ebx
mov eax, ebx
mov dword [ebp - 0x10], ecx
mov esi, ebx
mov dword [ebp - 8], eax
cmp ebx, ecx
jae 0x496d27
mov dl, byte [eax]
cmp dl, 0x1a
je 0x496d0a
inc eax
cmp dl, 0xd
je 0x496c54
mov dword [ebp - 8], eax
mov byte [esi], dl
jmp 0x496c7a
cmp eax, ecx
jae 0x496c88
mov cl, byte [eax]
xor eax, eax
cmp cl, 0xa
sete al
inc eax
add dword [ebp - 8], eax
cmp cl, 0xa
sete al
dec al
and al, 3
add al, 0xa
mov byte [esi], al
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x10]
xor edx, edx
inc edx
add esi, edx
cmp eax, ecx
jb 0x496c3c
jmp 0x496d27
push 0
lea eax, [ebp - 0x10]
push eax
push 1
lea eax, [ebp - 1]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x496d05
cmp dword [ebp - 0x10], 0
je 0x496d05
mov ecx, dword [ebp - 0xc]
mov eax, dword [ecx*4 + 0x4cf858]
test byte [eax + edi + 0x28], 0x48
je 0x496cdf
mov dl, byte [ebp - 1]
lea eax, [esi + 1]
mov dword [ebp - 0x14], eax
cmp dl, 0xa
jne 0x496cca
mov byte [esi], dl
jmp 0x496cdb
mov byte [esi], 0xd
mov eax, dword [ecx*4 + 0x4cf858]
mov byte [eax + edi + 0x2a], dl
mov eax, dword [ebp - 0x14]
mov esi, eax
jmp 0x496d27
cmp byte [ebp - 1], 0xa
jne 0x496cee
cmp esi, ebx
jne 0x496cee
mov byte [esi], 0xa
jmp 0x496d26
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.004018fc
add esp, 0x10
cmp byte [ebp - 1], 0xa
je 0x496d27
mov byte [esi], 0xd
jmp 0x496d26
mov ecx, dword [ebp - 0xc]
mov ecx, dword [ecx*4 + 0x4cf858]
mov al, byte [ecx + edi + 0x28]
test al, 0x40
jne 0x496d24
or al, 2
mov byte [ecx + edi + 0x28], al
jmp 0x496d27
mov byte [esi], dl
inc esi
sub esi, ebx
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret
Function at 0x496d83
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [ebp + 8]
mov ecx, eax
push ebx
mov ebx, dword [ebp + 0xc]
and eax, 0x3f
push esi
sar ecx, 6
push edi
imul edi, eax, 0x38
mov dword [ebp - 8], ecx
mov eax, dword [ecx*4 + 0x4cf858]
push 0xa
pop edx
mov dword [ebp - 0x18], edx
mov ecx, dword [eax + edi + 0x18]
mov dword [ebp - 0x1c], ecx
mov ecx, dword [ebp + 0x10]
test ecx, ecx
je 0x496dc9
cmp word [ebx], dx
jne 0x496dc9
or byte [eax + edi + 0x28], 4
jmp 0x496dce
and byte [eax + edi + 0x28], 0xfb
lea edx, [ebx + ecx*2]
mov eax, ebx
mov dword [ebp - 0xc], edx
mov esi, ebx
mov dword [ebp - 4], eax
cmp ebx, edx
jae 0x496f31
mov dword [ebp - 0x10], 0xd
movzx ecx, word [eax]
mov edx, ecx
mov dword [ebp - 0x14], edx
mov edx, dword [ebp - 0xc]
cmp ecx, 0x1a
je 0x496f11
add eax, 2
cmp cx, word [ebp - 0x10]
je 0x496e0f
mov dword [ebp - 4], eax
mov word [esi], cx
jmp 0x496e45
cmp eax, edx
jae 0x496e53
movzx eax, word [eax]
xor ecx, ecx
cmp ax, word [ebp - 0x18]
mov edx, eax
push 0xa
sete cl
xor eax, eax
lea ecx, [ecx*2 + 2]
add dword [ebp - 4], ecx
pop ecx
cmp dx, cx
mov edx, dword [ebp - 0xc]
sete al
dec eax
and eax, 3
add eax, ecx
mov word [esi], ax
mov eax, dword [ebp - 4]
push 2
pop ecx
add esi, ecx
cmp eax, edx
jb 0x496dea
jmp 0x496f31
push 0
lea eax, [ebp - 0x18]
push eax
push 2
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x496f0c
cmp dword [ebp - 0x18], 0
je 0x496f0c
mov edx, dword [ebp - 8]
push 0xa
mov eax, dword [edx*4 + 0x4cf858]
test byte [eax + edi + 0x28], 0x48
je 0x496ee2
lea eax, [esi + 2]
mov dword [ebp - 0x1c], eax
mov ax, word [ebp - 4]
pop ecx
mov word [ebp - 2], ax
cmp ax, cx
jne 0x496ea6
mov word [esi], cx
jmp 0x496edd
push 0xd
pop ecx
mov word [esi], cx
movzx ecx, ax
mov eax, dword [edx*4 + 0x4cf858]
mov dx, word [ebp - 2]
shr ecx, 8
push 0xa
mov byte [eax + edi + 0x2a], dl
mov edx, dword [ebp - 8]
mov eax, dword [edx*4 + 0x4cf858]
mov byte [eax + edi + 0x2b], cl
mov eax, dword [edx*4 + 0x4cf858]
pop ecx
mov byte [eax + edi + 0x2c], cl
mov esi, dword [ebp - 0x1c]
jmp 0x496f31
pop eax
cmp word [ebp - 4], ax
jne 0x496ef2
cmp esi, ebx
jne 0x496ef2
mov word [esi], ax
jmp 0x496f2e
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
push dword [ebp + 8]
call fcn.004018fc
add esp, 0x10
push 0xa
pop eax
cmp word [ebp - 4], ax
je 0x496f31
push 0xd
pop eax
jmp 0x496eed
mov edx, dword [ebp - 8]
mov edx, dword [edx*4 + 0x4cf858]
mov al, byte [edx + edi + 0x28]
test al, 0x40
jne 0x496f2b
or al, 2
mov byte [edx + edi + 0x28], al
jmp 0x496f31
mov word [esi], cx
add esi, 2
sub esi, ebx
and esi, 0xfffffffe
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret