Function at 0x40f690
Capabilities:
Read file on windows
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x46c
mov eax, dword [0x42d0f0]
xor eax, esp
mov dword [esp + 0x468], eax
mov eax, dword [esp + 0x470]
push ebx
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x484]
push esi
mov esi, dword [esp + 0x47c]
xor edx, edx
push edi
mov dword [esp + 0x44], eax
cmp eax, edx
je 0x40f6cf
mov dword [eax], edx
mov dword [eax + 4], edx
mov edi, dword [esp + 0x484]
mov ebx, dword [esp + 0x488]
mov ecx, edi
or ecx, ebx
jne 0x40f6fd
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [esp + 0x468]
xor ecx, esp
call fcn.00411002
add esp, 0x46c
ret
mov ecx, dword [esi + 0x38]
push ebp
mov ebp, dword [esi + 0x3c]
add ecx, 1
adc ebp, edx
mov eax, ebp
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], edx
mov dword [esp + 0x28], edx
mov dword [esp + 0x20], ecx
test eax, eax
jb 0x40f867
ja 0x40f72d
test ecx, ecx
jbe 0x40f867
mov edx, dword [esp + 0x18]
mov eax, dword [edx + 0xfc]
mov dword [esp + 0x1c], eax
jmp 0x40f740
mov eax, dword [esp + 0x1c]
cmp eax, 0xc
jne 0x40f75b
test ebx, ebx
ja 0x40f863
jb 0x40f78d
cmp edi, 0xff8
jmp 0x40f787
cmp eax, 0x10
jne 0x40f772
test ebx, ebx
ja 0x40f863
jb 0x40f78d
cmp edi, 0xfff8
jmp 0x40f787
cmp eax, 0x20
jne 0x40f78d
test ebx, ebx
ja 0x40f863
jb 0x40f78d
cmp edi, 0xffffff8
jae 0x40f863
test ebx, ebx
ja 0x40f79a
cmp edi, 2
jb 0x40fcc6
cmp ebx, ebp
ja 0x40fcc6
jb 0x40f7ae
cmp edi, dword [esp + 0x20]
ja 0x40fcc6
mov ecx, dword [esi + 4]
mov edx, dword [esi]
mov eax, dword [esi + 0xc]
push ecx
mov ecx, dword [esi + 8]
push edx
push eax
push ecx
call fcn.00412be0
add dword [esp + 0x2c], eax
adc dword [esp + 0x30], edx
cmp dword [esp + 0x1c], 0xc
je 0x40f7f8
mov eax, dword [esp + 0x1c]
cmp eax, 0x10
je 0x40f7ef
cmp eax, 0x20
jne 0x40f843
mov edx, dword [esi + 0x40]
mov edi, dword [edx + edi*4]
and edi, 0xfffffff
xor ebx, ebx
jmp 0x40f843
mov eax, dword [esi + 0x40]
movzx eax, word [eax + edi*2]
jmp 0x40f83e
mov ecx, edi
and ecx, 1
mov dword [esp + 0x60], ecx
mov eax, 0
je 0x40f824
test eax, eax
jne 0x40f824
mov edx, edi
shrd edx, ebx, 1
add edx, dword [esi + 0x40]
shr ebx, 1
mov ax, word [edx + edi]
shr ax, 4
movzx eax, ax
jmp 0x40f83e
mov ecx, edi
shrd ecx, ebx, 1
add ecx, dword [esi + 0x40]
mov eax, 0xfff
mov dx, word [ecx + edi]
shr ebx, 1
and dx, ax
movzx eax, dx
cdq
mov edi, eax
mov ebx, edx
mov eax, dword [esp + 0x28]
inc eax
mov dword [esp + 0x28], eax
cdq
mov ecx, ebp
cmp edx, ecx
jb 0x40f740
ja 0x40f863
cmp eax, dword [esp + 0x20]
jb 0x40f740
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x28]
cdq
cmp edx, ebp
jb 0x40f895
ja 0x40f876
cmp eax, ecx
jb 0x40f895
mov ecx, dword [esp + 0x18]
mov edx, dword [ecx + 0x22c]
push str.Infinite_loop_in_FAT_detected__perhaps_the_disk_is_corrupted.
push 0
push 2
call edx
add esp, 0xc
xor eax, eax
jmp 0x40fd25
cmp dword [esp + 0x30], 0
ja 0x40f8a3
cmp dword [esp + 0x2c], 0xffffffff
jbe 0x40f8cc
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x18]
push eax
mov eax, dword [edx + 0x22c]
push ecx
push str.Directory_is_too_big___I64u_bytes
push 0
push 2
call eax
add esp, 0x14
xor eax, eax
jmp 0x40fd25
mov ecx, dword [esp + 0x2c]
push ecx
call fcn.00412a5f
add esp, 4
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x40f8ff
mov edx, dword [esp + 0x18]
push str.Error:_malloc___returned_NULL.
push eax
mov eax, dword [edx + 0x22c]
push 2
call eax
add esp, 0xc
xor eax, eax
jmp 0x40fd25
mov eax, dword [esi + 0x38]
mov ebx, dword [esp + 0x488]
mov ebp, dword [esp + 0x48c]
xor ecx, ecx
xor edi, edi
add eax, 1
mov dword [esp + 0x20], eax
mov eax, dword [esi + 0x3c]
adc eax, ecx
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], ecx
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], ebp
mov dword [esp + 0x28], ecx
mov dword [esp + 0x24], eax
cmp eax, ecx
jb 0x40fd0c
ja 0x40f950
cmp dword [esp + 0x20], ecx
jbe 0x40fd0c
lea esp, [esp]
mov edx, dword [esp + 0x18]
mov eax, dword [edx + 0xfc]
cmp eax, 0xc
jne 0x40f97a
cmp dword [esp + 0x14], 0
ja 0x40fbc5
jb 0x40f97a
cmp dword [esp + 0x10], 0xff8
jae 0x40fbc5
cmp eax, 0x10
jne 0x40f99a
cmp dword [esp + 0x14], 0
ja 0x40fbc5
jb 0x40f99a
cmp dword [esp + 0x10], 0xfff8
jae 0x40fbc5
cmp eax, 0x20
jne 0x40f9ba
cmp dword [esp + 0x14], 0
ja 0x40fbc5
jb 0x40f9ba
cmp dword [esp + 0x10], 0xffffff8
jae 0x40fbc5
cmp dword [esp + 0x14], 0
ja 0x40f9cc
cmp dword [esp + 0x10], 2
jb 0x40fbc5
mov eax, dword [esp + 0x14]
cmp eax, dword [esp + 0x24]
ja 0x40fbc5
jb 0x40f9ea
mov edx, dword [esp + 0x20]
cmp dword [esp + 0x10], edx
ja 0x40fbc5
mov eax, ecx
add eax, 1
mov edx, edi
adc edx, 0
mov dword [esp + 0x6c], edx
cmp dword [esp + 0x10], eax
jne 0x40fa0a
mov eax, dword [esp + 0x14]
cmp eax, edx
je 0x40fad8
mov edx, ecx
or edx, edi
je 0x40fad8
mov edx, dword [esi + 0xc]
mov eax, dword [esi + 8]
sub ecx, ebx
sbb edi, ebp
push edx
add ecx, 1
push eax
adc edi, 0
push edi
push ecx
call fcn.00412be0
mov ecx, dword [esi + 4]
push ecx
mov ecx, dword [esi]
push ecx
push edx
push eax
call fcn.00412be0
mov edi, eax
mov eax, dword [esi + 0xc]
push eax
mov eax, dword [esi + 8]
add ebx, 0xfffffffe
push eax
adc ebp, 0xffffffff
push ebp
push ebx
mov dword [esp + 0x50], edx
call fcn.00412be0
mov ecx, eax
add ecx, dword [esi + 0x20]
mov eax, dword [esi + 4]
adc edx, dword [esi + 0x24]
push eax
mov eax, dword [esi]
push eax
push edx
push ecx
call fcn.00412be0
mov ebx, dword [esp + 0x18]
push edx
push eax
mov dword [esp + 0x60], edx
mov edx, dword [esp + 0x48]
push edx
push edi
push str.Reading_directory_fragment___I64u_bytes_at_offset_I64u.
mov dword [esp + 0x68], eax
mov eax, dword [ebx + 0x22c]
push 0
push 6
mov dword [esp + 0x78], 0
call eax
mov eax, dword [esp + 0x50]
add esp, 0x1c
lea ecx, [esp + 0x4c]
push ecx
mov ecx, dword [esp + 0x20]
lea edx, [esp + 0x48]
push edx
mov edx, dword [ebx + 0x20]
push edi
add eax, ecx
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40fcca
add dword [esp + 0x34], edi
mov eax, dword [esp + 0x40]
mov ebx, dword [esp + 0x10]
adc dword [esp + 0x38], eax
mov ebp, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov eax, dword [edx + 0xfc]
mov ecx, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
cmp eax, 0xc
je 0x40fb24
cmp eax, 0x10
je 0x40fb17
cmp eax, 0x20
jne 0x40fb87
mov eax, dword [esi + 0x40]
mov edx, dword [eax + ecx*4]
and edx, 0xfffffff
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], 0
jmp 0x40fb87
mov eax, dword [esi + 0x40]
mov edx, dword [esp + 0x10]
movzx eax, word [eax + edx*2]
jmp 0x40fb7e
mov eax, ecx
and eax, 1
mov dword [esp + 0x70], eax
mov eax, 0
je 0x40fb5a
test eax, eax
jne 0x40fb5a
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
shrd edx, eax, 1
add edx, dword [esi + 0x40]
shr eax, 1
mov eax, dword [esp + 0x10]
mov dx, word [edx + eax]
shr dx, 4
movzx eax, dx
jmp 0x40fb7e
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
shrd eax, edx, 1
add eax, dword [esi + 0x40]
shr edx, 1
mov edx, dword [esp + 0x10]
mov ax, word [eax + edx]
mov edx, 0xfff
and ax, dx
movzx eax, ax
cdq
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x28]
mov eax, dword [esi + 0x38]
inc edx
add eax, 1
mov dword [esp + 0x20], eax
mov eax, dword [esi + 0x3c]
adc eax, 0
mov dword [esp + 0x24], eax
mov eax, edx
mov dword [esp + 0x28], edx
cdq
mov dword [esp + 0x60], eax
cmp edx, dword [esp + 0x24]
jb 0x40f950
ja 0x40fbc5
mov eax, dword [esp + 0x20]
cmp dword [esp + 0x60], eax
jb 0x40f950
mov eax, ecx
or eax, edi
je 0x40fd0c
mov edx, dword [esi + 0xc]
mov eax, dword [esi + 8]
sub ecx, ebx
sbb edi, ebp
push edx
add ecx, 1
push eax
adc edi, 0
push edi
push ecx
call fcn.00412be0
mov ecx, dword [esi + 4]
push ecx
mov dword [esp + 0x28], ecx
mov ecx, dword [esi]
push ecx
push edx
push eax
mov dword [esp + 0x30], ecx
call fcn.00412be0
mov edi, eax
mov eax, dword [esi + 0xc]
push eax
mov eax, dword [esi + 8]
add ebx, 0xfffffffe
push eax
adc ebp, 0xffffffff
push ebp
push ebx
mov dword [esp + 0x50], edx
call fcn.00412be0
add eax, dword [esi + 0x20]
mov ecx, dword [esp + 0x24]
adc edx, dword [esi + 0x24]
push ecx
mov ecx, dword [esp + 0x24]
push ecx
push edx
push eax
call fcn.00412be0
mov esi, dword [esp + 0x18]
push edx
push eax
mov dword [esp + 0x60], edx
mov edx, dword [esp + 0x48]
push edx
push edi
push str.Reading_directory_fragment___I64u_bytes_at_offset_I64u.
mov dword [esp + 0x68], eax
mov eax, dword [esi + 0x22c]
push 0
push 6
mov dword [esp + 0x78], 0
call eax
mov eax, dword [esp + 0x50]
add esp, 0x1c
lea ecx, [esp + 0x4c]
push ecx
mov ecx, dword [esp + 0x20]
lea edx, [esp + 0x48]
push edx
mov edx, dword [esi + 0x20]
push edi
add eax, ecx
push eax
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40fd0c
push 0x200
lea eax, [esp + 0x7c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.JkDefrag.exe_SystemErrorStr
lea ecx, [esp + 0x84]
push ecx
push str.Error:__s
mov edx, esi
mov eax, dword [edx + 0x22c]
push 0
push 2
call eax
mov ecx, dword [esp + 0x38]
push ecx
call fcn.00412c14
add esp, 0x20
xor eax, eax
jmp 0x40fd25
push 0x200
lea ecx, [esp + 0x7c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call sym.JkDefrag.exe_SystemErrorStr
lea edx, [esp + 0x84]
push edx
push str.Error:__s
mov eax, ebx
mov ecx, dword [eax + 0x22c]
push 0
push 2
call ecx
mov edx, dword [esp + 0x38]
push edx
call fcn.00412c14
add esp, 0x20
xor eax, eax
jmp 0x40fd25
mov eax, dword [esp + 0x48]
test eax, eax
je 0x40fd21
mov edx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x30]
mov dword [eax], edx
mov dword [eax + 4], ecx
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x478]
pop ebp
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00411002
add esp, 0x46c
ret