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

Disassembly:
mov eax, 0xf2f8
call fcn.0046be90
mov eax, dword [0x4b77c0]
xor eax, esp
mov dword [esp + 0xf2f4], eax
push ebx
mov ebx, dword [esp + 0xf300]
push ebp
push esi
mov esi, dword [esp + 0xf30c]
push edi
xor edi, edi
push 0x103
lea eax, [esp + 0x1b5]
push edi
push eax
mov dword [esp + 0x24], ebx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x68], edi
mov dword [esp + 0x4c], edi
mov dword [esp + 0x64], edi
mov byte [esp + 0x1bc], 0
call fcn.0046bf90
push 0x103
lea ecx, [esp + 0xbd]
push edi
push ecx
mov byte [esp + 0xc4], 0
call fcn.0046bf90
mov ebp, dword [esi + 8]
mov edx, dword [esi + 0x44]
mov dword [esp + 0x9c], edi
mov dword [esp + 0xa0], edi
push 0x200000
mov dword [esp + 0x48], edi
mov dword [esp + 0x94], edi
mov dword [esp + 0xac], ebp
mov dword [esp + 0x90], edx
mov dword [0x4b9408], 1
call fcn.0046bdb1
add esp, 0x1c
mov dword [esp + 0x20], eax
cmp eax, edi
jne 0x40280e
lea esi, [edi + 2]
jmp 0x40315d
push 0x200
call fcn.0046bdb1
add esp, 4
mov dword [esp + 0x40], eax
cmp eax, edi
jne 0x40282d
mov esi, 2
jmp 0x40315d
push 0x200
push eax
call dword [sym.imp.KERNEL32.dll_VirtualLock]
cmp dword [esp + 0xf314], edi
je 0x402861
push 0x200000
call fcn.0046bdb1
add esp, 4
mov dword [esp + 0x58], eax
cmp eax, edi
jne 0x402861
mov esi, 2
jmp 0x40315d
call fcn.0042bfd0
mov dword [esp + 0x1c], eax
cmp eax, edi
jne 0x402878
mov esi, 2
jmp 0x40315d
push ebp
call fcn.00433650
mov esi, edx
add esp, 4
cmp esi, edi
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], esi
jg 0x40289f
jl 0x402895
cmp eax, edi
jae 0x40289f
mov esi, 1
jmp 0x40315d
cmp ebx, 0xffffffff
jne 0x4029cd
lea edx, [esp + 0x69c]
mov eax, ebp
sub edx, ebp
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x4028b3
lea eax, [esp + 0x69c]
push eax
call fcn.00430d20
push edi
lea ecx, [esp + 0xb4]
push ecx
lea edx, [esp + 0x1bc]
push edx
push ebp
call fcn.00430590
add esp, 0x14
test eax, eax
je 0x4028f2
mov esi, 1
jmp 0x40315d
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileA]
or ebx, 0xffffffff
xor ebp, ebp
lea ecx, [ecx]
mov eax, ebp
inc ebp
cmp eax, 0x1f4
jge 0x40294e
push edi
push SysReAllocStringLen
push 3
push edi
push edi
push 0xc0000000
lea ecx, [esp + 0xc4]
push ecx
call esi
cmp ebp, 1
mov ebx, eax
jle 0x402932
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp ebx, 0xffffffff
je 0x402900
mov dword [esp + 0x18], ebx
cmp ebx, 0xffffffff
jne 0x4029c9
mov esi, 0x1c
jmp 0x40315d
cmp ebx, 0xffffffff
jne 0x402937
push edi
push SysReAllocStringLen
push 3
push edi
push 3
push 0xc0000000
lea edx, [esp + 0xc4]
push edx
call esi
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40299f
push str.DEVICE_IN_USE_INPLACE_ENC
call fcn.00433ef0
add esp, 4
cmp eax, 7
jne 0x402937
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x18], 0xffffffff
mov esi, 0x1c
jmp 0x40315d
mov eax, dword [0x4dce6c]
push eax
call fcn.00434ad0
push str.INPLACE_ENC_CANT_ACCESS_OR_GET_INFO_ON_VOL
call fcn.00433d70
add esp, 8
mov dword [esp + 0x18], 0xffffffff
mov esi, 0x1c
jmp 0x40315d
mov esi, dword [esp + 0x38]
mov ebp, dword [sym.imp.KERNEL32.dll_DeviceIoControl]
push edi
lea ecx, [esp + 0x90]
push ecx
push edi
push edi
push edi
push edi
push 0x90083
push ebx
call ebp
push edi
lea edx, [esp + 0x90]
push edx
push 0x18
lea eax, [esp + 0xa0]
push eax
push edi
push edi
push 0x70000
push ebx
call ebp
test eax, eax
jne 0x402a11
lea esi, [eax + 1]
jmp 0x40315d
mov ecx, dword [esp + 0xa8]
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x1c]
push esi
push edx
mov edx, dword [esp + 0x7c]
push eax
mov dword [esp + 0x70], ecx
lea ecx, [esp + 0x1c]
push ecx
push edx
mov eax, ebx
call fcn.00401f20
mov esi, eax
add esp, 0x14
cmp esi, edi
jne 0x40315d
mov ebp, dword [esp + 0x10]
mov eax, dword [ebp + 0x4448]
mov ecx, dword [ebp + 0x444c]
mov edx, dword [ebp + 0x4458]
mov ebx, dword [ebp + 0x445c]
mov esi, eax
sub esi, edx
push ecx
push eax
mov dword [esp + 0x2c], esi
mov esi, ecx
sbb esi, ebx
push ebx
push edx
mov dword [esp + 0x38], esi
mov dword [esp + 0x58], edi
mov dword [esp + 0x5c], edi
call fcn.00401c80
add esp, 0x10
mov dword [0x4b94e8], 3
mov dword [0x4b940c], 1
cmp esi, edi
ja 0x402aa7
cmp dword [esp + 0x24], edi
jbe 0x402fc7
mov ebx, dword [esp + 0x18]
jmp 0x402ab4
mov ebp, dword [esp + 0x10]
mov ecx, dword [esp + 0x28]
test ecx, ecx
ja 0x402ace
jb 0x402ac8
cmp dword [esp + 0x24], 0x200000
jae 0x402ace
mov esi, dword [esp + 0x24]
jmp 0x402ad3
mov esi, 0x200000
test esi, 0x1ff
jne 0x402eb8
mov eax, dword [esp + 0x24]
xor edi, edi
sub eax, esi
sbb ecx, edi
mov dword [esp + 0x7c], eax
add eax, 0x20000
mov dword [esp + 0x80], ecx
adc ecx, edi
shrd eax, ecx, 9
shr ecx, 9
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], ecx
lea ebx, [ebx]
mov eax, dword [ebp + 0x4450]
mov ecx, dword [ebp + 0x4454]
sub eax, esi
push 0
sbb ecx, edi
sub eax, 0x20000
push 0
sbb ecx, 0
push ecx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x402faf
mov ecx, dword [esp + 0x20]
push 0
lea eax, [esp + 0x48]
push eax
push esi
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x402bfc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
push ebp
mov dword [esp + 0x34], ebp
call fcn.00430670
add esp, 4
test eax, eax
je 0x402ec6
mov edx, dword [0x4b9490]
test edx, edx
jne 0x402ec6
mov ebp, dword [esp + 0xf318]
mov eax, dword [ebp]
test eax, eax
jne 0x402baa
push str.ENABLE_BAD_SECTOR_ZEROING
call fcn.00433e50
xor ecx, ecx
add esp, 4
cmp eax, 6
sete cl
mov dword [ebp], ecx
mov edx, dword [ebp]
test edx, edx
je 0x402ec2
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx + 0x4450]
mov ecx, dword [ecx + 0x4454]
lea edx, [esp + 0x84]
push edx
mov edx, dword [esp + 0x68]
push edx
sub eax, esi
sbb ecx, edi
push edi
sub eax, 0x20000
push esi
sbb ecx, 0
push ecx
push eax
push ebx
call fcn.00401df0
add esp, 0x1c
test eax, eax
jne 0x402faf
mov ebp, dword [esp + 0x10]
jmp 0x402b10
cmp dword [esp + 0x80], 0
ja 0x402c4c
jb 0x402c12
cmp dword [esp + 0x7c], 0x2000
jae 0x402c4c
xor ecx, ecx
mov ebx, esi
sub ebx, dword [esp + 0x24]
mov ebp, edi
sbb ebp, dword [esp + 0x28]
add ebx, 0x2000
adc ebp, ecx
test ebp, ebp
jb 0x402c4c
ja 0x402c32
test ebx, ebx
jbe 0x402c4c
mov eax, dword [esp + 0x20]
mov dl, byte [ecx + eax]
not dl
mov byte [ecx + eax], dl
inc ecx
mov eax, ecx
cdq
cmp edx, ebp
jb 0x402c32
ja 0x402c4c
cmp eax, ebx
jb 0x402c32
mov ecx, dword [esp + 0x10]
push ecx
mov eax, esi
shr eax, 9
push eax
lea edx, [esp + 0x70]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x28]
push edx
push eax
call fcn.0042c1b0
mov edx, dword [esp + 0xf324]
add esp, 0x10
test edx, edx
je 0x402d99
mov ecx, dword [esp + 0x10]
mov eax, dword [ecx + 0x4450]
sub eax, esi
mov dword [esp + 0x50], eax
mov eax, dword [ecx + 0x4454]
sbb eax, edi
push edx
mov dword [esp + 0x58], eax
mov byte [esp + 0x1b], 1
call fcn.0045a3f0
add esp, 4
cmp eax, 1
jl 0x402d87
mov ebx, dword [esp + 0x58]
mov ebp, 1
jmp 0x402cc0
mov edx, dword [esp + 0xf314]
push esi
push ebx
push ebp
lea ecx, [esp + 0x6c]
push ecx
push edx
call fcn.0045a440
add esp, 0x14
test eax, eax
jne 0x402d29
test esi, esi
jbe 0x402d02
mov ebp, dword [esp + 0x20]
mov eax, ebx
sub ebp, ebx
mov dword [esp + 0x70], esi
lea esp, [esp]
mov cl, byte [eax + ebp]
add cl, byte [esp + 0x17]
inc eax
sub dword [esp + 0x70], 1
mov byte [eax - 1], cl
jne 0x402cf0
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x30]
push edx
push eax
lea ecx, [esp + 0x70]
push ecx
push ebx
call fcn.0042c1b0
mov dx, word [ebx]
mov al, byte [ebx + 2]
add esp, 0x10
mov word [esp + 0x3c], dx
mov byte [esp + 0x3e], al
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x50]
mov ebp, dword [esp + 0x18]
push 0
push 0
push ecx
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x402ed7
push 0
lea eax, [esp + 0x48]
push eax
push esi
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x402ed7
mov al, byte [esp + 0x17]
mov ecx, dword [esp + 0xf314]
inc al
push ecx
mov byte [esp + 0x1b], al
movzx ebp, al
call fcn.0045a3f0
add esp, 4
cmp ebp, eax
jle 0x402cc0
mov dx, word [esp + 0x3c]
mov al, byte [esp + 0x3e]
mov word [esp + 0x60], dx
mov byte [esp + 0x62], al
mov eax, dword [esp + 0x10]
mov ebp, dword [eax + 0x4450]
mov eax, dword [eax + 0x4454]
mov ebx, dword [esp + 0x18]
push 0
sub ebp, esi
push 0
sbb eax, edi
push eax
push ebp
push ebx
mov dword [esp + 0x68], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x402faf
mov edx, dword [esp + 0x20]
push 0
lea ecx, [esp + 0x48]
push ecx
push esi
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x402f4a
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x80]
add eax, 0x4450
sub dword [eax], esi
mov dword [esp + 0x28], ecx
mov dword [esp + 0x78], 1
sbb dword [eax + 4], edi
mov eax, dword [esp + 0x10]
add eax, 0x4458
add dword [eax], esi
adc dword [eax + 4], edi
add dword [esp + 0x48], esi
mov eax, dword [esp + 0x7c]
mov dword [esp + 0x24], eax
adc dword [esp + 0x4c], edi
jne 0x402e31
cmp dword [esp + 0x48], 0x4000000
jb 0x402e64
mov edx, dword [esp + 0x38]
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x10]
push edx
mov edx, dword [esp + 0x20]
push eax
push ecx
push edx
push ebx
call fcn.004017d0
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x40315d
mov ebx, dword [esp + 0x18]
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x444c]
mov edx, dword [eax + 0x4448]
push ecx
mov ecx, dword [eax + 0x445c]
push edx
mov edx, dword [eax + 0x4458]
push ecx
push edx
call fcn.00401c80
mov eax, dword [0x4b9490]
add esp, 0x10
test eax, eax
jne 0x402fb9
cmp dword [esp + 0x28], eax
ja 0x402ab0
jb 0x402fc1
cmp dword [esp + 0x24], eax
ja 0x402ab0
jmp 0x402fc1
mov esi, 0x1e
jmp 0x40315d
mov ebp, dword [esp + 0x30]
push ebp
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov esi, 1
jmp 0x40315d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp esi, 0x20000
jbe 0x402f39
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x50]
push 0
push 0
push ecx
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x402f39
mov eax, dword [esp + 0x10]
mov edi, dword [esp + 0x20]
push eax
mov ecx, esi
shr ecx, 9
push ecx
lea edx, [esp + 0x70]
push edx
push edi
call fcn.0042c1d0
add esp, 0x10
push 0
lea eax, [esp + 0x48]
push eax
add esi, 0xfffe0000
push esi
add edi, 0x20000
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov esi, 1
jmp 0x40315d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp esi, 0x20000
jbe 0x402fa8
mov ecx, dword [esp + 0x54]
push 0
push 0
push ecx
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x402fa8
mov edx, dword [esp + 0x10]
mov ebp, dword [esp + 0x20]
push edx
mov eax, esi
shr eax, 9
push eax
lea ecx, [esp + 0x70]
push ecx
push ebp
call fcn.0042c1d0
add esp, 0x10
push 0
lea edx, [esp + 0x48]
push edx
add esi, 0xfffe0000
push esi
add ebp, 0x20000
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov esi, 1
jmp 0x40315d
mov dword [esp + 0x2c], 1
mov ebp, dword [esp + 0x10]
xor edi, edi
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x34]
mov ebx, dword [esp + 0x1c]
mov edx, dword [esp + 0x18]
push eax
push ecx
push ebp
push ebx
push edx
call fcn.004017d0
mov esi, eax
add esp, 0x14
cmp esi, edi
jne 0x40315d
cmp dword [esp + 0x2c], edi
jne 0x40314e
mov ebp, dword [esp + 0xf314]
xor eax, eax
neg ebp
sbb ebp, ebp
and ebp, 0xff
inc ebp
cmp ebp, edi
mov dword [0x4b94e8], 4
mov dword [esp + 0x2c], eax
jle 0x40312e
cmp dword [esp + 0xf314], edi
jne 0x40302f
xor eax, eax
jmp 0x40303b
xor ecx, ecx
cmp eax, 0xff
setl cl
mov eax, ecx
push eax
mov eax, dword [esp + 0x14]
mov edx, dword [eax + 0x4440]
mov ecx, dword [eax + 0x4460]
push edx
movzx edx, word [eax + 0x4438]
or ecx, 2
push ecx
mov ecx, dword [eax + 0x445c]
push edx
mov edx, dword [eax + 0x4458]
push ecx
mov ecx, dword [eax + 0x4454]
push edx
mov edx, dword [eax + 0x4450]
push ecx
mov ecx, dword [eax + 0x444c]
push edx
mov edx, dword [eax + 0x4448]
push edi
push edi
push ecx
push edx
lea edx, [eax + 0x41a8]
mov eax, dword [eax + 0x43ec]
lea ecx, [esp + 0x8c]
push ecx
mov ecx, dword [esp + 0xa8]
push edx
mov edx, dword [ebx + 4]
push eax
mov eax, dword [ebx]
push ecx
mov ecx, dword [esp + 0x80]
push edx
push eax
push ecx
push edi
call fcn.00459490
mov esi, eax
add esp, 0x50
cmp esi, edi
jne 0x40315d
mov esi, dword [esp + 0x18]
push edi
push edi
push edi
xor eax, eax
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x402faf
mov edx, dword [esp + 0x40]
push edx
push esi
push 1
call fcn.00459e60
add esp, 0xc
test eax, eax
je 0x402faf
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x444c]
mov edx, dword [eax + 0x4448]
push edi
push 1
push ecx
push edx
mov eax, esi
push ebx
push eax
call fcn.00459fc0
mov esi, eax
add esp, 0x18
cmp esi, edi
jne 0x40315d
mov eax, dword [esp + 0x2c]
inc eax
cmp eax, ebp
mov dword [esp + 0x2c], eax
jl 0x403022
mov ecx, dword [esp + 0xf314]
push ecx
push 0xffffffffffffffff
call fcn.00401cc0
add esp, 8
mov dword [0x4b94e8], 6
xor esi, esi
jmp 0x40315d
mov esi, 0x21
mov dword [0x4b94e8], 5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, dword [esp + 0x18]
xor ebp, ebp
mov dword [esp + 0x30], eax
cmp dword [esp + 0x78], ebp
je 0x4031ab
cmp ebx, 0xffffffff
je 0x4031ab
mov eax, dword [esp + 0x10]
mov edi, dword [esp + 0x1c]
cmp eax, ebp
je 0x4031c4
cmp edi, ebp
je 0x4031b3
mov ecx, dword [esp + 0x38]
cmp ecx, ebp
jl 0x4031b3
jg 0x403198
cmp dword [esp + 0x34], ebp
jbe 0x4031b3
mov edx, dword [esp + 0x34]
push ecx
push edx
push eax
push edi
push ebx
call fcn.004017d0
add esp, 0x14
jmp 0x4031af
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x10]
cmp eax, ebp
je 0x4031c4
push eax
call fcn.0042c060
add esp, 4
mov dword [esp + 0x10], ebp
cmp edi, ebp
je 0x4031d1
push edi
call fcn.0042c060
add esp, 4
mov eax, dword [esp + 0x5c]
cmp eax, ebp
je 0x4031e6
push eax
call fcn.0042c060
add esp, 4
mov dword [esp + 0x5c], ebp
cmp byte [esp + 0x1b0], 0
je 0x403208
mov ecx, dword [esp + 0x90]
lea eax, [esp + 0x1b0]
push eax
push ecx
call fcn.004305f0
add esp, 8
cmp ebx, 0xffffffff
je 0x403214
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x20]
cmp eax, ebp
je 0x403225
push eax
call fcn.0046bcd4
add esp, 4
mov ebx, dword [esp + 0x40]
cmp ebx, ebp
je 0x40325f
mov ecx, 0x200
mov edx, ebx
mov edi, ecx
mov eax, ebx
mov byte [eax], 0
inc eax
sub edi, 1
jne 0x403238
dec ecx
mov byte [edx], 0
inc edx
cmp ecx, ebp
jne 0x403241
push 0x200
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualUnlock]
push ebx
call fcn.0046bcd4
add esp, 4
mov eax, dword [esp + 0x58]
cmp eax, ebp
je 0x403270
push eax
call fcn.0046bcd4
add esp, 4
mov edi, dword [esp + 0x88]
mov ebx, dword [esp + 0x84]
cmp edi, ebp
ja 0x40328a
cmp ebx, ebp
jbe 0x40331d
push 0xea5e
lea eax, [esp + 0x8aa]
xor edx, edx
push ebp
push eax
mov word [esp + 0x8b0], dx
call fcn.0046bf90
push 0x3e6
lea edx, [esp + 0x2c6]
xor ecx, ecx
push ebp
push edx
mov word [esp + 0x2cc], cx
call fcn.0046bf90
add esp, 0x18
lea eax, [esp + 0x2b4]
push eax
mov eax, dword [esp + 0x68]
push edi
cdq
push ebx
push edx
push eax
call fcn.0046bca0
push edx
push eax
call fcn.00431fd0
add esp, 0xc
lea ecx, [esp + 0x2b4]
push ecx
push edi
push ebx
push str.ZEROED_BAD_SECTOR_COUNT
call fcn.0044c960
add esp, 4
push eax
lea edx, [esp + 0x8b4]
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [esp + 0x8b8]
push eax
call fcn.00433d40
add esp, 0x18
cmp esi, ebp
je 0x403331
cmp esi, 0x21
je 0x403331
mov ecx, dword [esp + 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [esp + 0xf304]
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0046be7b
add esp, 0xf2f8
ret