Function at 0x40a130
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x445c60
mov eax, dword fs:[0]
push eax
sub esp, 0x24
push ebx
push ebp
push esi
push edi
mov eax, dword [0x45accc]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
mov esi, ecx
xor ebx, ebx
mov dword [esp + 0x40], ebx
call fcn.0041aec8
xor ecx, ecx
cmp eax, ebx
setne cl
cmp ecx, ebx
jne 0x40a179
push 0x80004005
call fcn.00401460
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
lea edi, [eax + 0x10]
mov dword [esp + 0x18], edi
push 2
lea edx, [esp + 0x34]
push edx
xor eax, eax
push eax
mov eax, dword [esp + 0x58]
xor ecx, ecx
push ecx
mov ecx, dword [eax]
push ecx
mov byte [esp + 0x54], 1
mov dword [esp + 0x34], ebx
mov dword [esp + 0x40], ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x48], ebx
mov dword [esp + 0x44], ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
or ebp, 0xffffffff
cmp eax, ebp
jne 0x40a232
lea edx, [esp + 0x18]
push str._Error__Tester_build_image_failure_on_set_file_pointer___r_n
push edx
call fcn.004026d0
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x50]
add esp, 8
push esi
push 0x3ee
call fcn.0041a30b
lea eax, [esi - 0x10]
mov byte [esp + 0x40], bl
lea ecx, [eax + 0xc]
mov edx, ebp
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a207
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x50]
add eax, 0xfffffff0
mov dword [esp + 0x40], ebp
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebp
dec ebp
test ebp, ebp
jg 0x40a228
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
jmp 0x40a47f
mov ecx, dword [esp + 0x50]
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocString
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esp + 0x28], eax
cmp eax, ebp
jne 0x40a2c8
lea edx, [esp + 0x18]
push str._Error__Open_BIN_File_Fail____r_n
push edx
call fcn.004026d0
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x50]
add esp, 8
push esi
push 0x3ee
call fcn.0041a30b
lea eax, [esi - 0x10]
mov byte [esp + 0x40], bl
lea ecx, [eax + 0xc]
mov edx, ebp
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a299
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x50]
add eax, 0xfffffff0
mov dword [esp + 0x40], ebp
lea ecx, [eax + 0xc]
lock xadd dword [ecx], ebp
dec ebp
test ebp, ebp
jg 0x40a228
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
jmp 0x40a47f
mov ecx, dword [esp + 0x58]
push ecx
lea ecx, [esp + 0x1b]
call fcn.00406db0
mov edx, dword [esp + 0x5c]
push ebx
mov dword [edx], ebx
call fcn.00406f60
add esp, 4
xor ebp, ebp
cmp dword [esp + 0x54], ebx
jbe 0x40a435
mov dword [esp + 0x1c], ebx
mov edi, dword [esp + 0x28]
push ebx
lea eax, [esp + 0x28]
push eax
mov ecx, ebp
shl ecx, 9
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40a495
mov edx, dword [esi + 0x204]
push 0x200
push ebx
push edx
call fcn.00431320
mov ecx, dword [esi + 0x204]
add esp, 0xc
push ebx
lea eax, [esp + 0x30]
push eax
push 0x200
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
test eax, eax
je 0x40a502
mov eax, dword [esi + 0x204]
mov ecx, dword [esp + 0x50]
lea edx, [esp + 0x24]
push edx
mov edx, dword [ecx]
push 0x200
push eax
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40a543
cmp dword [esp + 0x20], 0x200
jne 0x40a543
mov al, byte [0x45ca37]
cmp al, bl
jne 0x40a3b7
mov eax, dword [esi + 0x204]
mov ecx, dword [esp + 0x58]
push 0x200
push eax
push ecx
lea ecx, [esp + 0x23]
call fcn.00406dc0
mov edx, dword [esi + 0x204]
mov eax, dword [esp + 0x5c]
push ebx
push 0x200
push edx
push eax
jmp 0x40a3ed
cmp al, 1
jne 0x40a3d7
mov ecx, dword [esi + 0x204]
mov edx, dword [esp + 0x58]
push 0x200
push ecx
push edx
lea ecx, [esp + 0x23]
call fcn.00406dc0
jmp 0x40a3f5
cmp al, 2
jne 0x40a3f5
mov eax, dword [esi + 0x204]
mov ecx, dword [esp + 0x5c]
push ebx
push 0x200
push eax
push ecx
call fcn.00406f80
add esp, 0x10
mov eax, dword [esp + 0x1c]
xor edx, edx
div dword [esp + 0x54]
lea edx, [esp + 0x18]
push eax
push str.Complete:__d_percent
push edx
call fcn.004026d0
mov edi, dword [esp + 0x24]
mov ecx, dword [esp + 0x54]
add esp, 0xc
push edi
push 0x3ee
call fcn.0041a30b
add dword [esp + 0x1c], 0x64
inc ebp
cmp ebp, dword [esp + 0x54]
jb 0x40a2f5
add edi, 0xfffffff0
mov byte [esp + 0x40], bl
lea ecx, [edi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a455
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
mov eax, dword [esp + 0x50]
add eax, 0xfffffff0
mov dword [esp + 0x40], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a47d
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret 0x18
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [esp + 0x18]
push str._Error__Set_BIN_File_Pointer_Fail____r_n
push eax
call fcn.004026d0
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x50]
add esp, 8
push esi
push 0x3ee
call fcn.0041a30b
lea eax, [esi - 0x10]
mov byte [esp + 0x40], bl
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40a4e1
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x50]
add eax, 0xfffffff0
mov dword [esp + 0x40], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jmp 0x40a21c
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str._Error__Set_BIN_File_Pointer_Fail____r_n
lea ecx, [esp + 0x1c]
push ecx
call fcn.004026d0
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x50]
add esp, 8
push esi
push 0x3ee
call fcn.0041a30b
lea eax, [esi - 0x10]
mov byte [esp + 0x40], bl
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jmp 0x40a4d5
push str._Error__Save_Image_failure___r_n
jmp 0x40a50d