Function at 0x10004ae0
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
mov eax, 0x16d4
call fcn.10007690
mov edx, dword [esp + 0x16d8]
push ebx
xor ebx, ebx
push edi
cmp edx, ebx
je 0x10004fd4
mov edi, dword [esp + 0x16e4]
cmp edi, ebx
je 0x10004fd4
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 0x210
jne 0x10004fd4
mov eax, dword [esp + 0x16f0]
push esi
push ebx
push ebx
push 3
push ebx
push 3
push 0xc0000000
push edx
mov dword [esp + 0x38], ebx
mov dword [eax], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x10004fc6
push ebp
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, eax
mov ecx, 0x84
xor eax, eax
lea edi, [esp + 0x2d]
mov byte [esp + 0x2c], bl
push ebx
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x18]
lea edx, [esp + 0x30]
push ecx
push 0x14
push edx
push esi
mov dword [esp + 0x28], ebx
mov dword [esp + 0x24], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10004fbe
cmp dword [esp + 0x14], 0x14
jne 0x10004fbe
mov eax, dword [str.3LBW]
mov cl, byte [0x1004b788]
mov dword [esp + 0x24], eax
mov byte [esp + 0x28], cl
lea edi, [esp + 0x24]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x2c]
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0x24]
push ecx
push edx
push eax
call fcn.10007650
add esp, 0xc
test eax, eax
jne 0x10004f30
mov ebx, dword [esp + 0x34]
mov ecx, ebx
mov dword [esp + 0x18], ebx
shl ecx, 5
add ecx, ebx
shl ecx, 4
add ecx, 0x14
cmp ecx, ebp
ja 0x10004f5f
dec ebx
test ebx, ebx
jl 0x10004e61
mov edi, ebx
shl edi, 5
add edi, ebx
shl edi, 4
add edi, 0x14
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push edi
push esi
call ebp
lea edx, [esp + 0x14]
push 0
push edx
lea eax, [esp + 0x34]
push 0x210
push eax
push esi
mov dword [esp + 0x28], 0
mov byte [esp + 0x250], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10004fbe
cmp dword [esp + 0x14], 0x210
jne 0x10004fbe
mov eax, dword [esp + 0x16ec]
mov cl, byte [esp + 0x2c]
cmp cl, byte [eax]
jne 0x10004c9b
push 8
lea edx, [esp + 0x30]
push eax
push edx
call fcn.10007650
add esp, 0xc
test eax, eax
jne 0x10004c9b
mov ecx, dword [esp + 0x16ec]
mov eax, dword [esp + 0x16f0]
add ecx, 8
push eax
lea edx, [esp + 0x38]
push ecx
push edx
call fcn.10004aa0
add esp, 0xc
test eax, eax
jne 0x10004caf
dec ebx
sub edi, 0x210
test ebx, ebx
jge 0x10004c08
jmp 0x10004e67
push str.clb_find_item
push 2
push 0x1004b504
push 0x10051088
call fcn.100059c0
mov eax, dword [esp + 0x1704]
add esp, 0x10
test eax, eax
jne 0x10004f12
push str.clb_del_item
push 2
push 0x1004b504
push 0x10051088
call fcn.100059c0
mov ecx, 0x528
xor eax, eax
lea edi, [esp + 0x251]
mov byte [esp + 0x250], 0
add esp, 0x10
inc ebx
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x18]
cmp ebx, eax
jge 0x10004dd5
sub eax, ebx
cmp eax, 0xa
mov dword [esp + 0x1c], eax
jbe 0x10004d28
mov dword [esp + 0x1c], 0xa
mov ebp, ebx
push 0
shl ebp, 5
add ebp, ebx
push 0
shl ebp, 4
lea eax, [ebp + 0x14]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edi, dword [esp + 0x1c]
mov edx, dword [esp + 0x1c]
shl edi, 5
add edi, edx
lea ecx, [esp + 0x14]
shl edi, 4
push 0
push ecx
lea edx, [esp + 0x248]
push edi
push edx
push esi
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10004fbe
cmp dword [esp + 0x14], edi
jne 0x10004fbe
push 0
add ebp, 0xfffffe04
push 0
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x248]
push edi
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10004fbe
cmp dword [esp + 0x10], edi
jne 0x10004fbe
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
add ebx, edx
cmp ebx, eax
jl 0x10004d15
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, ebx
push 0
shl edx, 5
add edx, ebx
push 0
shl edx, 4
sub edx, 0x1fc
push edx
push esi
call ebp
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [esp + 0x18]
push 0
push 0
dec eax
push 8
push esi
mov dword [esp + 0x20], 0
mov dword [esp + 0x28], eax
call ebp
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x20]
push 4
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10004fbe
cmp dword [esp + 0x10], 4
jne 0x10004fbe
mov edx, dword [esp + 0x16f8]
push esi
mov dword [esp + 0x24], 1
mov dword [edx], 1
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x20]
pop ebp
pop esi
pop edi
pop ebx
add esp, 0x16d4
ret
mov ebp, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x16f4]
xor ebx, ebx
cmp eax, ebx
je 0x10004f12
push str.clb_add_item
push 2
push 0x1004b504
push 0x10051088
call fcn.100059c0
mov edi, dword [esp + 0x28]
add esp, 0x10
inc edi
mov dword [esp + 0x10], ebx
push ebx
push ebx
push 8
push esi
mov dword [esp + 0x28], edi
call ebp
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [esp + 0x10]
push ebx
push eax
lea ecx, [esp + 0x20]
push 4
push ecx
push esi
call edi
test eax, eax
je 0x10004f9e
cmp dword [esp + 0x10], 4
jne 0x10004f9e
push 2
push ebx
push ebx
push esi
mov dword [esp + 0x20], ebx
call ebp
mov eax, dword [esp + 0x16ec]
lea edx, [esp + 0x10]
push ebx
push edx
push 0x210
push eax
push esi
call edi
test eax, eax
je 0x10004f90
cmp dword [esp + 0x10], 0x210
jne 0x10004f90
mov ecx, dword [esp + 0x16f8]
mov dword [ecx], 1
push esi
mov dword [esp + 0x24], 1
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x20]
pop ebp
pop esi
pop edi
pop ebx
add esp, 0x16d4
ret
push str.clb_file_header_error_
push 2
push 0x1004b504
push 0x10051088
call fcn.100059c0
add esp, 0x10
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x20]
pop ebp
pop esi
pop edi
pop ebx
add esp, 0x16d4
ret
push ebx
push ebp
push str.clb_file_header_counter_error___d__d
push 2
push 0x1004b504
push 0x10051088
call fcn.100059c0
add esp, 0x18
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x20]
pop ebp
pop esi
pop edi
pop ebx
add esp, 0x16d4
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.clb_write_item_failed__err__0x_08x
jmp 0x10004faa
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.clb_write_file_header_failed__err__0x_08x
push 2
push 0x1004b504
push 0x10051088
call fcn.100059c0
add esp, 0x14
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop ebp
mov eax, dword [esp + 0x1c]
pop esi
pop edi
pop ebx
add esp, 0x16d4
ret
pop edi
xor eax, eax
pop ebx
add esp, 0x16d4
ret