joyce8/EMBER2024-capa huggingface dataset:
Function at 0x40124e
Capabilities:
Set registry value

Disassembly:
push ebp
mov ebp, esp
push ecx
push ecx
push ebx
push esi
xor ebx, ebx
lea eax, [ebp - 4]
push ebx
push eax
push ebx
push 0x20006
push ebx
push ebx
push ebx
push str.SoftwareMicrosoftOfficeExcelAddinsMsoTDAddin.Connect.1
push 0x80000001
mov dword [ebp - 8], ebx
mov esi, ebx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
je 0x401291
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
jmp 0x40136d
xor eax, eax
cmp dword [ebp + 8], eax
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
setne al
add eax, 2
push 4
mov dword [ebp + 8], eax
lea eax, [ebp + 8]
push eax
push 4
push ebx
push str.LoadBehavior
push dword [ebp - 4]
call edi
test eax, eax
je 0x4012d3
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x401363
mov edx, dword [ebp + 0xc]
test edx, edx
je 0x401319
mov ecx, edx
lea ebx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 8]
jne 0x4012df
sub ecx, ebx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
push edx
push 1
xor eax, eax
push eax
push str.FriendlyName
push dword [ebp - 4]
call edi
test eax, eax
je 0x401319
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test esi, esi
js 0x401363
mov edx, dword [ebp + 0x10]
test edx, edx
je 0x401363
mov ecx, edx
lea ebx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 8]
jne 0x401329
sub ecx, ebx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
push edx
push 1
xor eax, eax
push eax
push str.Description
push dword [ebp - 4]
call edi
test eax, eax
je 0x401363
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc

Function at 0x4013f0
Capabilities:
Allocate or change rwx memory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
xor eax, eax
push ebx
mov ebx, 0xbb40e64e
cmp dword [0x403790], eax
je 0x401412
cmp dword [0x403790], ebx
jne 0x4014a6
push edi
push eax
push eax
push 1
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapSetInformation]
lea eax, [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemTimeAsFileTime]
mov edi, dword [ebp - 8]
xor edi, dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
xor edi, eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
xor edi, eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
xor edi, eax
lea eax, [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov eax, dword [ebp - 0x10]
xor eax, dword [ebp - 0x14]
xor edi, eax
lea eax, [ebp - 4]
push eax
push 0x40
push 4
push 0x403790
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
lea eax, [ebp - 4]
test edi, edi
push eax
push dword [ebp - 4]
cmovne ebx, edi
mov edi, 0x403790
push 4
push edi
mov dword [0x403790], ebx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
push 4
push edi
call sub.KERNEL32.dll_WerRegisterMemoryBlock
mov eax, dword [0x403790]
not eax
mov dword [0x405070], eax
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x4016d6
Capabilities:
Terminate process

Disassembly:
push 0x14
push 0x403d98
call fcn.00401d13
push 1
call fcn.00401876
pop ecx
test al, al
jne 0x40157f
push 7
call fcn.00401ade
xor bl, bl
mov byte [ebp - 0x19], bl
and dword [ebp - 4], 0
call fcn.00401841
mov byte [ebp - 0x24], al
mov eax, dword [0x405404]
xor ecx, ecx
inc ecx
cmp eax, ecx
je 0x401578
test eax, eax
jne 0x4015e9
mov dword [0x405404], ecx
push 0x403148
push 0x403134
call sub.api_ms_win_crt_runtime_l1_1_0.dll__initterm_e
pop ecx
pop ecx
test eax, eax
je 0x4015cc
mov dword [ebp - 4], 0xfffffffe
mov eax, 0xff
jmp 0x4016d0
push 0x403130
push 0x403128
call sub.api_ms_win_crt_runtime_l1_1_0.dll__initterm
pop ecx
pop ecx
mov dword [0x405404], 2
jmp 0x4015ee
mov bl, cl
mov byte [ebp - 0x19], bl
push dword [ebp - 0x24]
call fcn.004019d3
pop ecx
call fcn.00401ad2
mov esi, eax
xor edi, edi
cmp dword [esi], edi
je 0x40161e
push esi
call fcn.00401946
pop ecx
test al, al
je 0x40161e
push edi
push 2
push edi
mov esi, dword [esi]
mov ecx, esi
call fcn.00401d0d
call esi
call fcn.00401ad8
mov esi, eax
cmp dword [esi], edi
je 0x40163c
push esi
call fcn.00401946
pop ecx
test al, al
je 0x40163c
push dword [esi]
call sub.api_ms_win_crt_runtime_l1_1_0.dll__register_thread_local_exe_atexit_callback
pop ecx
push edi
call sub.VCRUNTIME140.dll___telemetry_main_invoke_trigger
pop ecx
call fcn.00401bf3
movzx eax, ax
push eax
call sub.api_ms_win_crt_runtime_l1_1_0.dll__get_narrow_winmain_command_line
push eax
push edi
push 0x400000
call main
mov esi, eax
push edi
call sub.VCRUNTIME140.dll___telemetry_main_return_trigger
pop ecx
call fcn.00401c26
test al, al
jne 0x401675
push esi
call sub.api_ms_win_crt_runtime_l1_1_0.dll_exit
test bl, bl
jne 0x40167e
call sub.api_ms_win_crt_runtime_l1_1_0.dll__cexit
push edi
push 1
call fcn.004019f0
pop ecx
pop ecx
mov dword [ebp - 4], 0xfffffffe
mov eax, esi
jmp 0x4016d0
call fcn.00401d59
ret
call fcn.004013f0
jmp 0x401560

Function at 0x402115
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x210
mov eax, dword [0x403790]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x210]
push edi
mov edi, dword [ebp + 0xc]
push eax
lea eax, [ebp - 0x20c]
mov dword [ebp - 0x210], 0x208
push eax
push 0
push 2
push esi
push str.SoftwareMicrosoftOffice16.0CommonFilesPaths
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegGetValueW]
test eax, eax
jne 0x40217e
cmp dword [ebp - 0x210], 4
jb 0x40217e
test edi, edi
lea eax, [ebp - 0x20c]
cmovne esi, edi
push esi
push eax
call fcn.00402238
jmp 0x402180
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.004013e3
mov esp, ebp
pop ebp
ret 8
Function at 0x402192
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x210
mov eax, dword [0x403790]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x210]
push eax
lea eax, [ebp - 0x20c]
mov dword [ebp - 0x210], 0x208
push eax
push 0
push 2
push str.CommonFilesDir
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegGetValueW]
test eax, eax
jne 0x402225
mov ecx, dword [ebp - 0x210]
cmp ecx, 4
jb 0x402225
shr ecx, 1
push 0xffffffffffffffff
cmp word [ebp + ecx*2 - 0x210], 0x5c
sete al
lea eax, [eax*2 + str.Microsoft_SharedOffice16_]
push eax
lea eax, [ebp - 0x20c]
push 0x104
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncat_s]
add esp, 0x10
lea eax, [ebp - 0x20c]
push esi
push eax
call fcn.00402238
jmp 0x402227
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop esi
call fcn.004013e3
mov esp, ebp
pop ebp
ret 4
Function at 0x4897b0
Capabilities:
Terminate process

Disassembly:
push 0x516898
mov dword [0x516944], 0x32336c65
mov dword [0x516950], 0x6c64746e
mov dword [0x516948], 0x6c6c642e
mov dword [0x516940], 0x6e72656b
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
test eax, eax
je 0x48980b
call fcn.004ab920
mov eax, dword [0x516634]
push 5
push eax
call dword [sym.imp.USER32.dll_ShowWindow]
call dword [sym.imp.KERNEL32.dll_GetLastError]
add dword [0x516810], eax
call fcn.004677a0
push edi
mov ecx, 0x100
xor eax, eax
mov edi, 0x516a58
mov dl, 0x6c
push eax
rep stosd dword es:[edi], eax
mov dword [0x516a80], 0x20644965
push eax
mov dword [0x516954], 0x6c642e6c
mov byte [0x516958], dl
mov dword [0x516a70], 0x65746163
mov byte [0x516a7a], 0x79
mov dword [0x516a74], 0x61636f4c
mov dword [0x516a6c], 0x6f6c6c41
mov byte [0x516a7b], 0x55
mov dword [0x516a7c], 0x7571696e
mov dword [0x516abc], 0x73727473
mov byte [0x516a83], al
mov word [0x516ac0], 0x7274
mov byte [0x516a78], dl
mov byte [0x516a79], dl
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0xc]
push ecx
mov ecx, dword [esp + 0xc]
push edx
push eax
push ecx
call fcn.004ce1f0
add esp, 0x10
xor eax, eax
pop edi
ret 0x10

Function at 0x4ab920
Capabilities:
Query environment variable

Disassembly:
sub esp, 8
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentStrings]
mov dword [0x51688c], eax
mov eax, dword [esp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x5169b0]
mov edx, dword [esp + 0x10]
mov ebx, dword [esp + 0xc]
mov edi, dword [esp + 0xc]
cmp ecx, 0xbb40e64e
je 0x4ab962
test ecx, 0xffff0000
je 0x4ab962
mov eax, ecx
jmp 0x4ab984
mov eax, edi
xor eax, edx
xor eax, ebx
cmp eax, 0xbb40e64e
je 0x4ab977
test ecx, 0xffff0000
jne 0x4ab97c
mov eax, 0xbb40e64f
mov ecx, eax
mov dword [0x5169b0], ecx
not eax
cmp ecx, 0xbb40e64e
mov dword [0x5169b4], eax
je 0x4ab9ae
test ecx, 0xffff0000
je 0x4ab9ae
lea ecx, [esp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
mov esi, dword [0x5169b0]
jmp 0x4ab9e5
mov esi, edi
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
xor esi, edx
xor esi, ebx
mov ebx, 0x80
call ebp
dec ebx
jne 0x4ab9c0
cmp esi, 0xbb40e64e
pop ebp
je 0x4ab9da
test dword [0x5169b0], 0xffff0000
jne 0x4ab9df
mov esi, 0xbb40e64f
mov dword [0x5169b0], esi
cmp esi, 0xbb40e64e
je 0x4aba05
test esi, 0xffff0000
je 0x4aba05
mov eax, esi
pop edi
not eax
pop esi
mov dword [0x5169b4], eax
pop ebx
add esp, 8
ret
mov ecx, dword [esp + 0x10]
mov edx, dword [esp + 0xc]
xor edi, ecx
mov eax, ecx
xor edi, edx
xor eax, edx
mov ecx, edi
cmp ecx, 0xbb40e64e
je 0x4aba27
test esi, 0xffff0000
jne 0x4aba2c
mov ecx, 0xbb40e64f
mov dword [0x5169b0], ecx
pop edi
not ecx
pop esi
mov dword [0x5169b4], ecx
pop ebx
add esp, 8
ret
Function at 0x513145
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1a4
mov edx, dword [ebp + 8]
xor ecx, ecx
mov eax, 0x5161d0
cmp edx, dword [eax]
je 0x513167
add eax, 8
inc ecx
cmp eax, 0x516260
jl 0x513158
push esi
mov esi, ecx
shl esi, 3
cmp edx, dword [esi + 0x5161d0]
jne 0x513295
mov eax, dword [0x5172bc]
cmp eax, 1
je 0x51326f
test eax, eax
jne 0x513198
cmp dword [0x516120], 1
je 0x51326f
cmp edx, 0xfc
je 0x513295
lea eax, [ebp - 0x1a4]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x5131cf
lea eax, [ebp - 0x1a4]
push str._program_name_unknown_
push eax
call fcn.005136f0
pop ecx
pop ecx
lea eax, [ebp - 0x1a4]
push edi
push eax
lea edi, [ebp - 0x1a4]
call fcn.00513860
inc eax
pop ecx
cmp eax, 0x3c
jbe 0x513212
lea eax, [ebp - 0x1a4]
push eax
call fcn.00513860
mov edi, eax
lea eax, [ebp - 0x1a4]
sub eax, 0x3b
push 3
add edi, eax
push 0x5153d0
push edi
call fcn.005144f0
add esp, 0x10
lea eax, [ebp - 0xa0]
push str.Runtime_Error__n_nProgram:
push eax
call fcn.005136f0
lea eax, [ebp - 0xa0]
push edi
push eax
call fcn.00513700
lea eax, [ebp - 0xa0]
push 0x5153b0
push eax
call fcn.00513700
push dword [esi + 0x5161d4]
lea eax, [ebp - 0xa0]
push eax
call fcn.00513700
push 0x12010
lea eax, [ebp - 0xa0]
push str.Microsoft_Visual_C_Runtime_Library
push eax
call fcn.0051445e
add esp, 0x2c
pop edi
jmp 0x513295
lea eax, [ebp + 8]
lea esi, [esi + 0x5161d4]
push 0
push eax
push dword [esi]
call fcn.00513860
pop ecx
push eax
push dword [esi]
push 0xfffffffffffffff4
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
pop esi
leave
ret
Function at 0x513440
Capabilities:
Packed with generic packer

Disassembly:
pushal
mov esi, section.UPX1
lea edi, [esi - 0xb2000]
push edi
or ebp, 0xffffffff
jmp 0x513462
mov al, byte [esi]
inc esi
mov byte [edi], al
inc edi
add ebx, ebx
jne 0x513469
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
jb 0x513458
mov eax, 1
add ebx, ebx
jne 0x51347b
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
adc eax, eax
add ebx, ebx
jae 0x51348c
jne 0x5134ab
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
jb 0x5134ab
dec eax
add ebx, ebx
jne 0x513498
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
adc eax, eax
jmp 0x513470
add ebx, ebx
jne 0x5134a7
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
adc ecx, ecx
jmp 0x5134fd
xor ecx, ecx
sub eax, 3
jb 0x5134c3
shl eax, 8
mov al, byte [esi]
inc esi
xor eax, 0xffffffff
je 0x513532
sar eax, 1
mov ebp, eax
jmp 0x5134ce
add ebx, ebx
jne 0x5134ce
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
jb 0x51349c
inc ecx
add ebx, ebx
jne 0x5134dc
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
jb 0x51349c
add ebx, ebx
jne 0x5134e9
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
adc ecx, ecx
add ebx, ebx
jae 0x5134de
jne 0x5134fa
mov ebx, dword [esi]
sub esi, 0xfffffffc
adc ebx, ebx
jae 0x5134de
add ecx, 2
cmp ebp, 0xfffffb00
adc ecx, 2
lea edx, [edi + ebp]
cmp ebp, 0xfffffffc
jbe 0x51351c
mov al, byte [edx]
inc edx
mov byte [edi], al
inc edi
dec ecx
jne 0x51350e
jmp 0x51345e
mov eax, dword [edx]
add edx, 4
mov dword [edi], eax
add edi, 4
sub ecx, 4
ja 0x51351c
add edi, ecx
jmp 0x51345e
pop esi
mov edi, esi
mov ecx, 0x4da7
mov al, byte [edi]
inc edi
sub al, 0xe8
cmp al, 1
ja 0x51353a
cmp byte [edi], 0x16
jne 0x51353a
mov eax, dword [edi]
mov bl, byte [edi + 4]
shr ax, 8
rol eax, 0x10
xchg ah, al
sub eax, edi
sub bl, 0xe8
add eax, esi
mov dword [edi], eax
add edi, 5
mov al, bl
loop 0x51353f
lea edi, [esi + 0x110000]
mov eax, dword [edi]
or eax, eax
je 0x5135b7
mov ebx, dword [edi + 4]
lea eax, [eax + esi + 0x117bcc]
add ebx, esi
push eax
add edi, 8
call dword [esi + 0x117ce4]
xchg ebp, eax
mov al, byte [edi]
inc edi
or al, al
je 0x51356c
mov ecx, edi
jns 0x51359b
movzx eax, word [edi]
inc edi
push eax
inc edi
mov ecx, 0xaef24857
push edi
dec eax
repne scasb al, byte es:[edi]
push ebp
call dword [esi + 0x117ce8]
or eax, eax
je 0x5135b1
mov dword [ebx], eax
add ebx, 4
jmp 0x513589
call dword [esi + 0x117cf8]
mov ebp, dword [esi + 0x117cec]
lea edi, [esi - 0x1000]
mov ebx, 0x1000
push eax
push esp
push 4
push ebx
push edi
call ebp
lea eax, [edi + 0x217]
and byte [eax], 0x7f
and byte [eax + 0x28], 0x7f
pop eax
push eax
push esp
push eax
push ebx
push edi
call ebp
pop eax
popal
lea eax, [esp - 0x80]
push 0
cmp esp, eax
jne 0x5135eb
sub esp, 0xffffff80
jmp 0x4a8e37
Function at 0x100039f0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
cmp dword [ebp + 0xc], 1
jne 0x10003a2a
cmp byte [0x100990b2], 0
jne 0x10003a2a
push 0
push 0
push dword [ebp + 8]
push 0x100039a0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
test eax, eax
je 0x10003a2a
push eax
mov byte [0x100990b2], 1
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 1
pop ebp
ret 0xc
Function at 0x10006990
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 0x100069bc
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 0x100069e4
mov eax, dword [eax]
mov ecx, dword [eax]
jmp 0x100069ea
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 0x10006a52
jg 0x10006a01
test esi, esi
je 0x10006a52
test ecx, ecx
jl 0x10006a4d
jg 0x10006a0b
test eax, eax
je 0x10006a4d
cmp edi, ecx
jg 0x10006a1f
jl 0x10006a15
cmp esi, eax
jae 0x10006a1f
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 edx, dword [esp + 0x10]
mov ecx, dword [ebp + 8]
add ecx, edx
sub esi, edx
mov eax, dword [eax]
sbb edi, dword [esp + 0x14]
sub dword [eax], edx
mov eax, dword [ebx + 0x20]
add dword [eax], edx
jmp 0x10006a55
mov ecx, dword [ebp + 8]
jmp 0x10006a5f
mov ecx, dword [ebp + 8]
test edi, edi
jl 0x10006a79
jg 0x10006a5f
test esi, esi
je 0x10006a79
mov eax, dword [ebx + 0x4c]
test eax, eax
je 0x10006a79
push eax
push esi
push 1
push ecx
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 0x10006a90
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0x10]
sub esp, 8
push ebx
mov ebx, ecx
mov ecx, dword [ebp + 0xc]
test eax, eax
jg 0x10006ab4
jl 0x10006aa9
test ecx, ecx
jne 0x10006ab4
xor eax, eax
xor edx, edx
pop ebx
mov esp, ebp
pop ebp
ret 0xc
cmp dword [ebx + 0x38], 0
je 0x10006ace
push eax
push ecx
push dword [ebp + 8]
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 ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebx + 0x1c]
push esi
push edi
mov edi, ecx
mov eax, dword [eax]
mov dword [ebp - 8], eax
test eax, eax
je 0x10006b14
mov eax, dword [ebx + 0x2c]
lea edx, [ebx + 0x2c]
mov dword [ebp - 4], edx
mov eax, dword [eax]
test eax, eax
je 0x10006b1a
cmp eax, ecx
mov esi, ecx
cmovb esi, eax
push esi
push dword [ebp - 8]
push dword [ebp + 8]
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebx + 0x2c]
add esp, 0xc
add dword [ebp + 8], esi
sub edi, esi
sub dword [eax], esi
mov eax, dword [ebx + 0x1c]
add dword [eax], esi
jmp 0x10006b1a
lea eax, [ebx + 0x2c]
mov dword [ebp - 4], eax
cmp dword [ebx + 0x4c], 0
mov esi, dword [ebp + 8]
je 0x10006b89
mov ecx, dword [ebx + 0xc]
lea eax, [ebx + 0x3c]
cmp dword [ecx], eax
jne 0x10006b46
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 - 4]
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 0x10006b77
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 0x10006b89
cmp edi, eax
mov eax, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
ja 0x10006b53
test edi, edi
je 0x10006b89
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 0x10006f10
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [0x10098040]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, ecx
cmp ebx, 0xffffffff
jne 0x10006f40
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1002ed8c
mov esp, ebp
pop ebp
ret 4
mov eax, dword [esi + 0x20]
push edi
mov ecx, dword [eax]
test ecx, ecx
je 0x10006f7c
mov edx, dword [esi + 0x30]
mov edi, dword [edx]
lea eax, [edi + ecx]
cmp ecx, eax
jae 0x10006f7c
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.1002ed8c
mov esp, ebp
pop ebp
ret 4
cmp dword [esi + 0x4c], 0
je 0x10007053
mov edi, dword [esi + 0xc]
lea eax, [esi + 0x3c]
cmp dword [edi], eax
jne 0x10006fa4
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 0x10006fb0
movsx eax, bl
jmp 0x10006fe8
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 0x10007012
sub eax, 1
je 0x10007012
sub eax, 2
jne 0x10007053
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.1002ed8c
mov esp, ebp
pop ebp
ret 4
mov edi, dword [ebp - 0x2c]
lea eax, [ebp - 0x24]
sub edi, eax
je 0x10007030
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 0x10007053
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.1002ed8c
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.1002ed8c
mov esp, ebp
pop ebp
ret 4
Function at 0x10007e40
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov eax, dword [0x10098040]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, ecx
cmp dword [esi + 0x38], 0
je 0x10007efc
cmp byte [esi + 0x3d], 0
je 0x10007efc
mov eax, dword [esi]
push edi
push 0xffffffffffffffff
call dword [eax + 0xc]
cmp eax, 0xffffffff
je 0x10007eea
mov ecx, dword [esi + 0x38]
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x24]
push eax
lea eax, [esi + 0x40]
push eax
call dword [sym.imp.MSVCP140.dll_public:_int___thiscall_std::codecvt_char__char__struct__Mbstatet_::unshift_struct__Mbstatet___char___char___char___const]
sub eax, 0
je 0x10007eb1
sub eax, 1
je 0x10007eb5
sub eax, 2
jne 0x10007eea
mov byte [esi + 0x3d], al
mov al, 1
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1002ed8c
mov esp, ebp
pop ebp
ret
mov byte [esi + 0x3d], 0
mov edi, dword [ebp - 0x28]
lea eax, [ebp - 0x24]
sub edi, eax
je 0x10007ed3
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 0x10007eea
cmp byte [esi + 0x3d], 0
pop edi
sete al
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1002ed8c
mov esp, ebp
pop ebp
ret
pop edi
xor al, al
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1002ed8c
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov al, 1
xor ecx, ebp
pop esi
call fcn.1002ed8c
mov esp, ebp
pop ebp
ret