Function at 0x4a4874
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x7c
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x28], 0
cmp byte [ebx + 0x74], 0
je 0x4a48c4
mov eax, dword [ebx + 0x28]
mov eax, dword [eax + 0xa0]
mov dword [ebp - 0x28], eax
mov dword [ebx + 0x60], eax
mov dword [esp], eax
call fcn.00538984
mov dword [ebx + 0x30], eax
mov esi, dword [ebx + 0x28]
add esi, 0xa4
mov ecx, dword [ebx + 0x60]
mov edi, eax
rep movsb byte es:[edi], byte [esi]
mov al, 1
add esp, 0x7c
pop ebx
pop esi
pop edi
leave
ret
lea edx, [ebp - 0x50]
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx]
call fcn.004a4464
mov byte [ebp - 0x60], al
lea eax, [ebp - 0x19]
mov dword [esp + 8], eax
mov eax, dword [ebx + 8]
mov dword [esp + 4], eax
lea esi, [ebp - 0x2c]
mov dword [esp], esi
call fcn.00509af0
mov dword [esp + 4], 0x56af4a
mov dword [esp], esi
call fcn.004e32e4
mov esi, eax
mov eax, dword [ebp - 0x2c]
lea edi, [eax - 0xc]
cmp edi, 0x55a154
jne 0x4a4c4c
test esi, esi
jne 0x4a4980
mov al, byte [ebp - 0x60]
dec eax
cmp al, 1
jbe 0x4a4a1c
lea eax, [ebp - 0x1d]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Error_this_CSDB_command_requires_a_payload
lea esi, [ebp - 0x3c]
mov dword [esp], esi
call fcn.00509af0
mov dword [esp], 8
call fcn.00538b64
mov edi, eax
mov dword [esp + 4], esi
mov dword [esp], eax
call fcn.005167d8
mov eax, dword [ebp - 0x3c]
lea esi, [eax - 0xc]
mov edx, 0x55a154
cmp edx, esi
jne 0x4a4da0
mov dword [esp + 8], 0x516950
mov dword [esp + 4], 0x572394
mov dword [esp], edi
call fcn.00539374
mov eax, dword [ebx + 8]
mov dword [ebp - 0x60], eax
mov dword [esp + 4], 0x56acbe
mov dword [esp], eax
call sub.msvcrt.dll_fopen
mov esi, eax
test eax, eax
je 0x4a4cd4
mov dword [esp], eax
call sub.msvcrt.dll_rewind
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], esi
call sub.msvcrt.dll_fseek
mov dword [esp], esi
call sub.msvcrt.dll_ftell
mov edi, eax
mov dword [esp], esi
call sub.msvcrt.dll_rewind
mov dword [ebx + 0x60], edi
test edi, edi
je 0x4a4b4c
mov dword [esp], edi
call fcn.00538984
mov dword [ebx + 0x30], eax
test eax, eax
je 0x4a4d48
mov dword [esp + 0xc], esi
mov edx, dword [ebx + 0x60]
mov dword [esp + 8], edx
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.msvcrt.dll_fread
cmp dword [ebx + 0x60], eax
jne 0x4a4bf4
mov dword [esp], esi
call sub.msvcrt.dll_fclose
mov eax, dword [ebx + 0x60]
xor esi, esi
cmp eax, 4
ja 0x4a4ba4
add eax, 0x10
cmp eax, 0x20000
jbe 0x4a4a88
lea eax, [ebp - 0x1f]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Error_CSDB_payload_too_large
lea esi, [ebp - 0x44]
mov dword [esp], esi
call fcn.00509af0
mov dword [esp], 8
call fcn.00538b64
mov edi, eax
mov dword [esp + 4], esi
mov dword [esp], eax
call fcn.005167d8
mov dword [esp], esi
call fcn.0050a12c
mov dword [esp + 8], 0x516950
mov dword [esp + 4], 0x572394
mov dword [esp], edi
call fcn.00539374
mov dword [esp], eax
call fcn.00538984
mov dword [ebp - 0x60], eax
mov dword [eax], 0x42445343
mov byte [eax + 4], 1
lea edx, [ebp - 0x50]
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx]
call fcn.004a4464
mov edx, dword [ebp - 0x60]
mov byte [edx + 5], al
mov eax, dword [ebx + 0x60]
add eax, 0x10
mov dword [ebp - 0x28], eax
mov dword [edx + 8], eax
mov eax, edx
add eax, 0xc
mov esi, dword [ebx + 0x30]
mov ecx, dword [ebx + 0x60]
mov edi, eax
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebx + 0x60]
add eax, 0x10
mov dword [ebx + 0x60], eax
mov edx, dword [ebx + 0x30]
test edx, edx
je 0x4a4ae6
mov dword [esp], edx
call fcn.00538958
mov eax, dword [ebx + 0x60]
mov dword [esp], eax
call fcn.00538984
mov dword [ebx + 0x30], eax
test eax, eax
je 0x4a4aff
mov ecx, dword [ebx + 0x60]
mov edi, eax
mov esi, dword [ebp - 0x60]
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 0x60]
test ecx, ecx
je 0x4a4b11
mov eax, dword [ebp - 0x60]
mov dword [esp], eax
call fcn.00538958
mov dword [esp + 8], 0x20000
mov eax, dword [ebx + 0x60]
mov dword [esp + 4], eax
lea eax, [ebx + 0x30]
mov dword [esp], eax
call fcn.004ca058
mov dword [ebx + 0x60], 0x20000
mov dword [esp], ebx
call fcn.004a23e4
test al, al
je 0x4a4c80
mov al, 1
jmp 0x4a48b9
lea eax, [ebp - 0x1a]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Error_CSDB_payload_size_equals_0
lea edi, [ebp - 0x30]
mov dword [esp], edi
call fcn.00509af0
mov dword [esp], 8
call fcn.00538b64
mov dword [ebp - 0x5c], eax
mov dword [esp + 4], edi
mov dword [esp], eax
call fcn.005167d8
mov dword [esp], edi
call fcn.0050a12c
mov dword [esp + 8], 0x516950
mov dword [esp + 4], 0x572394
mov edx, dword [ebp - 0x5c]
mov dword [esp], edx
call fcn.00539374
lea eax, [ebp - 0x1e]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 4
mov eax, dword [ebx + 0x30]
mov dword [esp + 4], eax
lea edi, [ebp - 0x40]
mov dword [esp], edi
call fcn.00509b3c
mov esi, 1
mov dword [esp + 4], str.CSDB
mov dword [esp], edi
call fcn.004e32e4
mov esi, eax
mov dword [esp], edi
call fcn.0050a12c
test esi, esi
je 0x4a4b11
mov eax, dword [ebx + 0x60]
jmp 0x4a4a2a
lea eax, [ebp - 0x1c]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Error_reading_CSDB_from_file
lea edi, [ebp - 0x38]
mov dword [esp], edi
call fcn.00509af0
mov dword [esp], 8
call fcn.00538b64
mov dword [ebp - 0x5c], eax
mov dword [esp + 4], edi
mov dword [esp], eax
call fcn.005167d8
mov dword [esp], edi
call fcn.0050a12c
mov dword [esp + 8], 0x516950
mov dword [esp + 4], 0x572394
mov ecx, dword [ebp - 0x5c]
mov dword [esp], ecx
call fcn.00539374
cmp dword [0x554500], 0
jne 0x4a4dd2
mov eax, dword [edi + 8]
lea edx, [eax - 1]
mov dword [edi + 8], edx
test eax, eax
jg 0x4a4911
lea eax, [ebp - 0x22]
mov dword [esp + 4], eax
mov dword [esp], edi
call fcn.005084ec
jmp 0x4a4911
lea eax, [ebp - 0x20]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Error_restructuring_FUPH
lea esi, [ebp - 0x48]
mov dword [esp], esi
call fcn.00509af0
mov dword [esp], 8
call fcn.00538b64
mov edi, eax
mov dword [esp + 4], esi
mov dword [esp], eax
call fcn.005167d8
mov dword [esp], esi
call fcn.0050a12c
mov dword [esp + 8], 0x516950
mov dword [esp + 4], 0x572394
mov dword [esp], edi
call fcn.00539374
lea eax, [ebp - 0x23]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x56ae6b
lea edx, [ebp - 0x50]
mov dword [esp], edx
call fcn.00509af0
xor eax, eax
mov ecx, 0xffffffff
mov edi, dword [ebp - 0x60]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 8], ecx
mov ecx, dword [ebp - 0x60]
mov dword [esp + 4], ecx
lea eax, [ebp - 0x50]
mov dword [esp], eax
call fcn.00508920
mov dword [esp], 8
call fcn.00538b64
mov esi, eax
lea edx, [ebp - 0x50]
mov dword [esp + 4], edx
mov dword [esp], eax
call fcn.005167d8
mov dword [esp + 8], 0x516950
mov dword [esp + 4], 0x572394
mov dword [esp], esi
call fcn.00539374
lea eax, [ebp - 0x1b]
mov dword [esp + 8], eax
mov dword [esp + 4], str.Error_allocating_CSDB_buffer
lea edi, [ebp - 0x34]
mov dword [esp], edi
call fcn.00509af0
mov dword [esp], 8
call fcn.00538b64
mov dword [ebp - 0x5c], eax
mov dword [esp + 4], edi
mov dword [esp], eax
call fcn.005167d8
mov dword [esp], edi
call fcn.0050a12c
mov dword [esp + 8], 0x516950
mov dword [esp + 4], 0x572394
mov eax, dword [ebp - 0x5c]
mov dword [esp], eax
call fcn.00539374
cmp dword [0x554500], 0
jne 0x4a5030
mov eax, dword [esi + 8]
lea edx, [eax - 1]
mov dword [esi + 8], edx
test eax, eax
jg 0x4a4968
lea eax, [ebp - 0x24]
mov dword [esp + 4], eax
mov dword [esp], esi
call fcn.005084ec
jmp 0x4a4968
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004dd8dc
jmp 0x4a4c62
mov dword [esp + 4], 0xffffffff
sub eax, 4
mov dword [esp], eax
call fcn.004dd8dc
jmp 0x4a4db6