Function at 0x523dd0
Capabilities:
Get file size

Disassembly:
sub esp, 8
push ebx
push esi
push edi
push 0
mov esi, ecx
call fcn.0051d5c0
mov edi, dword [esp + 0x18]
lea ecx, [esi + 0x48]
push 0xffffffffffffffff
push edi
mov dword [esi + 0x38], 0
mov dword [esi + 0x28], 0
mov dword [esi + 0x2c], 0
call fcn.00403940
push 0
push 0x100
push 4
push 0
push 1
push 0xc0000000
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0x44], eax
call ebx
mov edi, eax
test edi, edi
js 0x523e3c
jne 0x523e33
xor edi, edi
jmp 0x523e3c
movzx edi, di
or edi, 0x83ff0000
mov eax, dword [esi + 0x44]
cmp eax, 0xffffffff
je 0x523efa
cmp edi, 0x83ff00b7
jne 0x523ee4
lea ecx, [esp + 0xc]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x523e96
mov ecx, dword [esp + 0xc]
mov eax, ecx
mov edx, dword [esp + 0x10]
and eax, 0x3ffff
or eax, 0
mov dword [esi + 0x18], ecx
mov dword [esi + 0x1c], edx
jne 0x523e96
push eax
push ecx
push edx
push 4
push eax
push dword [esi + 0x44]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esi + 0x20], eax
test eax, eax
jne 0x523f05
call ebx
mov eax, dword [esi]
test eax, eax
je 0x523ea9
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [esi], 0
mov eax, dword [esi + 0x20]
test eax, eax
je 0x523ebe
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 0x20], 0
push 0
push 0
push 0
push dword [esi + 0x44]
mov dword [esi + 0x18], 0
mov dword [esi + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [esi + 0x44]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov ecx, esi
call fcn.0051ce60
mov edi, eax
test edi, edi
jns 0x523efa
push 0
mov ecx, esi
call fcn.0051d5c0
mov eax, edi
pop edi
pop esi
pop ebx
add esp, 8
ret 4
push ebp
xor ebx, ebx
mov dword [esi + 0x10], 0
xor ebp, ebp
mov dword [esi + 0x14], 0
cmp dword [esi + 0x1c], ebx
jb 0x524024
ja 0x523f2c
cmp dword [esi + 0x18], ebx
jbe 0x524024
xor edi, edi
xor ecx, ecx
mov dword [esp + 0x1c], ecx
mov eax, dword [esi]
cmp edi, dword [esi + 8]
jne 0x523f46
cmp ecx, dword [esi + 0xc]
jne 0x523f46
test eax, eax
je 0x523f55
jmp 0x523fa0
test eax, eax
je 0x523f55
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [esp + 0x1c]
push 0x40000
push edi
push ecx
push 2
push dword [esi + 0x20]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esi], eax
test eax, eax
jne 0x523f96
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
test ebp, ebp
js 0x524024
jne 0x523f83
xor ebp, ebp
jmp 0x523f8c
movzx ebp, bp
or ebp, 0x83ff0000
test ebp, ebp
js 0x524024
jmp 0x523fa2
mov eax, dword [esp + 0x1c]
mov dword [esi + 8], edi
mov dword [esi + 0xc], eax
xor ebp, ebp
mov eax, dword [esi]
push ebx
mov ecx, dword [eax + 0x20]
mov edi, dword [eax + 0x24]
mov dword [esp + 0x20], ecx
mov ecx, esi
call fcn.00513950
test edi, edi
jne 0x523fdb
cmp dword [esp + 0x1c], edi
ja 0x523fdb
test al, al
je 0x523ff6
mov eax, dword [esi + 0x34]
mov ecx, ebx
shr ecx, 5
lea edx, [eax + ecx*4]
mov ecx, ebx
mov eax, dword [edx]
and ecx, 0x1f
btr eax, ecx
jmp 0x523ff4
test al, al
je 0x523ff6
mov eax, dword [esi + 0x34]
mov ecx, ebx
shr ecx, 5
lea edx, [eax + ecx*4]
mov ecx, ebx
mov eax, dword [edx]
and ecx, 0x1f
bts eax, ecx
mov dword [edx], eax
mov edi, dword [esi + 0x10]
inc ebx
mov ecx, dword [esi + 0x14]
add edi, 0x40000
mov dword [esi + 0x10], edi
adc ecx, 0
mov dword [esi + 0x14], ecx
mov dword [esp + 0x1c], ecx
cmp ecx, dword [esi + 0x1c]
jb 0x523f34
ja 0x524024
cmp edi, dword [esi + 0x18]
jb 0x523f34
test ebp, ebp
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 0
pop ebp
jns 0x52406d
test ebx, ebx
je 0x523e96
nop
dec ebx
mov ecx, esi
push ebx
call fcn.00513950
test al, al
je 0x524064
mov eax, dword [esi + 0x34]
mov ecx, ebx
shr ecx, 5
lea edx, [eax + ecx*4]
mov ecx, ebx
mov eax, dword [edx]
and ecx, 0x1f
btr eax, ecx
mov dword [edx], eax
test ebx, ebx
jne 0x524040
jmp 0x523e96
xor edi, edi
mov eax, edi
pop edi
pop esi
pop ebx
add esp, 8
ret 4