joyce8/EMBER2024-capa huggingface dataset:
Function at 0x56cb60
Capabilities:
Encrypt data using rc4 ksa
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push esi
mov dword [ebp - 0xc], ecx
cmp dword [ebp + 0xc], 0x80
jbe 0x56cb7a
xor al, al
jmp 0x56ccd7
cmp dword [ebp + 0x10], 0
jne 0x56cb87
mov dword [ebp + 0x10], 0x400
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp + 8]
push ecx
mov edx, dword [ebp - 0xc]
add edx, 4
push edx
call sub.MSVCR90.dll_memcpy
add esp, 0xc
cmp dword [ebp + 0xc], 0x80
jae 0x56cc00
mov dword [ebp - 8], 0
mov eax, dword [ebp - 0xc]
add eax, dword [ebp + 0xc]
mov cl, byte [eax + 3]
mov byte [ebp - 1], cl
movzx edx, byte [ebp - 1]
mov eax, dword [ebp - 0xc]
add eax, dword [ebp - 8]
movzx ecx, byte [eax + 4]
add edx, ecx
and edx, 0xff
mov dl, byte [edx + 0x6a0800]
mov byte [ebp - 1], dl
mov eax, dword [ebp - 8]
add eax, 1
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0xc]
add ecx, dword [ebp + 0xc]
mov dl, byte [ebp - 1]
mov byte [ecx + 4], dl
mov eax, dword [ebp + 0xc]
add eax, 1
mov dword [ebp + 0xc], eax
cmp dword [ebp + 0xc], 0x80
jb 0x56cbba
mov ecx, dword [ebp + 0x10]
add ecx, 7
shr ecx, 3
mov dword [ebp + 0xc], ecx
mov edx, 0x80
sub edx, dword [ebp + 0xc]
mov dword [ebp - 8], edx
mov eax, dword [ebp - 0xc]
add eax, dword [ebp - 8]
movzx esi, byte [eax + 4]
mov eax, dword [ebp + 0x10]
xor edx, edx
mov ecx, 8
div ecx
mov eax, 8
sub eax, edx
xor edx, edx
mov ecx, 8
div ecx
mov eax, 0xff
mov ecx, edx
sar eax, cl
and esi, eax
mov cl, byte [esi + 0x6a0800]
mov byte [ebp - 1], cl
mov edx, dword [ebp - 0xc]
add edx, dword [ebp - 8]
mov al, byte [ebp - 1]
mov byte [edx + 4], al
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 8]
sub edx, 1
mov dword [ebp - 8], edx
test ecx, ecx
je 0x56cc98
movzx eax, byte [ebp - 1]
mov ecx, dword [ebp - 8]
add ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 0xc]
movzx ecx, byte [edx + ecx + 4]
xor eax, ecx
mov dl, byte [eax + 0x6a0800]
mov byte [ebp - 1], dl
mov eax, dword [ebp - 0xc]
add eax, dword [ebp - 8]
mov cl, byte [ebp - 1]
mov byte [eax + 4], cl
jmp 0x56cc5d
mov dword [ebp - 8], 0x3f
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
movzx ecx, byte [eax + edx*2 + 4]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
movzx edx, byte [eax + edx*2 + 5]
shl edx, 8
add ecx, edx
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0xc]
mov word [edx + eax*2 + 4], cx
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 8]
sub ecx, 1
mov dword [ebp - 8], ecx
test eax, eax
jne 0x56cc9f
mov al, 1
pop esi
mov esp, ebp
pop ebp
ret 0xc
Function at 0x581130
Capabilities:
Check for time delay via queryperformancecounter

Disassembly:
sub esp, 0x10
cmp dword [0x759d74], 0
push esi
mov esi, dword [sym.imp.KERNEL32.dll_QueryPerformanceCounter]
jne 0x581169
lea eax, [esp + 0xc]
push eax
mov dword [0x759d74], 1
call dword [sym.imp.KERNEL32.dll_QueryPerformanceFrequency]
fild qword [esp + 0xc]
push 0x759c60
fstp qword [0x759c68]
call esi
lea ecx, [esp + 4]
push ecx
call esi
mov edx, dword [esp + 4]
sub edx, dword [0x759c60]
mov eax, dword [esp + 8]
sbb eax, dword [0x759c64]
mov dword [esp + 4], edx
mov dword [esp + 8], eax
fild qword [esp + 4]
pop esi
fdiv qword [0x759c68]
add esp, 0x10
ret

Function at 0x581470
Capabilities:
Print debug messages

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x611e6b
push eax
mov eax, 0x1004
mov dword fs:[0], esp
call fcn.005ff690
cmp dword [0x759cc0], 0
jne 0x5814b7
push 0xfa0
push 0x759fc4
mov dword [0x759cc0], 1
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSectionAndSpinCount]
call fcn.00580f50
push esi
push edi
push 0x759fc4
mov dword [esp + 0xc], 0x759fc4
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x704058]
imul esi, dword [0x759cd0]
cmp esi, 0x1f4
mov dword [esp + 0x1014], 0
jl 0x58151c
push 0x1c5
push str..Source_r3d.cpp
push str.ioff___500
push str.____r3d_assert__s_at__s_line__d_n
call fcn.00581470
push 0x1c5
push str..Source_r3d.cpp
push str.ioff___500
call sub.MSVCR90.dll__assert
add esp, 0x1c
test esi, esi
jle 0x581530
push esi
lea eax, [esp + 0x10]
push 0x20
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
mov eax, 0x1000
sub eax, esi
lea edi, [esp + esi + 0xc]
je 0x58156f
cmp eax, 0x7fffffff
ja 0x58156f
mov edx, dword [esp + 0x101c]
lea ecx, [esp + 0x1020]
push ecx
push edx
lea esi, [eax - 1]
push esi
push edi
call sub.MSVCR90.dll__vsnprintf
add esp, 0x10
test eax, eax
jl 0x58156b
cmp eax, esi
ja 0x58156b
jne 0x58156f
mov byte [esi + edi], 0
cmp dword [0x759cc8], 0
pop edi
pop esi
jne 0x58159b
push 0x6a22ec
push str.r3dlog.txt
mov dword [0x759cc8], 1
call sub.MSVCR90.dll_fopen
add esp, 8
mov dword [0x759ccc], eax
cmp dword [0x759ccc], 0
je 0x5815ec
lea eax, [esp + 4]
push eax
call fcn.00581130
fmul dword [0x6a22e8]
call fcn.005ff7d0
cdq
mov ecx, 0x3e8
idiv ecx
push edx
call fcn.00581130
call fcn.005ff7d0
mov edx, dword [0x759ccc]
push eax
push 0x6a22d8
push edx
call sub.MSVCR90.dll_fprintf
mov eax, dword [0x759ccc]
push eax
call sub.MSVCR90.dll_fflush
add esp, 0x18
cmp dword [0x703ff4], 0
je 0x581600
lea ecx, [esp + 4]
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
cmp dword [0x759cb8], 0
je 0x581616
lea edx, [esp + 4]
push edx
call sub.MSVCR90.dll_printf
add esp, 4
push 0x759fc4
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x1004]
mov al, 1
mov dword fs:[0], ecx
add esp, 0x1010
ret

Function at 0x581e00
Capabilities:
Encode data using xor
Hash data with crc32

Disassembly:
mov ecx, dword [esp + 8]
or eax, 0xffffffff
test ecx, ecx
je 0x581e2c
mov edx, dword [esp + 4]
push esi
movzx esi, byte [edx]
xor esi, eax
and esi, 0xff
shr eax, 8
xor eax, dword [esi*4 + 0x704078]
dec ecx
inc edx
test ecx, ecx
jne 0x581e10
pop esi
not eax
ret
Function at 0x582120
Capabilities:
Read file on windows

Disassembly:
cmp dword [esp + 8], 0
jne 0x582140
push 0
push 0x168
push str..SourceFileSystem_r3dFSCompress.cpp
push str.out_crc32
call fcn.00581780
add esp, 0x10
push ebp
mov ebp, dword [esp + 8]
push esi
push 0x6c6158
push ebp
call sub.MSVCR90.dll_fopen
mov esi, eax
add esp, 8
test esi, esi
jne 0x58215f
pop esi
xor al, al
pop ebp
ret
push ebx
push edi
push 2
push 0
push esi
call sub.MSVCR90.dll_fseek
push esi
call sub.MSVCR90.dll_ftell
push 0
push 0
push esi
mov edi, eax
call sub.MSVCR90.dll_fseek
lea eax, [edi + 1]
push 1
push eax
call fcn.005832f0
push esi
push edi
mov ebx, eax
push 1
push ebx
call sub.MSVCR90.dll_fread
add esp, 0x34
cmp eax, edi
je 0x5821bd
push esi
call sub.MSVCR90.dll_fclose
push ebx
call fcn.00583350
push edi
push ebp
push str.failed_to_read__s__d_n
call fcn.00581640
add esp, 0x14
pop edi
pop ebx
pop esi
xor al, al
pop ebp
ret
push edi
push ebx
call fcn.00581e00
push ebx
mov ebp, eax
call fcn.00583350
push esi
call sub.MSVCR90.dll_fclose
mov eax, dword [esp + 0x2c]
add esp, 0x10
test eax, eax
je 0x5821df
mov dword [eax], edi
mov ecx, dword [esp + 0x18]
pop edi
pop ebx
pop esi
mov dword [ecx], ebp
mov al, 1
pop ebp
ret

Function at 0x5822d0
Capabilities:
Read file on windows

Disassembly:
push edi
mov edi, dword [esp + 0x14]
mov eax, dword [edi]
test eax, eax
je 0x5822e5
pop edi
mov dword [esp + 0x10], eax
jmp sub.MSVCR90.dll_fread
mov ecx, dword [edi + 8]
mov eax, dword [edi + 0x114]
push ebx
mov ebx, dword [esp + 0x10]
push esi
mov esi, ebx
imul esi, dword [esp + 0x18]
lea edx, [ecx + esi]
cmp edx, eax
jb 0x582306
sub eax, ecx
mov esi, eax
test esi, esi
jne 0x582310
pop esi
pop ebx
xor eax, eax
pop edi
ret
mov eax, dword [edi + 4]
add eax, ecx
mov ecx, dword [esp + 0x10]
push esi
push eax
push ecx
call sub.MSVCR90.dll_memcpy
add dword [edi + 8], esi
add esp, 0xc
mov eax, esi
xor edx, edx
pop esi
div ebx
pop ebx
pop edi
ret

Function at 0x582630
Capabilities:
Set file attributes

Disassembly:
push esi
push edi
mov edi, dword [esp + 0xc]
push 0x80
push edi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov eax, dword [esp + 0x10]
push eax
push edi
call sub.MSVCR90.dll_fopen
mov esi, eax
add esp, 8
test esi, esi
jne 0x582674
call sub.MSVCR90.dll__errno
mov ecx, dword [eax]
push ecx
call fcn.00582430
push eax
push edi
push str.__warning____cant_open__s_for_writing_nError:__s__d__n
call fcn.00581640
add esp, 0x10
mov eax, esi
pop edi
pop esi
ret

Function at 0x582680
Capabilities:
Create directory
Get common file path

Disassembly:
push esi
mov esi, dword [esp + 8]
push esi
push 0
push 0
push 0x8005
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathA]
test eax, eax
jl 0x5826d1
mov eax, esi
dec eax
mov edi, edi
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x5826a0
mov ecx, dword [str.191Z_]
mov dword [eax], ecx
mov dx, word [0x6a29cc]
mov word [eax + 4], dx
mov cl, byte [0x6a29ce]
push esi
mov byte [eax + 6], cl
call sub.MSVCR90.dll__mkdir
add esp, 4
mov al, 1
pop esi
ret
xor al, al
pop esi
ret
Function at 0x582770
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x404c
call fcn.005ff690
push esi
mov esi, dword [esp + 0x4054]
push edi
lea eax, [esp + 0x30]
push eax
push esi
call sub.MSVCR90.dll__stat32
mov edi, dword [esp + 0x4064]
lea ecx, [esp + 0x14]
push ecx
push edi
call sub.MSVCR90.dll__stat32
mov edx, dword [esp + 0x54]
add esp, 0x10
cmp edx, dword [esp + 0x20]
je 0x5827b8
pop edi
xor eax, eax
pop esi
add esp, 0x404c
ret
push ebx
push ebp
push 0x6c6158
push esi
call sub.MSVCR90.dll_fopen
push 0x6c6158
push edi
mov ebp, eax
call sub.MSVCR90.dll_fopen
add esp, 0x10
mov ebx, eax
test ebp, ebp
je 0x5828d1
push ebp
test ebx, ebx
je 0x5828d6
mov dword [esp + 0x14], 1
call sub.MSVCR90.dll_feof
add esp, 4
test eax, eax
jne 0x5828b3
push ebp
push 0x2000
lea eax, [esp + 0x2064]
push 1
push eax
call sub.MSVCR90.dll_fread
push ebx
push 0x2000
lea ecx, [esp + 0x74]
push 1
push ecx
mov edi, eax
call sub.MSVCR90.dll_fread
add esp, 0x20
cmp edi, eax
je 0x582849
push 0
push 0x6cc
push str..Source_r3dFileMan.cpp
push str.read0__read1
call fcn.00581780
add esp, 0x10
mov eax, edi
lea ecx, [esp + 0x5c]
lea esi, [esp + 0x205c]
cmp edi, 4
jb 0x582874
jmp 0x582860
mov edx, dword [esi]
cmp edx, dword [ecx]
jne 0x5828ab
sub eax, 4
add ecx, 4
add esi, 4
cmp eax, 4
jae 0x582860
test eax, eax
je 0x582898
mov dl, byte [ecx]
cmp dl, byte [esi]
jne 0x5828ab
cmp eax, 1
jbe 0x582898
mov dl, byte [ecx + 1]
cmp dl, byte [esi + 1]
jne 0x5828ab
cmp eax, 2
jbe 0x582898
mov al, byte [ecx + 2]
cmp al, byte [esi + 2]
jne 0x5828ab
push ebp
call sub.MSVCR90.dll_feof
add esp, 4
test eax, eax
je 0x582800
jmp 0x5828b3
mov dword [esp + 0x10], 0
push ebp
call sub.MSVCR90.dll_fclose
push ebx
call sub.MSVCR90.dll_fclose
mov eax, dword [esp + 0x18]
add esp, 8
pop ebp
pop ebx
pop edi
pop esi
add esp, 0x404c
ret
test ebx, ebx
je 0x5828de
push ebx
call sub.MSVCR90.dll_fclose
add esp, 4
pop ebp
pop ebx
pop edi
xor eax, eax
pop esi
add esp, 0x404c
ret
Function at 0x585090
Capabilities:
Terminate process

Disassembly:
mov eax, dword [esp + 4]
push esi
push edi
mov esi, ecx
cmp eax, 0x8876017c
jne 0x5850f9
mov ecx, dword [0x7d9e20]
push 1
call fcn.0059c4a0
mov eax, dword [0x7d9db0]
cmp dword [eax + 0x184], 0
mov esi, dword [esi + 8]
mov edi, esi
je 0x5850cf
push 6
push esi
xor edi, edi
call dword [sym.imp.USER32.dll_ShowWindow]
call fcn.00583fb0
push 0x1010
push str.Error
push str.Out_of_video_memory_
push edi
call dword [sym.imp.USER32.dll_MessageBoxA]
mov ecx, dword [0x759c74]
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
pop edi
pop esi
ret 4
cmp eax, 0x8007000e
jne 0x5851a4
mov eax, dword [esi + 0x1025ec]
push 1
mov dword [esi + 0x1025ec], 0
push 1
mov dword [esi + 0x1025f0], 0
push eax
mov dword [esi + 0x1025f4], 0
call fcn.005832b0
add esp, 0xc
push 0
mov ecx, esi
call fcn.00583430
mov eax, dword [esi + 0x480]
test eax, eax
je 0x58515c
push 1
push eax
mov ecx, esi
call fcn.005965c0
mov eax, dword [esi + 0x480]
test eax, eax
jne 0x585148
mov edx, dword [0x7d9db0]
cmp dword [edx + 0x184], 0
mov esi, dword [esi + 8]
mov edi, esi
je 0x585180
push 6
push esi
xor edi, edi
call dword [sym.imp.USER32.dll_ShowWindow]
call fcn.00583fb0
push 0x1010
push str.Error
push str.Out_of_system_memory_
push edi
call dword [sym.imp.USER32.dll_MessageBoxA]
mov eax, dword [0x759c74]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
pop edi
pop esi
ret 4

Function at 0x585b50
Capabilities:
Access peb ldr_data
Get kernel32 base address

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x6124e8
push eax
mov dword fs:[0], esp
sub esp, 0xc
push esi
mov esi, ecx
mov eax, dword [esi + 4]
cmp eax, dword [esi + 8]
jb 0x585c1d
push ebx
push ebp
xor ebp, ebp
push edi
mov dword [esp + 0x10], ebp
mov dword [esp + 0x14], ebp
mov dword [esp + 0x18], ebp
lea ebx, [eax + 1]
mov dword [esp + 0x24], ebp
mov eax, SysReAllocString
test ebx, ebx
js 0x585b9e
shr eax, 1
test ebx, eax
je 0x585b98
add eax, eax
push eax
lea ecx, [esp + 0x14]
call fcn.00584df0
mov ecx, dword [esi + 4]
mov edx, dword [esi]
mov edi, dword [esp + 0x10]
cmp ecx, ebp
jbe 0x585bd3
mov eax, edi
sub edx, edi
jmp 0x585bc0
cmp eax, ebp
je 0x585bcb
mov ebp, dword [edx + eax]
mov dword [eax], ebp
xor ebp, ebp
add eax, 4
sub ecx, 1
jne 0x585bc0
mov eax, dword [esi + 4]
lea eax, [edi + eax*4]
cmp eax, ebp
je 0x585be5
mov ecx, dword [esp + 0x2c]
mov edx, dword [ecx]
mov dword [eax], edx
mov eax, dword [esi]
mov ecx, dword [esp + 0x18]
push 1
mov dword [esi], edi
push 1
mov dword [esi + 4], ebx
push eax
mov dword [esi + 8], ecx
mov dword [esp + 0x30], 0xffffffff
call fcn.005832b0
add esp, 0xc
pop edi
pop ebp
pop ebx
pop esi
mov ecx, dword [esp + 0xc]
mov dword fs:[0], ecx
add esp, 0x18
ret 4
mov edx, dword [esi]
lea ecx, [edx + eax*4]
inc eax
mov dword [esi + 4], eax
test ecx, ecx
je 0x585c32
mov eax, dword [esp + 0x20]
mov edx, dword [eax]
mov dword [ecx], edx
mov ecx, dword [esp + 0x10]
pop esi
mov dword fs:[0], ecx
add esp, 0x18
ret 4
Function at 0x58aa70
Capabilities:
Create directory

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
sub esp, 0x134
push ebx
push esi
mov esi, ecx
cmp dword [esi + 0x5c], 0
push edi
jne 0x58aaa0
push 0
push 0xeb
push str..Sourced3dFont.cpp
push str.glyphTexture
call fcn.00581780
add esp, 0x10
push str.DataFonts
call sub.MSVCR90.dll__mkdir
mov eax, dword [esi + 0x58]
mov ecx, dword [esi + 0x54]
push eax
push ecx
lea edi, [esi + 4]
push edi
lea edx, [esp + 0x48]
push str.DataFonts_s__d__x.tga
push edx
call fcn.00410aa0
mov ebx, dword [esi + 0x5c]
mov eax, dword [ebx + 0x3c]
add esp, 0x18
cmp dword [eax], 0
jne 0x58aae9
push 0
push 0x4d
push str.c:warz_srceternityinclude_r3dTex.h
push str.m_TexArray_0_.Valid__
call fcn.00581780
add esp, 0x10
mov ecx, dword [ebx + 0x3c]
call fcn.00584b10
mov ecx, dword [eax]
lea edx, [esp + 0x34]
push edx
push 0
push eax
mov eax, dword [ecx + 0x48]
call eax
mov ecx, dword [esp + 0x34]
push 0
push 0
push ecx
push 2
lea edx, [esp + 0x48]
push edx
call sub.d3dx9_43.dll_D3DXSaveSurfaceToFileA
mov eax, dword [esp + 0x34]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, dword [esi + 0x58]
mov ecx, dword [esi + 0x54]
push eax
push ecx
push edi
lea edx, [esp + 0x44]
push str.DataFonts_s__d__x.dat
push edx
call fcn.00410aa0
lea eax, [esp + 0x4c]
push 0x6c3908
push eax
call fcn.00582630
mov edi, eax
add esp, 0x1c
test edi, edi
jne 0x58ab70
push eax
push 0xfc
push str..Sourced3dFont.cpp
push 0x6a4b80
call fcn.00581780
add esp, 0x10
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
movss xmm0, dword [esi + 0x60]
sub esp, 8
cvtps2pd xmm0, xmm0
movsd qword [esp], xmm0
push 0x6a4b48
push edi
call sub.MSVCR90.dll_fprintf
add esp, 0x10
add esi, 0x6c
mov ebx, 0x5f
jmp 0x58aba0
movss xmm0, dword [esi + 4]
cvtps2pd xmm0, xmm0
sub esp, 0x20
movsd qword [esp + 0x18], xmm0
movss xmm0, dword [esi]
cvtps2pd xmm0, xmm0
movsd qword [esp + 0x10], xmm0
movss xmm0, dword [esi - 4]
cvtps2pd xmm0, xmm0
movsd qword [esp + 8], xmm0
movss xmm0, dword [esi - 8]
cvtps2pd xmm0, xmm0
movsd qword [esp], xmm0
push str._1.8f__1.8f__1.8f__1.8f_n
push edi
call sub.MSVCR90.dll_fprintf
add esp, 0x28
add esi, 0x10
sub ebx, 1
jne 0x58aba0
push edi
call sub.MSVCR90.dll_fclose
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x58f890
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x61212b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x110
push ebx
push ebp
push esi
push edi
mov ebp, ecx
push 0x7e21fc
lea ecx, [esp + 0x18]
call fcn.005841b0
mov edi, dword [esp + 0x130]
cmp byte [edi], 0
mov dword [esp + 0x128], 0
je 0x58f903
cmp byte [edi + 0x104], 0
je 0x58f903
cmp byte [edi + 0x105], 0xff
je 0x58f903
or eax, 0xffffffff
cmp dword [edi + 0x106], eax
je 0x58f903
cmp dword [edi + 0x10a], eax
je 0x58f903
cmp dword [edi + 0x10e], eax
jne 0x58f91c
push 0
push 0x1b8
push str..SourceFileSystem_r3dFileSystem.cpp
push str.fe.IsValid__
call fcn.00581780
add esp, 0x10
mov ebx, dword [esp + 0x138]
cmp dword [edi + 0x10e], ebx
je 0x58f944
push 0
push 0x1b9
push str..SourceFileSystem_r3dFileSystem.cpp
push str.fe.csize__csize
call fcn.00581780
add esp, 0x10
movzx eax, byte [edi + 0x105]
mov esi, dword [ebp + eax*4 + 0x340]
cmp esi, 0xffffffff
jne 0x58f9c7
inc eax
push eax
lea eax, [esp + 0x20]
push eax
mov ecx, ebp
call fcn.0058f580
push 0
push 0x80
push 4
push 0
push 1
push 0x40000000
lea ecx, [esp + 0x34]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x58f9b9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [esp + 0x20]
push edx
push str.cant_open__s_for_writing___d_n
call fcn.00581640
add esp, 0xc
lea ecx, [esp + 0x14]
mov dword [esp + 0x128], esi
call fcn.00584220
xor al, al
jmp 0x58fa75
movzx eax, byte [edi + 0x105]
mov dword [ebp + eax*4 + 0x340], esi
mov ecx, dword [edi + 0x106]
push 0
push 0
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, dword [edi + 0x106]
je 0x58f9f5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.SetFilePointer_failed__d
call fcn.00581640
add esp, 8
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
lea edx, [esp + 0x14]
push edx
push 4
lea eax, [esp + 0x24]
push eax
push esi
mov dword [esp + 0x24], 0
mov dword [esp + 0x2c], 0x64667261
call ebp
test eax, eax
jne 0x58fa34
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.WriteFile_failed__d
call fcn.00581640
add esp, 8
mov edx, dword [esp + 0x134]
push 0
lea ecx, [esp + 0x14]
push ecx
push ebx
push edx
push esi
call ebp
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x58fa5f
push ebx
push eax
push edi
push str.failed_to_write__s__d_vs__d_n
call fcn.00581640
add esp, 0x10
lea ecx, [esp + 0x14]
mov dword [esp + 0x128], 0xffffffff
call fcn.00584220
mov al, 1
mov ecx, dword [esp + 0x120]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x11c
ret 0xc
Function at 0x58ff00
Capabilities:
Read file on windows
Write file on windows

Disassembly:
sub esp, 8
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x1c]
mov esi, dword [edi + 0x10e]
add esi, 4
lea eax, [esi + 1]
push 1
push eax
mov ebp, ecx
call fcn.005832f0
movzx ecx, byte [edi + 0x105]
mov ebx, dword [ebp + ecx*4 + 0x340]
add esp, 8
mov dword [esp + 0x1c], eax
cmp ebx, 0xffffffff
jne 0x58ff54
push 0
push 0x31e
push str..SourceFileSystem_r3dFileSystem.cpp
push str.h___INVALID_HANDLE_VALUE
call fcn.00581780
add esp, 0x10
mov edx, dword [edi + 0x106]
push 0
push 0
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [esp + 0x1c]
push 0
lea eax, [esp + 0x14]
push eax
push esi
push ecx
push ebx
mov dword [esp + 0x24], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x10], esi
je 0x58ffb2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.RelocateFile_read_failed__d_n
call fcn.00581470
mov edx, dword [esp + 0x24]
push edx
call fcn.00583350
add esp, 0xc
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 8
ret 0xc
mov al, byte [esp + 0x20]
mov ecx, dword [esp + 0x24]
movzx edx, al
mov byte [edi + 0x105], al
mov dword [edi + 0x106], ecx
mov ebx, dword [ebp + edx*4 + 0x340]
cmp ebx, 0xffffffff
jne 0x58ffee
push 0
push 0x32f
push str..SourceFileSystem_r3dFileSystem.cpp
push str.h___INVALID_HANDLE_VALUE
call fcn.00581780
add esp, 0x10
mov eax, dword [edi + 0x106]
push 0
push 0
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [esp + 0x1c]
push 0
lea ecx, [esp + 0x18]
push ecx
push esi
push edi
push ebx
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x14], esi
je 0x590048
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.RelocateFile_write_failed__d_n
call fcn.00581470
push edi
call fcn.00583350
add esp, 0xc
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 8
ret 0xc
push edi
call fcn.00583350
add esp, 4
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 8
ret 0xc
Function at 0x590120
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x612188
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x34
push ebx
push ebp
push esi
push edi
mov ebx, ecx
push 0x7e21fc
lea ecx, [esp + 0x2c]
call fcn.005841b0
mov eax, dword [ebx + 0x14]
sub eax, dword [ebx + 0x10]
xor ebp, ebp
sar eax, 2
mov dword [esp + 0x4c], ebp
test eax, eax
ja 0x590177
push ebp
push 0xf8
push str..SourceFileSystem_r3dFileSystem.cpp
push str.IsValid__
call fcn.00581780
add esp, 0x10
cmp dword [esp + 0x54], ebp
jne 0x590195
push ebp
push 0xf9
push str..SourceFileSystem_r3dFileSystem.cpp
push 0x6a4b80
call fcn.00581780
add esp, 0x10
mov esi, dword [ebx + 0x14]
sub esi, dword [ebx + 0x10]
push 1
sar esi, 2
imul esi, esi, 0x128
lea ecx, [esi + 1]
push ecx
mov dword [esp + 0x34], 0x6c667261
mov dword [esp + 0x38], 1
mov dword [esp + 0x28], esi
call fcn.005832f0
mov edx, dword [ebx + 0x14]
sub edx, dword [ebx + 0x10]
add esp, 8
sar edx, 2
mov edi, eax
mov dword [esp + 0x24], edi
test edx, edx
jbe 0x590221
mov dword [esp + 0x14], edi
lea ecx, [ecx]
mov eax, dword [ebx + 0x14]
sub eax, dword [ebx + 0x10]
sar eax, 2
cmp ebp, eax
jb 0x5901f2
call sub.MSVCR90.dll__invalid_parameter_noinfo
mov edx, dword [ebx + 0x10]
mov esi, dword [edx + ebp*4]
mov edi, dword [esp + 0x14]
add dword [esp + 0x14], 0x128
mov ecx, 0x4a
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebx + 0x14]
sub eax, dword [ebx + 0x10]
inc ebp
sar eax, 2
cmp ebp, eax
jb 0x5901e0
mov esi, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
lea ecx, [esp + 0x13]
call fcn.00582020
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x20]
push edx
push esi
push edi
lea ecx, [esp + 0x23]
call fcn.00581e30
test eax, eax
jne 0x590250
push str.failed_to_compres_file_list_n
call fcn.00581640
add esp, 4
mov eax, dword [ebx + 0x14]
sub eax, dword [ebx + 0x10]
mov ecx, dword [ebx]
mov edx, dword [esp + 0x18]
sar eax, 2
push esi
push edi
mov dword [esp + 0x40], eax
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x44], edx
call fcn.00581e00
mov esi, dword [esp + 0x5c]
push esi
push 8
mov dword [esp + 0x50], eax
lea eax, [esp + 0x3c]
push 1
push eax
call sub.MSVCR90.dll_fwrite
push esi
push 0x10
lea ecx, [esp + 0x54]
push 1
push ecx
call sub.MSVCR90.dll_fwrite
mov edx, dword [esp + 0x40]
mov eax, dword [esp + 0x44]
push esi
push 1
push edx
push eax
call sub.MSVCR90.dll_fwrite
push edi
call fcn.00583350
mov ecx, dword [esp + 0x58]
push ecx
call fcn.00583350
add esp, 0x40
lea ecx, [esp + 0x28]
mov dword [esp + 0x4c], 0xffffffff
call fcn.00584220
mov ecx, dword [esp + 0x44]
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
mov dword fs:[0], ecx
add esp, 0x40
ret 4