Function at 0x10037b00
Capabilities:
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi + 0x28], 0
je 0x10037f3f
cmp dword [edi + 0x38], 0
je 0x10037f3f
mov eax, dword [edi + 0x94]
mov ebx, 1
test eax, eax
je 0x10037b4c
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForThreadpoolWorkCallbacks]
push dword [edi + 0x94]
call dword [sym.imp.KERNEL32.dll_CloseThreadpoolWork]
mov dword [edi + 0x94], 0
test dword [edi + 4], 0x40000000
mov esi, dword [ebp + 8]
je 0x10037ed6
mov eax, dword [edi + 0x50]
lea ecx, [edi + 0x50]
and eax, dword [ecx + 4]
mov dword [ebp - 0x10], ecx
cmp eax, 0xffffffff
je 0x10037e85
cmp dword [edi + 0x58], 0
lea esi, [edi + 0x58]
je 0x10037e82
mov eax, dword [esi]
xor edx, edx
div dword [edi + 0x2c]
mov eax, edx
mov dword [ebp - 0x14], eax
test eax, eax
je 0x10037cd6
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x2c], 0
push eax
push dword [ebp + 8]
mov ecx, edi
mov dword [ebp - 0x28], 0
call fcn.10037320
test eax, eax
je 0x10037ebd
mov eax, dword [esi]
lea ecx, [edi + 0x50]
add eax, dword [ecx]
mov edx, 0
adc edx, dword [ecx + 4]
cmp edx, dword [ebp - 0x28]
ja 0x10037ca4
jb 0x10037bd9
cmp eax, dword [ebp - 0x2c]
jae 0x10037ca4
sub eax, dword [ebp - 0x14]
lea ecx, [ebp - 0x10]
push ecx
push dword [edi + 0x2c]
sbb edx, 0
mov dword [ebp - 0x10], 0
push dword [edi + 0x3c]
mov ecx, edi
push edx
push eax
push dword [ebp + 8]
call fcn.10037970
test al, al
je 0x10037ebd
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x14]
cmp ecx, edx
jbe 0x10037ca1
mov eax, dword [edi + 0x3c]
sub ecx, edx
add eax, edx
mov dword [ebp - 0x20], ecx
mov edx, dword [edi + 0x40]
sub edx, dword [esi]
mov dword [ebp - 0x1c], edx
mov edx, dword [edi + 0x38]
add edx, dword [esi]
mov dword [ebp - 0xc], edx
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x18], eax
test ecx, ecx
je 0x10037c99
cmp dword [ebp - 0xc], 0
jne 0x10037c49
call fcn.1008752b
mov dword [eax], 0x16
jmp 0x10037c94
test eax, eax
je 0x10037c60
cmp edx, ecx
jb 0x10037c60
push ecx
push eax
push dword [ebp - 0xc]
call fcn.1007d410
add esp, 0xc
jmp 0x10037c99
push edx
push 0
push dword [ebp - 0xc]
call fcn.1007cff0
add esp, 0xc
cmp dword [ebp - 0x18], 0
jne 0x10037c81
call fcn.1008752b
mov dword [eax], 0x16
jmp 0x10037c94
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x20]
jae 0x10037c99
call fcn.1008752b
mov dword [eax], 0x22
call fcn.1008079f
mov eax, dword [ebp - 0x10]
sub eax, dword [ebp - 0x14]
add dword [esi], eax
lea ecx, [edi + 0x50]
mov eax, dword [esi]
xor edx, edx
div dword [edi + 0x2c]
mov dword [ebp - 0x20], edx
test edx, edx
je 0x10037cd3
mov eax, dword [edi + 0x2c]
sub eax, edx
push eax
mov eax, dword [edi + 0x38]
add eax, dword [esi]
push 0
push eax
call fcn.1007cff0
mov eax, dword [edi + 0x2c]
lea ecx, [edi + 0x50]
sub eax, dword [ebp - 0x20]
add esp, 0xc
add dword [esi], eax
mov dword [ebp - 0x10], ecx
push ecx
push dword [esi]
mov dword [ebp - 0xc], ecx
push dword [edi + 0x38]
mov dword [ebp - 0x18], esi
push dword [ecx + 4]
mov dword [ebp - 0x14], esi
push dword [ecx]
mov ecx, edi
push dword [ebp + 8]
call fcn.10037a00
mov byte [ebp - 5], al
test al, al
jne 0x10037e61
mov esi, dword [ebp - 0x10]
mov ebx, dword [edi + 8]
mov eax, dword [edi + 0xc]
sub ebx, dword [esi]
mov dword [ebp - 0x1c], ebx
sbb eax, dword [esi + 4]
mov dword [ebp - 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x70
jne 0x10037ebd
mov eax, dword [edi + 0xc]
cmp eax, dword [esi + 4]
jb 0x10037ebd
ja 0x10037d3b
mov eax, dword [edi + 8]
cmp eax, dword [esi]
jbe 0x10037ebd
mov eax, dword [ebp - 0x20]
test eax, eax
ja 0x10037ebd
jb 0x10037d51
cmp ebx, 0xffffffff
ja 0x10037ebd
mov ecx, dword [ebp - 0x14]
test eax, eax
ja 0x10037ebd
jb 0x10037d66
cmp ebx, dword [ecx]
jae 0x10037ebd
push 0x10000000
push 7
push 0x40000000
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReOpenFile]
mov ebx, eax
mov dword [ebp - 0x20], ebx
cmp ebx, 0xffffffff
je 0x10037ebd
mov eax, dword [ebp - 0xc]
push 0
push 0
push dword [eax + 4]
push dword [eax]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x10037dc6
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
xor ebx, ebx
call eax
push dword [ebp - 0x20]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 0
push eax
push dword [ebp - 0x1c]
push dword [edi + 0x38]
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x20], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [sym.imp.KERNEL32.dll_SetLastError]
push esi
call ebx
mov esi, dword [ebp - 0x20]
test esi, esi
je 0x10037e1a
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0x14], eax
je 0x10037e16
push 0x1722
xor esi, esi
call ebx
jmp 0x10037e1a
mov byte [ebp - 5], 1
xor ebx, ebx
test esi, esi
setne bl
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [ebp - 0x2c], 0
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x28], 0
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x10037e54
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x28]
mov dword [edi + 0x10], eax
mov dword [edi + 0x14], ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp byte [ebp - 5], 0
je 0x10037e7a
mov eax, dword [ebp - 0xc]
mov dword [eax], 0xffffffff
mov dword [eax + 4], 0xffffffff
mov eax, dword [ebp - 0x18]
mov dword [eax], 0
test ebx, ebx
je 0x10037f34
mov esi, dword [ebp + 8]
test dword [edi + 4], 0x40000000
je 0x10037ed6
mov eax, dword [edi + 8]
cmp eax, dword [edi + 0x10]
jne 0x10037e9e
mov eax, dword [edi + 0xc]
cmp eax, dword [edi + 0x14]
je 0x10037ed6
mov eax, dword [edi + 8]
mov ecx, dword [edi + 0xc]
push 8
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x2c]
push eax
push 6
push esi
mov dword [ebp - 0x28], ecx
call dword [sym.imp.KERNEL32.dll_SetFileInformationByHandle]
test eax, eax
jne 0x10037eca
xor ebx, ebx
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov eax, dword [edi + 8]
mov ecx, dword [edi + 0xc]
mov dword [edi + 0x10], eax
mov dword [edi + 0x14], ecx
mov edx, dword [edi + 0xb4]
test edx, edx
je 0x10037f2c
mov eax, edx
lea ecx, [edi + 0xac]
and al, 4
movzx eax, al
neg eax
sbb eax, eax
and eax, ecx
lea ecx, [edi + 0xa4]
push eax
mov eax, edx
and al, 2
movzx eax, al
neg eax
sbb eax, eax
and dl, 1
and eax, ecx
movzx ecx, dl
neg ecx
push eax
lea eax, [edi + 0x9c]
sbb ecx, ecx
and ecx, eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov dword [edi + 0xb4], 0
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0x649
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 4